Skip to content

fix(flux): decouple modular flux from classic and qwenimage imports#13958

Open
akshan-main wants to merge 1 commit into
huggingface:mainfrom
akshan-main:fix-flux-modular-coupling
Open

fix(flux): decouple modular flux from classic and qwenimage imports#13958
akshan-main wants to merge 1 commit into
huggingface:mainfrom
akshan-main:fix-flux-modular-coupling

Conversation

@akshan-main

Copy link
Copy Markdown
Contributor

What does this PR do?

Addresses Issue 6 of the flux review (#13584). The modular Flux blocks imported FluxPipeline._pack_latents and _prepare_latent_image_ids, the classic Kontext PREFERRED_KONTEXT_RESOLUTIONS constant, and two QwenImage modular helpers. This replaces those cross-imports with flux-modular-local copies, following decoders.py.

The coupling check from the issue returns nothing and the modular flux tests pass.

Before submitting

Who can review?

@DN6 @sayakpaul @yiyixuxu

@github-actions github-actions Bot added modular-pipelines size/M PR with diff < 200 LOC labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @akshan-main, 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. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't get it. What's the problem with the existing imports? These assumed that the modular pipelines were implemented w.r.t their standard counterparts. @yiyixuxu am I missing something?

@akshan-main

akshan-main commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Sorry I don't get it. What's the problem with the existing imports? These assumed that the modular pipelines were implemented w.r.t their standard counterparts. @yiyixuxu am I missing something?

Hey!
This came from issue 6 of the flux review (#13584), which explicitly flagged these and pointed to decoders.py keeping its helper local. #13708 independently did the same decoupling into a flux-local pipeline_helpers.py and even added a test asserting modular flux doesn't import from ...pipelines or ..qwenimage, so it wasn't just my reading.

You're right the standard-counterpart imports are the normal pattern (qwenimage, flux2, all do it), so the FluxPipeline and Kontext ones are fine. The one I'd still flag is flux/inputs.py importing from ..qwenimage, the only cross-family import in modular_pipelines. I can narrow this to just that, or close it if you and @yiyixuxu prefer it all as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modular-pipelines size/M PR with diff < 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants