From 3b7c8c78920ffb826a9b0ed348a67e155e2269b4 Mon Sep 17 00:00:00 2001 From: yjy415 <2471352175@qq.com> Date: Sun, 16 Aug 2026 13:25:17 +0800 Subject: [PATCH] Support MiniSupport MiniMax-H3 and HiDreamO1 loras trained with DiffSynth-Studio and ModelScope --- comfy/lora.py | 6 ++++++ comfy/lora_convert.py | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/comfy/lora.py b/comfy/lora.py index f0af526b5..aa98be152 100644 --- a/comfy/lora.py +++ b/comfy/lora.py @@ -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 diff --git a/comfy/lora_convert.py b/comfy/lora_convert.py index 30ec1024f..3580375f1 100644 --- a/comfy/lora_convert.py +++ b/comfy/lora_convert.py @@ -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