Files
DiffSynth-Studio/diffsynth/utils/state_dict_converters/stable_diffusion_text_encoder.py
mi804 82e482286c sd
2026-04-23 17:35:24 +08:00

8 lines
289 B
Python

def SDTextEncoderStateDictConverter(state_dict):
new_state_dict = {}
for key in state_dict:
if key.startswith("text_model.") and "position_ids" not in key:
new_key = "model." + key
new_state_dict[new_key] = state_dict[key]
return new_state_dict