From ca7c310a0e8474c992b88fcf0f87040372f9c2c4 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 25 Feb 2024 08:29:12 -0500 Subject: [PATCH] Support loading old CLIP models saved with CLIPSave. --- comfy/sd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy/sd.py b/comfy/sd.py index d208abe6609..fd5d604e0f4 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -365,6 +365,9 @@ class EmptyClass: for i in range(len(clip_data)): if "transformer.resblocks.0.ln_1.weight" in clip_data[i]: clip_data[i] = comfy.utils.clip_text_transformers_convert(clip_data[i], "", "") + else: + if "text_projection" in clip_data[i]: + clip_data[i]["text_projection.weight"] = clip_data[i]["text_projection"].transpose(0, 1) #old models saved with the CLIPSave node clip_target = EmptyClass() clip_target.params = {}