Skip to content

fix(qwen_image21): cut each CFG branch's image tail before combining them - #420

Merged
Rockdu merged 1 commit into
mainfrom
fix/qwen-image21-cfg-branch-tails
Nov 25, 2026
Merged

Rockdu merged 1 commit into
mainfrom
fix/qwen-image21-cfg-branch-tails

Conversation

@zhihengy

Copy link
Copy Markdown
Collaborator

QwenImage21TrainPipelineConfig.compute_noise_pred combined the two CFG branches before cutting the image tail off the DiT's joint text+image output. The branches' outputs differ in length whenever the prompt and the negative prompt do, so the combine failed on a shape mismatch. No recipe runs this family with CFG, which is how it went unnoticed.

Split out of #419, which stacks on this branch.

What

  • The config hands the base compute_noise_pred a forward that returns the image tail, so each branch is cut before cfg_combine. Without CFG, and with equal text lengths, the result is the same as before.

Tests

  • test_qwen_image21.py: CFG over branches with text lengths 3 and 5 combines their image tails; on main it fails on the shape mismatch.

Validation

Checklist

  • black, isort and ruff at the pinned versions pass on the changed files
  • Added/updated tests for new behaviour
  • No flag, doc or example change

…them

The joint outputs of the two branches differ in length whenever the negative prompt and the prompt do, so the combine failed on a shape mismatch.
@zhihengy
zhihengy marked this pull request as ready for review November 24, 2026 03:08
@zhihengy zhihengy added the run-ci-e2e Run e2e metric-regression tests on this PR label Nov 24, 2026

@Rockdu Rockdu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Rockdu
Rockdu merged commit b478a8b into main Nov 25, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci-e2e Run e2e metric-regression tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants