Flux2 pipelines: expose the hardcoded 1MP condition-image downscale threshold (max_area)#14127
Flux2 pipelines: expose the hardcoded 1MP condition-image downscale threshold (max_area)#14127sqhuang wants to merge 1 commit into
Conversation
|
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. |
de10be4 to
1989b08
Compare
|
I need that, thanks |
Thanks Robot! :) for the reminder! This PR does not correspond to an existing issue, so there isn't an issue to link with a closing keyword. Would a maintainer mind adding the |
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. Add fast tests for the new argument on the three pipelines (mirroring the FluxKontext max_area test style) and a nightly integration test consuming a 2048x2048 condition image at full resolution.
8dd27a3 to
14174a4
Compare
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.