Skip to content

fix(lora): load ai-toolkit DoRA magnitudes across architectures - #9568

Open
zjn20030811 wants to merge 1 commit into
invoke-ai:mainfrom
zjn20030811:fix-aitoolkit-dora-magnitude
Open

fix(lora): load ai-toolkit DoRA magnitudes across architectures#9568
zjn20030811 wants to merge 1 commit into
invoke-ai:mainfrom
zjn20030811:fix-aitoolkit-dora-magnitude

Conversation

@zjn20030811

Copy link
Copy Markdown

Summary

ai-toolkit DoRA adapters store the output-dimension magnitude as either .magnitude or .lora_magnitude_vector.weight. The LoRA converters previously split these keys with a fallback parser, producing invalid layer groups or an unsupported format error. This change recognizes both suffixes across the Wan, Z-Image, Anima, Qwen Image, and FLUX conversion paths and maps them to the existing dora_magnitude representation.

The FLUX fused-QKV path now carries the magnitude (and existing input-dimension scale) into each output slice, preserving the correct orientation during conversion. Anima LoKR combinations strip either DoRA magnitude convention consistently.

Related Issues / Discussions

Closes #9558

QA Instructions

  • Added non-square output-dimension regression coverage for both suffix spellings in each affected architecture.
  • Added fused-QKV FLUX coverage to verify output-channel magnitude slicing.
  • Ran the focused conversion suite: 133 passed.
  • Ran ruff check, ruff format --check, and git diff --check on all changed files.

Merge Plan

Normal backend merge; no schema or database changes.

@github-actions github-actions Bot added python PRs that change python files backend PRs that change backend files python-tests PRs that change python tests labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend PRs that change backend files python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ai-toolkit DoRA (.magnitude) adapters fail to load for every base except Krea-2

1 participant