Conversation
The Qwen converter dropped per-module `.alpha` when keys were already named lora_A/lora_B, so LoRAs with alpha != rank loaded at the wrong strength (e.g. e-n-v-y/Qwen-Image-2.1-Fix-v2.0 at about a third). Fold it into the weights as the lora_down/lora_up path already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 of 10 tasks
Contributor
|
Hi @dkackman, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice. Once the PR links an issue (or gets the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #14938
When a Qwen-Image LoRA's keys are already named
lora_A/lora_B, the converter threw away the per-module.alpha. LoRAs trained with alpha ≠ rank therefore loaded at the wrong strength. For example, e-n-v-y/Qwen-Image-2.1-Fix-v2.0 loads at about a third of its intended strength. ai-toolkit and ComfyUI LoRAs commonly use this layout.This PR folds the alpha into the weights, the same way the converter's
lora_down/lora_uppath and the Z-Image converter already do.Behaviour changes:
alpha / rank, not 1.0. Users who compensated withlora_scalewill see different results.lora_Awithout a matchinglora_B(or the reverse) now raises an error instead of being passed through, as in thelora_down/lora_uppath.LoRAs saved with
lora_down/lora_upkeys are unaffected, because alpha was already applied there. That includes thelightx2v/Qwen-Image-LightningLoRAs used in the docs.Related: #14932. Both PRs edit
_convert_non_diffusers_qwen_lora_to_diffusers, so whichever merges second needs a small rebase.Self-review notes
I ran the
self-reviewskill. It found no blocking issues. Left for review:<module>.alphais still dropped without a warning, as before. Removing that cleanup would make it raise instead. I kept the existing behaviour, but I'm happy to change it.Before submitting
self-reviewskill on the diff?Who can review?
@sayakpaul
🤖 Generated with Claude Code