mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-04-24 06:46:13 +00:00
14 lines
415 B
Python
14 lines
415 B
Python
def AceStepConditionEncoderStateDictConverter(state_dict):
|
|
new_state_dict = {}
|
|
prefix = "encoder."
|
|
|
|
for key in state_dict:
|
|
if key.startswith(prefix):
|
|
new_key = key[len(prefix):]
|
|
new_state_dict[new_key] = state_dict[key]
|
|
|
|
if "null_condition_emb" in state_dict:
|
|
new_state_dict["null_condition_emb"] = state_dict["null_condition_emb"]
|
|
|
|
return new_state_dict
|