From 1ebce77a446407c2a48802111816401051ab9798 Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:14:07 +0200 Subject: [PATCH] Fix for single CLIP Loader #52 --- nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 43c3d82..3451fc7 100644 --- a/nodes.py +++ b/nodes.py @@ -189,10 +189,10 @@ def load_patcher(self, clip_paths, clip_type, clip_data): clip.patcher = GGUFModelPatcher.clone(clip.patcher) # for some reason this is just missing in some SAI checkpoints - if hasattr(clip.cond_stage_model, "clip_l"): + if getattr(clip.cond_stage_model, "clip_l", None) is not None: if clip.cond_stage_model.clip_l.transformer.text_projection.weight.tensor_shape == None: clip.cond_stage_model.clip_l.transformer.text_projection = comfy.ops.manual_cast.Linear(768, 768) - if hasattr(clip.cond_stage_model, "clip_g"): + if getattr(clip.cond_stage_model, "clip_g", None) is not None: if clip.cond_stage_model.clip_g.transformer.text_projection.weight.tensor_shape == None: clip.cond_stage_model.clip_g.transformer.text_projection = comfy.ops.manual_cast.Linear(1280, 1280)