diff --git a/adv_control/control.py b/adv_control/control.py index fff8280..79b5e60 100644 --- a/adv_control/control.py +++ b/adv_control/control.py @@ -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) diff --git a/adv_control/nodes.py b/adv_control/nodes.py index a018406..0d6025e 100644 --- a/adv_control/nodes.py +++ b/adv_control/nodes.py @@ -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):