Support MiniSupport MiniMax-H3 and HiDreamO1 loras trained with DiffSynth-Studio and ModelScope

This commit is contained in:
yjy415 2026-08-16 13:25:17 +08:00
parent 301f02d019
commit 3b7c8c7892
2 changed files with 6 additions and 9 deletions

View File

@ -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

View File

@ -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