Skip to content

Fix LoKr key mapping for AI-Toolkit Chroma/Flux models#5

Open
Valheol wants to merge 1 commit intoAbstractEyes:mainfrom
Valheol:main
Open

Fix LoKr key mapping for AI-Toolkit Chroma/Flux models#5
Valheol wants to merge 1 commit intoAbstractEyes:mainfrom
Valheol:main

Conversation

@Valheol
Copy link

@Valheol Valheol commented Dec 18, 2025

This fix resolves the issue where LoKr models trained with AI-Toolkit for Chroma (Flux-based) models were not loading correctly, resulting in hundreds of "lora key not loaded" errors.

Changes:

  • Added key conversion for lycoris_double_blocks_* and lycoris_single_blocks_* patterns to properly map AI-Toolkit naming to ComfyUI's expected format
  • Removed incorrect img_attn/txt_attn dot-to-underscore conversions that were breaking the correct format for Chroma/Flux models

The fix only modifies key names (strings) and does not duplicate or copy any tensors, ensuring zero VRAM impact.

Fixes key mapping for:

  • Double block layers (img_attn, txt_attn, img_mlp, txt_mlp)
  • Single block layers (linear1, linear2)
  • All LoKr component types (lokr_w1, lokr_w2, alpha, etc.)

This fix resolves the issue where LoKr models trained with AI-Toolkit for
Chroma (Flux-based) models were not loading correctly, resulting in hundreds
of "lora key not loaded" errors.

Changes:
- Added key conversion for lycoris_double_blocks_* and lycoris_single_blocks_*
  patterns to properly map AI-Toolkit naming to ComfyUI's expected format
- Removed incorrect img_attn/txt_attn dot-to-underscore conversions that were
  breaking the correct format for Chroma/Flux models

The fix only modifies key names (strings) and does not duplicate or copy any
tensors, ensuring zero VRAM impact.

Fixes key mapping for:
- Double block layers (img_attn, txt_attn, img_mlp, txt_mlp)
- Single block layers (linear1, linear2)
- All LoKr component types (lokr_w1, lokr_w2, alpha, etc.)

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant