Fix: HiDream-O1 LoRA loading

This commit is contained in:
yjy415 2026-07-04 20:59:23 +08:00
parent 92594ca84c
commit bd9086426f

View File

@ -304,6 +304,15 @@ def model_lora_keys_unet(model, key_map={}):
key_map["lycoris_{}".format(key_lora.replace(".", "_"))] = k #SimpleTuner lycoris format
key_map["transformer.{}".format(key_lora)] = k #SimpleTuner regular format
if isinstance(model, comfy.model_base.HiDreamO1):
for k in sdk:
if k.startswith("diffusion_model."):
if k.endswith(".weight"):
key_lora = k[len("diffusion_model."):-len(".weight")]
key_map["lycoris_{}".format(key_lora.replace(".", "_"))] = k
key_map["transformer.{}".format(key_lora)] = k
key_map["model.{}".format(key_lora)] = k
if isinstance(model, comfy.model_base.ACEStep):
for k in sdk:
if k.startswith("diffusion_model.") and k.endswith(".weight"): #Official ACE step lora format