DiffSynth-Studio 2.0 major update

This commit is contained in:
root
2025-12-04 16:33:07 +08:00
parent afd101f345
commit 72af7122b3
758 changed files with 26462 additions and 2221398 deletions

View File

@@ -0,0 +1,17 @@
def Flux2TextEncoderStateDictConverter(state_dict):
rename_dict = {
"multi_modal_projector.linear_1.weight": "model.multi_modal_projector.linear_1.weight",
"multi_modal_projector.linear_2.weight": "model.multi_modal_projector.linear_2.weight",
"multi_modal_projector.norm.weight": "model.multi_modal_projector.norm.weight",
"multi_modal_projector.patch_merger.merging_layer.weight": "model.multi_modal_projector.patch_merger.merging_layer.weight",
"language_model.lm_head.weight": "lm_head.weight",
}
state_dict_ = {}
for k in state_dict:
k_ = k
k_ = k_.replace("language_model.model", "model.language_model")
k_ = k_.replace("vision_tower", "model.vision_tower")
if k_ in rename_dict:
k_ = rename_dict[k_]
state_dict_[k_] = state_dict[k]
return state_dict_