Print warning when controlnet can't be applied instead of crashing.

main
comfyanonymous 1 year ago
parent dcec1047e6
commit 7ea6bb038c

@ -255,7 +255,10 @@ def apply_control(h, control, name):
if control is not None and name in control and len(control[name]) > 0: if control is not None and name in control and len(control[name]) > 0:
ctrl = control[name].pop() ctrl = control[name].pop()
if ctrl is not None: if ctrl is not None:
h += ctrl try:
h += ctrl
except:
print("warning control could not be applied", h.shape, ctrl.shape)
return h return h
class UNetModel(nn.Module): class UNetModel(nn.Module):

Loading…
Cancel
Save