Skip to content

fix: align text_encoder_out_layers default with pipeline for Flux 2 Klein#13455

Open
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Anai-Guo:fix-flux2-klein-default-layers
Open

fix: align text_encoder_out_layers default with pipeline for Flux 2 Klein#13455
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Anai-Guo:fix-flux2-klein-default-layers

Conversation

@Anai-Guo
Copy link
Copy Markdown

Problem

The --text_encoder_out_layers CLI argument in train_dreambooth_lora_flux2_klein.py defaults to [10, 20, 30], but the pipeline implementation (pipeline_flux2_klein.py) uses (9, 18, 27).

This off-by-one mismatch causes the training script to use different text encoder layers than what the pipeline expects at inference time, leading to silently degraded results.

Fix

Change the CLI default from [10, 20, 30] to [9, 18, 27] to match the pipeline.

Fixes #13445

The CLI default [10, 20, 30] does not match the layers actually used in pipeline_flux2_klein.py (9, 18, 27). This off-by-one causes silent incorrect behavior during training.

Fixes huggingface#13445
@github-actions github-actions bot added examples size/S PR with diff < 50 LOC labels Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong default layers for Flux 2 Klein

1 participant