docs(flux2): clarify image= is reference conditioning, not img2img#13557
Open
NazarKozak wants to merge 1 commit intohuggingface:mainfrom
Open
docs(flux2): clarify image= is reference conditioning, not img2img#13557NazarKozak wants to merge 1 commit intohuggingface:mainfrom
NazarKozak wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
What does this PR do?
The
image=parameter onFlux2PipelineandFlux2KleinPipelineis currently described as a "starting point", which mirrors the SD/Flux.1 img2img wording:Flux.2 actually encodes reference images as additional attention conditioning tokens — there's no noisy-latent init, and so no
strengthparameter. The existing wording is easy to misread when porting code fromStableDiffusionImg2ImgPipeline,FluxImg2ImgPipeline, orFluxKontextInpaintPipeline, all of which legitimately acceptstrength.We had a production serving stack pass
strength=alongsideimage=based on the existing wording and crashed with:Changes
image=docstring onFlux2Pipeline.__call__andFlux2KleinPipeline.__call__to make it explicit that this is reference conditioning, not img2img, and that there is nostrengthknob.## Reference conditioning vs. img2imgcallout todocs/source/en/api/pipelines/flux2.mddistinguishing the two modes, mentioningFlux2KleinInpaintPipelineas the right pipeline if you actually do need astrength-style noisy-latent init.Flux2KleinKVPipeline's docstring already correctly describes reference conditioning, so no change there.Flux2KleinInpaintPipelinedoes takestrengthand is left as-is.Out of scope (happy to add as a follow-up)
A small defensive check inside
__call__that intercepts unknown img2img kwargs and raises a clearTypeErrorpointing at this section of the docs, e.g.:Left out of this PR to keep it docs-only; happy to push as a second commit if maintainers prefer.
Behavioral change
None — docs only.
Fixes # (no related issue — surfaced in production)
Before submitting
Who can review?
Docs: @stevhliu @sayakpaul