Skip to content

Commit

Permalink
Make saved SD1 checkpoints match more closely the official one.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Mar 18, 2024
1 parent d3406d8 commit cacb022
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions comfy/supported_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def process_clip_state_dict(self, state_dict):
return state_dict

def process_clip_state_dict_for_saving(self, state_dict):
pop_keys = ["clip_l.transformer.text_projection.weight", "clip_l.logit_scale"]
for p in pop_keys:
if p in state_dict:
state_dict.pop(p)

replace_prefix = {"clip_l.": "cond_stage_model."}
return utils.state_dict_prefix_replace(state_dict, replace_prefix)

Expand Down

0 comments on commit cacb022

Please sign in to comment.