From d3f5998218ee488dd64fc63c8d095850cccab2b9 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 9 Jul 2023 09:33:53 -0400 Subject: [PATCH] Support loading clip_g from diffusers in CLIP Loader nodes. --- comfy/sdxl_clip.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/comfy/sdxl_clip.py b/comfy/sdxl_clip.py index f676d8c814b..d9298b20545 100644 --- a/comfy/sdxl_clip.py +++ b/comfy/sdxl_clip.py @@ -35,6 +35,8 @@ def clip_layer(self, layer_idx): def load_sd(self, sd): if "text_projection" in sd: self.text_projection[:] = sd.pop("text_projection") + if "text_projection.weight" in sd: + self.text_projection[:] = sd.pop("text_projection.weight").transpose(0, 1) return super().load_sd(sd) class SDXLClipGTokenizer(sd1_clip.SD1Tokenizer):