huggingface / huggingface/diffusers

FluxKlein Training Scripts - CFG issue

Open
#13,762 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

Hi everyone,

I am not sure whether it is a bug or not....but since the example training scripts and the pipeline as well try to lump the distilled and non-distilled versions together - it is a bit confusing.

So if one using this model:
https://huggingface.co/black-forest-labs/FLUX.2-klein-base-4B/tree/main/transformer

In the pipeline:
https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py#L592

we will have `do_classifier_free_guidance` evaluated as being true. Which operates only on the prompt level (this is fine, I guess).

however neirther `fluxklein` nor `fluxklein_img2img` training scripts:
https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py

do not have any dropouts for the prompt during the training. Is there any other mechanism to ensure CFG is actually working that is not clearly documented or there is something else?

Contributor guide

Open the contributing guide

Research direction

Start with src/diffusers/pipelines/flux2/pipeline_flux2_klein.py around line 592, then compare the CFG handling in examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py and the corresponding FluxKlein training script. Trace how prompt dropout and classifier-free guidance are handled for distilled and non-distilled models; done means the expected behavior and any required training-script or documentation change are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.