Skip to content

fix: handle CLIP text_model prefix change in transformers>=5 for FLUX LoRA loading#14035

Open
KartavyaDikshit wants to merge 1 commit into
huggingface:mainfrom
KartavyaDikshit:fix-issue-13984
Open

fix: handle CLIP text_model prefix change in transformers>=5 for FLUX LoRA loading#14035
KartavyaDikshit wants to merge 1 commit into
huggingface:mainfrom
KartavyaDikshit:fix-issue-13984

Conversation

@KartavyaDikshit

Copy link
Copy Markdown

Resolves #13984

Under transformers>=5, CLIPTextModel was flattened and no longer includes the wrapper prefix in named_modules(). This caused kohya-style FLUX LoRA weights with CLIP text-encoder keys to fail with IndexError because the rank dict stayed empty. The fix normalizes module name matching in _load_lora_into_text_encoder to handle both prefixed and unprefixed names.

… LoRA

Signed-off-by: Kartavya Dikshit <kartavyaniraj.dikshit2021@vitstudent.ac.in>
@github-actions github-actions Bot added lora fixes-issue size/S PR with diff < 50 LOC labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes-issue lora size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FLUX LoRA with CLIP text-encoder weights fails (empty rank -> IndexError) under transformers>=5

1 participant