Added checks for None control_net to produce more helpful error messages for users
This commit is contained in:
@@ -504,6 +504,8 @@ def load_controlnet(ckpt_path, timestep_keyframe: TimestepKeyframeGroup=None, mo
|
||||
control = comfy_cn.load_controlnet(ckpt_path, model=model)
|
||||
finally:
|
||||
comfy.utils.load_torch_file = orig_load_torch_file
|
||||
if control is None:
|
||||
raise Exception(f"Something went wrong when loading '{ckpt_path}'; ControlNet is None.")
|
||||
return convert_to_advanced(control, timestep_keyframe=timestep_keyframe)
|
||||
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ class AdvancedControlNetApply:
|
||||
if prev_cnet in cnets:
|
||||
c_net = cnets[prev_cnet]
|
||||
else:
|
||||
# make sure control_net is not None to avoid confusing error messages
|
||||
if control_net is None:
|
||||
raise Exception("Passed in control_net is None; something must have went wrong when loading it from a Load ControlNet node.")
|
||||
# copy, convert to advanced if needed, and set cond
|
||||
c_net = convert_to_advanced(control_net.copy()).set_cond_hint(control_hint, strength, (start_percent, end_percent), vae_optional)
|
||||
if is_advanced_controlnet(c_net):
|
||||
|
||||
Reference in New Issue
Block a user