Skip to content

Fix HiDream-O1 LoRA loading (add model_lora_keys_unet branch)#14767

Open
yjy415 wants to merge 1 commit into
Comfy-Org:masterfrom
yjy415:hidreamo1
Open

Fix HiDream-O1 LoRA loading (add model_lora_keys_unet branch)#14767
yjy415 wants to merge 1 commit into
Comfy-Org:masterfrom
yjy415:hidreamo1

Conversation

@yjy415

@yjy415 yjy415 commented Jul 4, 2026

Copy link
Copy Markdown

HiDream-O1 LoRAs trained by the community (including the training scripts distributed on ModelScope's AIGC hub) fail to load: every LoRA key emits [WARNING] lora key not loaded: model.language_model.layers... lines.

This PR adds a HiDreamO1 branch that mirrors the existing HiDream / QwenImage branches and registers the three standard prefix aliases (model.*, transformer.*, lycoris_*).

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: abadbfb2-17b2-46c2-a316-6b580d3446d7

📥 Commits

Reviewing files that changed from the base of the PR and between 6c62ca0 and bd90864.

📒 Files selected for processing (1)
  • comfy/lora.py

📝 Walkthrough

Walkthrough

This change adds support for the HiDreamO1 model type in the LoRA key mapping logic. A new conditional branch in model_lora_keys_unet scans UNet diffusion_model.* weight keys and registers three additional LoRA key mapping variants (lycoris_, transformer., model. prefixes) alongside the existing generic mapping behavior.

Changes

Area Change
comfy/lora.py Added a HiDreamO1-specific branch in model_lora_keys_unet that populates key_map with three additional LoRA key naming variants for diffusion_model.* weight entries.

Sequence Diagram(s)

Not applicable — this change is a straightforward conditional key-mapping addition without new control flow between components.

Related issues: None specified.

Related PRs: None specified.

Suggested labels: enhancement, LoRA

Suggested reviewers: comfy-org maintainers familiar with LoRA key mapping logic

Poem: A rabbit hopped through model code today, / Found HiDreamO1 without delay, / Three prefixes stitched with gentle care, / lycoris, transformer, model — laid bare, / Nine lines added, keys now align, / A tiny burrow dug just fine. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a HiDream-O1 LoRA loading branch.
Description check ✅ Passed The description is directly related and accurately explains the HiDream-O1 LoRA loading fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@comfyanonymous

Copy link
Copy Markdown
Member

Only put the prefix to get your loras working, if there are no loras using the other prefixes they are not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants