Skip to content

Commit

Permalink
Print warning when controlnet can't be applied instead of crashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Nov 16, 2023
1 parent dcec104 commit 7ea6bb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion comfy/ldm/modules/diffusionmodules/openaimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ def apply_control(h, control, name):
if control is not None and name in control and len(control[name]) > 0:
ctrl = control[name].pop()
if ctrl is not None:
h += ctrl
try:
h += ctrl
except:
print("warning control could not be applied", h.shape, ctrl.shape)
return h

class UNetModel(nn.Module):
Expand Down

0 comments on commit 7ea6bb0

Please sign in to comment.