Skip to content

OneTrainer ERNIE LoRA support#13640

Merged
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
prookyon:onetrainer-ernie-lora
Apr 30, 2026
Merged

OneTrainer ERNIE LoRA support#13640
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
prookyon:onetrainer-ernie-lora

Conversation

@prookyon

Copy link
Copy Markdown
Contributor

This is needed to support LoRA for ERNIE made with OneTrainer.
Reasoning is the same as for example in this PR for Z-image:

#11135 (comment)

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 940466ed-17e4-449f-b60e-f2f6cfe87334

📥 Commits

Reviewing files that changed from the base of the PR and between b633244 and 85af52f.

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

📝 Walkthrough

Walkthrough

A conditional branch is added in the model_lora_keys_unet function to handle ErnieImage models. The branch translates state-dict entries with diffusion_model.<...>.weight key names into transformer.<...> key names. This extension applies only to ErnieImage model instances and does not modify existing LoRA key mappings for other model types. The change adds six lines of code.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the main change: adding LoRA support for ERNIE models trained with OneTrainer.
Description check ✅ Passed The description clearly relates to the changeset, explaining the purpose of supporting LoRA for ERNIE models and referencing a similar prior implementation.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@comfyanonymous comfyanonymous merged commit e9c311b into Comfy-Org:master Apr 30, 2026
14 checks passed
@prookyon prookyon deleted the onetrainer-ernie-lora branch May 1, 2026 11:52
HeinzDBV pushed a commit to HeinzDBV/ComfyUI that referenced this pull request May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants