Skip to content

Migrate qwenimage pipeline docstrings from torch_dtype to dtype - #14311

Open
iMountTai wants to merge 2 commits into
huggingface:mainfrom
iMountTai:migrate/qwenimage-dtype
Open

Migrate qwenimage pipeline docstrings from torch_dtype to dtype#14311
iMountTai wants to merge 2 commits into
huggingface:mainfrom
iMountTai:migrate/qwenimage-dtype

Conversation

@iMountTai

Copy link
Copy Markdown

What does this PR do?

Follow-up to #14205, which deprecated torch_dtype in favor of dtype (following transformers). This PR updates all qwenimage pipeline docstring examples to use dtype= instead of the deprecated torch_dtype=, so the documentation no longer demonstrates the deprecated usage.

Pure docstring change — no behavior change. Verified that both pipeline from_pretrained and model from_pretrained accept dtype=.

Before submitting

  • Did you use an AI agent (Claude Code, Codex, Cursor, etc.) to help with this PR? If so:
    • Did you read the Coding with AI agents guide?
    • Did you run the self-review skill on the diff?
    • Did you share the final self-review notes in the PR description or a comment?
  • Did you read the contributor guideline?
  • Did you make sure to update the documentation with your changes?

Who can review?

@yiyixuxu @dg845

@github-actions github-actions Bot added pipelines size/S PR with diff < 50 LOC labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @iMountTai, 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.

@ErenAta16 ErenAta16 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.

qwenimage/ comes out clean — grep -rn "torch_dtype" src/diffusers/pipelines/qwenimage/ returns nothing with this applied. The rest of the tree hasn't moved, though:

location remaining torch_dtype=torch.
src/diffusers/pipelines/ (other families) 358 occurrences across 240 files
docs/ 1075

A few of the neighbours, so it's clear this isn't a long tail of oddities:

src/diffusers/pipelines/flux2/pipeline_flux2.py:50
src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py:52
src/diffusers/pipelines/helios/pipeline_helios.py:57,58

Both spellings still work — DiffusionPipeline.from_pretrained pops each and resolves them at pipeline_utils.py:785-787:

torch_dtype = kwargs.pop("torch_dtype", None)
dtype = kwargs.pop("dtype", None)
torch_dtype = dtype if dtype is not None else torch_dtype

so nothing breaks either way, and torch_dtype doesn't emit a deprecation warning from diffusers itself. The only place the tree treats it as legacy is pipeline_loading_utils.py:856, and that's about transformers ≥ 4.56 warning on its own side.

So this reads as the first slice of a rename that the docstrings will otherwise stay split on — half the examples using one spelling and half the other is worse for a reader than either spelling consistently. Worth saying in the PR whether more families are coming, or whether a single mechanical pass over src/diffusers/pipelines/ and docs/ is the intent.

Counted on diffusers @ 9f6fc2c with the PR applied.

iMountTai and others added 2 commits July 30, 2026 11:56
PR huggingface#14205 deprecated torch_dtype in favor of dtype. Update all
qwenimage pipeline docstring examples to use dtype= instead of
torch_dtype=, following the new convention.

Co-Authored-By: Claude <noreply@anthropic.com>
Mechanical replacement of torch_dtype= with dtype= across
src/diffusers/pipelines/ docstring examples, following the
deprecation in PR huggingface#14205.

Co-Authored-By: Claude <noreply@anthropic.com>
@iMountTai
iMountTai force-pushed the migrate/qwenimage-dtype branch from 2d48f92 to b62745b Compare July 30, 2026 13:55
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/L PR with diff > 200 LOC and removed size/S PR with diff < 50 LOC labels Jul 30, 2026
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 size/L PR with diff > 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants