[fix] Diffusers dtype in code snippets#2280
Conversation
|
there's no way to alias dtype to torch_dtype for backward compatibility? |
|
yeah i think we can also do that and it'd be aligned with transformers as well :) wdyt @sayakpaul? |
|
It is currently not planned. |
|
let's add the alias before merging this then. Should be simple |
|
hello, are there any chance to have this one merged by the 15th for a partner launch? |
|
@julien-c, alias has been added in huggingface/diffusers#14162 so this should be ready to merge |
|
so we merge this and in a couple of weeks (when people upgrade their diffusers version) we revert it, is this correct? |
|
yeah i believe so, diffusers is planning on deprecating |
julien-c
left a comment
There was a problem hiding this comment.
let's remember to revert in a couple of weeks
Use
torch_dtypeinstead ofdtype(not supported byfrom_pretrained) for the Diffusers Hub snippets (see Slack thread for more context)cc @sayakpaul @pagezyhf
Note
Low Risk
Documentation-only string changes in snippet templates; no runtime or API behavior in the app.
Overview
Updates generated Diffusers Hub code snippets so
from_pretrainedcalls passtorch_dtypeinstead ofdtype, which Diffusers does not accept on that API.The change is applied consistently across text-to-image, img2img, video, LoRA, textual inversion, Flux fill, and inpainting snippet templates in
model-libraries-snippets.ts, so copy-paste examples load pipelines with the intended half/bfloat precision.Reviewed by Cursor Bugbot for commit f715770. Bugbot is set up for automated code reviews on this repo. Configure here.