1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Controlnet/t2iadapter cleanup.

This commit is contained in:
comfyanonymous
2023-08-21 23:20:49 -04:00
parent 763b0cf024
commit cf5ae46928
3 changed files with 58 additions and 55 deletions

View File

@@ -632,7 +632,9 @@ class UNetModel(nn.Module):
transformer_options["block"] = ("middle", 0)
h = forward_timestep_embed(self.middle_block, h, emb, context, transformer_options)
if control is not None and 'middle' in control and len(control['middle']) > 0:
h += control['middle'].pop()
ctrl = control['middle'].pop()
if ctrl is not None:
h += ctrl
for id, module in enumerate(self.output_blocks):
transformer_options["block"] = ("output", id)