Skip to content

Commit

Permalink
Support loading old CLIP models saved with CLIPSave.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Feb 25, 2024
1 parent 8d7910c commit ca7c310
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comfy/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit ca7c310

Please sign in to comment.