Flux2 pipelines: expose the hardcoded 1MP condition-image downscale threshold (max_area)#14127
Open
sqhuang wants to merge 1 commit into
Open
Flux2 pipelines: expose the hardcoded 1MP condition-image downscale threshold (max_area)#14127sqhuang wants to merge 1 commit into
sqhuang wants to merge 1 commit into
Conversation
Contributor
|
Hi @sqhuang, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. |
The condition/reference image downscale threshold was hardcoded to 1024*1024 in Flux2Pipeline, Flux2KleinPipeline and Flux2KleinKVPipeline, silently downscaling any reference image above ~1MP. Expose it as a max_area __call__ argument (default unchanged), mirroring the existing max_area parameter of FluxKontextPipeline.
de10be4 to
1989b08
Compare
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?
Exposes the condition/reference image area threshold in the FLUX.2 pipelines as a public max_area argument, instead of hardcoding 1024 * 1024.
Currently Flux2Pipeline, Flux2KleinPipeline and Flux2KleinKVPipeline silently downscale any condition/reference image larger than ~1MP before conditioning (e.g. if image_width * image_height > 1024 * 1024 in pipeline_flux2_klein.py). There is no public way to keep higher-resolution conditioning — the only workaround today is patching the private image_processor._resize_to_target_area.
Fixes the inability to override the reference-image resolution cap without touching private image-processor internals. Useful for users who want to condition on higher-resolution references.
Simple change, i think no-issue-needed :).
Changes
Before submitting
Who can review?
@yiyixuxu @sayakpaul @DN6 @dg845 @asomoza — Small, backward-compatible API addition to the FLUX.2 pipelines exposing the existing max_area behavior as a public argument.