From 2f7d8159c32de22c15fbeea7ff9063f2231586bb Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 8 Apr 2025 08:11:59 -0400 Subject: [PATCH] Show the user an error when the controlnet file is invalid. --- nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodes.py b/nodes.py index 218f9325..55d832df 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: