Skip to content

Handle Anima LoRA alpha keys#14165

Open
rathodkunj2005 wants to merge 1 commit into
huggingface:mainfrom
rathodkunj2005:fix-anima-comfy-lora-alpha
Open

Handle Anima LoRA alpha keys#14165
rathodkunj2005 wants to merge 1 commit into
huggingface:mainfrom
rathodkunj2005:fix-anima-comfy-lora-alpha

Conversation

@rathodkunj2005

Copy link
Copy Markdown

What

Fixes Anima Comfy-format LoRA conversion when checkpoints include .alpha keys.

The Anima converter already maps diffusion_model.* keys into Diffusers module names, but left .alpha entries in the returned state dict. AnimaLoraLoaderMixin.load_lora_weights() then rejected those keys because they do not contain the lora substring.

This PR folds alpha scaling into the converted LoRA weights and removes the standalone .alpha keys, matching the behavior used by other LoRA converters in this file.

Fixes #14088.

Verification

python -m pytest tests/loaders/test_lora_conversion_utils.py -q
# ..                                                                       [100%]
# 2 passed in 0.05s

python -m ruff check src/diffusers/loaders/lora_conversion_utils.py tests/loaders/test_lora_conversion_utils.py
# All checks passed!

@github-actions github-actions Bot added fixes-issue size/M PR with diff < 200 LOC lora tests and removed size/M PR with diff < 200 LOC fixes-issue labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling of .alpha in from-comfy converters

1 participant