Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Show the user an error when the controlnet file is invalid.

comfyanonymous2f7d8159c32d
diff --git a/nodes.py b/nodes.py
index 218f93256..55d832df9 100644
--- a/nodes.py
+++ b/nodes.py
@@ -786,6 +786,8 @@ class ControlNetLoader:
def load_controlnet(self, control_net_name):
controlnet_path = folder_paths.get_full_path_or_raise("controlnet", control_net_name)
controlnet = comfy.controlnet.load_controlnet(controlnet_path)
+ if controlnet is None:
+ raise RuntimeError("ERROR: controlnet file is invalid and does not contain a valid controlnet model.")
return (controlnet,)
class DiffControlNetLoader: