Skip to content

Commit f935d42

Browse files
Support SimpleTuner lycoris lora format for HiDream.
1 parent a97f2f8 commit f935d42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

comfy/lora.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ def model_lora_keys_unet(model, key_map={}):
279279
key_map["transformer.{}".format(key_lora)] = k
280280
key_map["diffusion_model.{}".format(key_lora)] = k # Old loras
281281

282+
if isinstance(model, comfy.model_base.HiDream):
283+
for k in sdk:
284+
if k.startswith("diffusion_model."):
285+
if k.endswith(".weight"):
286+
key_lora = k[len("diffusion_model."):-len(".weight")].replace(".", "_")
287+
key_map["lycoris_{}".format(key_lora)] = k #SimpleTuner lycoris format
288+
282289
return key_map
283290

284291

0 commit comments

Comments
 (0)