Configure fixed sampling sigmas on QwenImage21Pipeline by naykun · Pull Request #4 · naykun/diffusers · GitHub
Skip to content

Configure fixed sampling sigmas on QwenImage21Pipeline - #4

Open
naykun wants to merge 2 commits into
mainfrom
qwen-image-2.1-pipeline-sigmas
Open

naykun wants to merge 2 commits into
mainfrom
qwen-image-2.1-pipeline-sigmas

Conversation

@naykun

@naykun naykun commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

Accelerated QwenImage21 checkpoints need a fixed sampling sigma schedule that loads with the model. This PR adds sample_sigmas to the QwenImage21 pipeline config (model_index.json) and passes the selected schedule to the scheduler through its existing sigmas argument.

Model authors configure the default sample_sigmas; users can experiment with an explicit call-time sigmas override. The selected grid determines the step count. When neither grid is supplied, the existing num_inference_steps behavior is preserved. The scheduler implementation is unchanged, and explicit grids still undergo its configured processing.

This incorporates the pipeline-config approach reviewed in #4 and replaces the scheduler changes proposed in #3. Documentation focuses on loading a preconfigured checkpoint and overriding sigmas at runtime.

Validation

  • Rebased onto upstream main at c2798cc7859f258c6cfc5b2460e82b6cac71f235; both commit patches are unchanged by the rebase.
  • Four CPU regression cases passed after rebase, covering configured-grid step counts, explicit overrides, and pipeline save/load including a load-time override.
  • Ruff lint/format, copy consistency, and whitespace checks passed.
  • Earlier real-checkpoint validation: 2048 × 2048, 8 steps, bf16, one fixed text prompt and seed. With scheduler transformations disabled for the fixed grid, the pipeline-config and previous scheduler-config implementations produced exactly equal sigmas, timesteps, every denoising latent, and final RGBA pixels (maximum difference 0). Both paths shared model components to isolate the scheduling change; executable changes in this PR are unchanged since that validation.

Real-model parity was checked for that fixed grid and input. Quality with other grids or four-step sampling has not been evaluated; num_inference_steps=4 alone still uses a configured eight-point grid.

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

thanks! I left one comment on the doc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

code change looks good to me! but this section feel like written for ourselves, most of our users will use a released checkpoint with scheduler and sample_sigma already configured. so I think
(1) IMO we don't have to talk about how to config the pipeline and scheduler for the trained checkpoint, but it is ok to keep if you prefer
(2) for sample_sigma and sigma let's keep them simple: sample_simga is for the pipeline authors to config a default sigmas and user who wants to experiment different sigmas at run time should always use the sigmas

@naykun

naykun commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Thanks, @yiyixuxu! I simplified the docs to focus on users loading a preconfigured checkpoint and using sigmas to experiment at runtime. I removed the longer scheduler setup and save/load example, and clarified that sample_sigmas is the default configured by the model author, while sigmas overrides it for an individual call. No code behavior has changed.

@naykun
naykun force-pushed the qwen-image-2.1-pipeline-sigmas branch from ed0e197 to 8038ea9 Compare October 5, 2026 15:18

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just two comments!

)
```

## Sampling sigmas

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should we also not talk about which checkpoint might need this kind of configuration to work with? Otherwise, it feels confusing.

Comment on lines +95 to +98

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we should also clarify which checkpoint id should this be used with?

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

Labels

documentation Improvements or additions to documentation pipelines tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants