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 a proper error to the user when a vision model file is invalid.

comfyanonymous49b732afd54e
diff --git a/nodes.py b/nodes.py
index 272c2a25e..218f93256 100644
--- a/nodes.py
+++ b/nodes.py
@@ -1006,6 +1006,8 @@ class CLIPVisionLoader:
def load_clip(self, clip_name):
clip_path = folder_paths.get_full_path_or_raise("clip_vision", clip_name)
clip_vision = comfy.clip_vision.load(clip_path)
+ if clip_vision is None:
+ raise RuntimeError("ERROR: clip vision file is invalid and does not contain a valid vision model.")
return (clip_vision,)
class CLIPVisionEncode: