Support MiniSupport MiniMax-H3 and HiDreamO1 loras trained with DiffSynth-Studio and ModelScope
This commit is contained in:
parent
301f02d019
commit
3b7c8c7892
|
|
@ -381,6 +381,12 @@ def model_lora_keys_unet(model, key_map={}):
|
|||
key_lora = k[len("diffusion_model."):-len(".weight")]
|
||||
key_map["{}".format(key_lora)] = k
|
||||
|
||||
if isinstance(model, comfy.model_base.MiniMaxH3):
|
||||
for k in sdk:
|
||||
if k.startswith("diffusion_model.") and k.endswith(".weight"):
|
||||
key_lora = k[len("diffusion_model."):-len(".weight")]
|
||||
key_map[key_lora] = k
|
||||
|
||||
return key_map
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,13 +32,6 @@ def convert_uso_lora(sd):
|
|||
sd_out[k_to] = tensor
|
||||
return sd_out
|
||||
|
||||
def convert_lora_minimax_h3(sd):
|
||||
sd_out = {}
|
||||
for k in sd:
|
||||
sd_out["diffusion_model.{}".format(k)] = sd[k]
|
||||
return sd_out
|
||||
|
||||
|
||||
def convert_lora(sd):
|
||||
if "img_in.lora_A.weight" in sd and "single_blocks.0.norm.key_norm.scale" in sd:
|
||||
return convert_lora_bfl_control(sd)
|
||||
|
|
@ -46,6 +39,4 @@ def convert_lora(sd):
|
|||
return convert_lora_wan_fun(sd)
|
||||
if "single_blocks.37.processor.qkv_lora.up.weight" in sd and "double_blocks.18.processor.qkv_lora2.up.weight" in sd:
|
||||
return convert_uso_lora(sd)
|
||||
if "blocks.0.attn.qkv_proj.lora_A.default.weight" in sd:
|
||||
return convert_lora_minimax_h3(sd)
|
||||
return sd
|
||||
|
|
|
|||
Loading…
Reference in New Issue