Skip to content

refactor flux2 klein pipeline tests to the new mixin structure - #14336

Merged
sayakpaul merged 4 commits into
huggingface:mainfrom
akshan-main:refactor-flux2-klein-pipeline-tests
Aug 3, 2026
Merged

refactor flux2 klein pipeline tests to the new mixin structure#14336
sayakpaul merged 4 commits into
huggingface:mainfrom
akshan-main:refactor-flux2-klein-pipeline-tests

Conversation

@akshan-main

@akshan-main akshan-main commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Refactors the Flux2 Klein pipeline tests to the new mixin structure from #14113: a Flux2KleinPipelineTesterConfig plus TestFlux2KleinPipeline(PipelineTesterMixin) and TestFlux2KleinPipelineMemory(MemoryTesterMixin), with the neuron integration tests moved to a pytest class. Follows #14326.

Existing coverage is kept: test_fused_qkv_projections, test_image_output_shape, and test_image_input with its expected slice, with dummy inputs switched to output_type="pt" and the assertions adjusted for the channels-first layout. The test_encode_prompt_works_in_isolation skip is kept since the pipeline cannot run with text_encoder=None. No caching tests are added since the old suite had none.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Did you read our philosophy doc (important for complex PRs)?
  • Was this discussed/approved via a GitHub issue or the forum? Discussed on Slack with @sayakpaul
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@sayakpaul

@github-actions github-actions Bot added size/M PR with diff < 200 LOC tests labels Jul 30, 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.

Thanks just one question.

inputs = self.get_dummy_inputs()
image = pipe(**inputs).images
original_image_slice = image[0, -3:, -3:, -1]
original_image_slice = image[0, -1, -3:, -3:]

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.

Why is this changing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Re-indexing. Dummy inputs were switched to output_type="pt", so the output layout went from (b, h, w, c) to (b, c, h, w).

@sayakpaul
sayakpaul merged commit b16e3ce into huggingface:main Aug 3, 2026
13 checks passed
DN6 pushed a commit that referenced this pull request Aug 6, 2026
* refactor flux2 klein pipeline tests to the new mixin structure

* use assert_tensors_close instead of torch.allclose

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants