LoRA and checkpoint conversion util - #1236
Merged
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Author
no, not its purpose, and you wouldn't do that on the .safetensors key level. |
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Author
|
merging this because it is required to create Flux2 checkpoints |
dxqb
marked this pull request as ready for review
February 3, 2026 13:59
Calamdor
added a commit
to Calamdor/OneTrainer
that referenced
this pull request
Mar 15, 2026
Replace hand-rolled QKV grouping and _combine_qkv() with the lora_qkv_fusion / lora_qkv_mlp_fusion helpers from convert_util (PR Nerogar#1236). Key routing is now expressed as declarative ConversionPattern tuples processed by convert_util.convert(), making the structure consistent with the Flux2 conversion approach. DoRA scale merging and text-encoder legacy remapping are kept separate as convert_util doesn't handle those cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Calamdor
added a commit
to Calamdor/OneTrainer
that referenced
this pull request
Mar 15, 2026
…o 0.45 - Rewrite convert_wan2_2_lora.py using declarative convert_util patterns (PR Nerogar#1236 framework) instead of manual str.replace chains. _BLOCK_LAYER_PATTERNS defines per-block layer name mapping with a catch-all for norm/other layers; _WAN_HIGH/LOW_NOISE_PATTERNS define the full prefix routing for each expert. Suffix rename (lora_down → lora_A) is a separate post-pass since convert_util passes suffixes through unchanged. - Update Low-Noise Expert preset: min 0.0 → 0.45. Very-low-noise timesteps (near t=0) represent near-clean images where LoRA gradients are negligible; raising the floor concentrates training steps on the region where the low-noise expert does meaningful work. - Update Combined Training preset: min 0.0 → 0.45 for the same reason. shift=7 (expert boundary bias) is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Calamdor
added a commit
to Calamdor/OneTrainer
that referenced
this pull request
Mar 20, 2026
…o 0.45 - Rewrite convert_wan2_2_lora.py using declarative convert_util patterns (PR Nerogar#1236 framework) instead of manual str.replace chains. _BLOCK_LAYER_PATTERNS defines per-block layer name mapping with a catch-all for norm/other layers; _WAN_HIGH/LOW_NOISE_PATTERNS define the full prefix routing for each expert. Suffix rename (lora_down → lora_A) is a separate post-pass since convert_util passes suffixes through unchanged. - Update Low-Noise Expert preset: min 0.0 → 0.45. Very-low-noise timesteps (near t=0) represent near-clean images where LoRA gradients are negligible; raising the floor concentrates training steps on the region where the low-noise expert does meaningful work. - Update Combined Training preset: min 0.0 → 0.45 for the same reason. shift=7 (expert boundary bias) is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Calamdor
added a commit
to Calamdor/OneTrainer
that referenced
this pull request
Mar 28, 2026
…o 0.45 - Rewrite convert_wan2_2_lora.py using declarative convert_util patterns (PR Nerogar#1236 framework) instead of manual str.replace chains. _BLOCK_LAYER_PATTERNS defines per-block layer name mapping with a catch-all for norm/other layers; _WAN_HIGH/LOW_NOISE_PATTERNS define the full prefix routing for each expert. Suffix rename (lora_down → lora_A) is a separate post-pass since convert_util passes suffixes through unchanged. - Update Low-Noise Expert preset: min 0.0 → 0.45. Very-low-noise timesteps (near t=0) represent near-clean images where LoRA gradients are negligible; raising the floor concentrates training steps on the region where the low-noise expert does meaningful work. - Update Combined Training preset: min 0.0 → 0.45 for the same reason. shift=7 (expert boundary bias) is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BitcrushedHeart
pushed a commit
to BitcrushedHeart/OneTrainer
that referenced
this pull request
Jun 20, 2026
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.
Draft to simplify and extend LoRA and checkpoint conversion
Example use (Flux2 pattern definition):