Skip to content

Conversation

@msdsm
Copy link

@msdsm msdsm commented Dec 15, 2025

Motivation

When users load pipelines like QwenImageEditPipeline with the torch_dtype parameter, they see a deprecation warning from the Transformers library. However, changing to dtype (as the warning suggests) causes errors because diffusers' from_pretrained doesn't accept dtype as a parameter.

This creates a confusing user experience where:

  1. Users see a deprecation warning
  2. Following the warning's advice breaks their code
  3. There's no way to avoid the warning without modifying the diffusers library

Solution

This PR internally converts torch_dtype to dtype when loading Transformers models (transformers >= 4.20.0), while keeping torch_dtype for diffusers models and other components.

Fixes #12840

Who can review?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the warning torch_dtype is deprecated

1 participant