Skip to content

Commit

Permalink
fix to work with .ckpt from comfyui
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Jul 5, 2023
1 parent 3d0375d commit 4a34e58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/sdxl_model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def convert_key(key):
key = key.replace(".token_embedding.weight", ".embeddings.token_embedding.weight")
elif ".ln_final" in key:
key = key.replace(".ln_final", ".final_layer_norm")
# ckpt from comfy has this key: text_model.encoder.text_model.embeddings.position_ids
elif ".embeddings.position_ids" in key:
key = None # remove this key: make position_ids by ourselves
return key

keys = list(checkpoint.keys())
Expand Down

0 comments on commit 4a34e58

Please sign in to comment.