diff --git a/docs/source/en/quantization/torchao.md b/docs/source/en/quantization/torchao.md index d642d839c0a6..f2b8cf3e243f 100644 --- a/docs/source/en/quantization/torchao.md +++ b/docs/source/en/quantization/torchao.md @@ -45,7 +45,7 @@ pipeline = DiffusionPipeline.from_pretrained( pipeline = DiffusionPipeline.from_pretrained( "black-forest-labs/FLUX.1-dev", quantization_config=pipeline_quant_config, - torch_dtype=torch.bfloat16, + dtype=torch.bfloat16, ) pipeline.to("cuda") ``` diff --git a/src/diffusers/pipelines/README.md b/src/diffusers/pipelines/README.md index 6f9ab7b291ad..4f9c543083cb 100644 --- a/src/diffusers/pipelines/README.md +++ b/src/diffusers/pipelines/README.md @@ -113,7 +113,7 @@ from diffusers import StableDiffusionImg2ImgPipeline device = "cuda" pipe = StableDiffusionImg2ImgPipeline.from_pretrained( "stable-diffusion-v1-5/stable-diffusion-v1-5", - torch_dtype=torch.float16, + dtype=torch.float16, ).to(device) # let's download an initial image @@ -160,7 +160,7 @@ mask_image = download_image(mask_url).resize((512, 512)) pipe = StableDiffusionInpaintPipeline.from_pretrained( "stable-diffusion-v1-5/stable-diffusion-inpainting", - torch_dtype=torch.float16, + dtype=torch.float16, ) pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/ace_step/pipeline_ace_step.py b/src/diffusers/pipelines/ace_step/pipeline_ace_step.py index b11e08208eb1..74903613fdbb 100644 --- a/src/diffusers/pipelines/ace_step/pipeline_ace_step.py +++ b/src/diffusers/pipelines/ace_step/pipeline_ace_step.py @@ -86,7 +86,7 @@ def _normalize_audio_codes(audio_codes: Union[str, List[str]], batch_size: int) >>> from diffusers import AceStepPipeline >>> pipe = AceStepPipeline.from_pretrained( - ... "ACE-Step/acestep-v15-xl-turbo-diffusers", torch_dtype=torch.bfloat16 + ... "ACE-Step/acestep-v15-xl-turbo-diffusers", dtype=torch.bfloat16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/allegro/pipeline_allegro.py b/src/diffusers/pipelines/allegro/pipeline_allegro.py index 9d2d2aa8bd09..07298b3036b3 100644 --- a/src/diffusers/pipelines/allegro/pipeline_allegro.py +++ b/src/diffusers/pipelines/allegro/pipeline_allegro.py @@ -66,8 +66,8 @@ >>> from diffusers import AutoencoderKLAllegro, AllegroPipeline >>> from diffusers.utils import export_to_video - >>> vae = AutoencoderKLAllegro.from_pretrained("rhymes-ai/Allegro", subfolder="vae", torch_dtype=torch.float32) - >>> pipe = AllegroPipeline.from_pretrained("rhymes-ai/Allegro", vae=vae, torch_dtype=torch.bfloat16).to("cuda") + >>> vae = AutoencoderKLAllegro.from_pretrained("rhymes-ai/Allegro", subfolder="vae", dtype=torch.float32) + >>> pipe = AllegroPipeline.from_pretrained("rhymes-ai/Allegro", vae=vae, dtype=torch.bfloat16).to("cuda") >>> pipe.vae.enable_tiling() >>> prompt = ( diff --git a/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py b/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py index a9630cc3c00f..da326c2f9336 100644 --- a/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py +++ b/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py @@ -70,12 +70,12 @@ >>> # Download controlnets from https://huggingface.co/lllyasviel/ControlNet-v1-1 to use .from_single_file >>> # Download Diffusers-format controlnets, such as https://huggingface.co/lllyasviel/sd-controlnet-depth, to use .from_pretrained() - >>> controlnet = ControlNetModel.from_single_file("control_v11f1p_sd15_depth.pth", torch_dtype=torch.float16) + >>> controlnet = ControlNetModel.from_single_file("control_v11f1p_sd15_depth.pth", dtype=torch.float16) >>> # We use AnimateLCM for this example but one can use the original motion adapters as well (for example, https://huggingface.co/guoyww/animatediff-motion-adapter-v1-5-3) >>> motion_adapter = MotionAdapter.from_pretrained("wangfuyun/AnimateLCM") - >>> vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", dtype=torch.float16) >>> pipe: AnimateDiffControlNetPipeline = AnimateDiffControlNetPipeline.from_pretrained( ... "SG161222/Realistic_Vision_V5.1_noVAE", ... motion_adapter=motion_adapter, diff --git a/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py b/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py index a221f3e1efeb..eaa4108368c5 100644 --- a/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py +++ b/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py @@ -80,7 +80,7 @@ >>> from diffusers.utils import export_to_gif >>> adapter = MotionAdapter.from_pretrained( - ... "a-r-r-o-w/animatediff-motion-adapter-sdxl-beta", torch_dtype=torch.float16 + ... "a-r-r-o-w/animatediff-motion-adapter-sdxl-beta", dtype=torch.float16 ... ) >>> model_id = "stabilityai/stable-diffusion-xl-base-1.0" @@ -96,7 +96,7 @@ ... model_id, ... motion_adapter=adapter, ... scheduler=scheduler, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... variant="fp16", ... ).to("cuda") diff --git a/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py b/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py index fcf260b47f3a..80de804547e3 100644 --- a/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py +++ b/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py @@ -69,9 +69,9 @@ >>> vae_id = "stabilityai/sd-vae-ft-mse" >>> device = "cuda" - >>> motion_adapter = MotionAdapter.from_pretrained(motion_adapter_id, torch_dtype=torch.float16).to(device) - >>> controlnet = SparseControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float16).to(device) - >>> vae = AutoencoderKL.from_pretrained(vae_id, torch_dtype=torch.float16).to(device) + >>> motion_adapter = MotionAdapter.from_pretrained(motion_adapter_id, dtype=torch.float16).to(device) + >>> controlnet = SparseControlNetModel.from_pretrained(controlnet_id, dtype=torch.float16).to(device) + >>> vae = AutoencoderKL.from_pretrained(vae_id, dtype=torch.float16).to(device) >>> scheduler = DPMSolverMultistepScheduler.from_pretrained( ... model_id, ... subfolder="scheduler", @@ -85,7 +85,7 @@ ... controlnet=controlnet, ... vae=vae, ... scheduler=scheduler, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ).to(device) >>> pipe.load_lora_weights(lora_adapter_id, adapter_name="motion_lora") >>> pipe.fuse_lora(lora_scale=1.0) diff --git a/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py b/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py index b8aa82ab9d2f..8638fd11d7ac 100644 --- a/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py +++ b/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py @@ -62,7 +62,7 @@ >>> from PIL import Image >>> adapter = MotionAdapter.from_pretrained( - ... "guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16 + ... "guoyww/animatediff-motion-adapter-v1-5-2", dtype=torch.float16 ... ) >>> pipe = AnimateDiffVideoToVideoPipeline.from_pretrained( ... "SG161222/Realistic_Vision_V5.1_noVAE", motion_adapter=adapter diff --git a/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py b/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py index 7c649b501f32..873d9ce515ca 100644 --- a/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py +++ b/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py @@ -70,10 +70,10 @@ >>> from diffusers import AutoencoderKL, ControlNetModel, MotionAdapter, LCMScheduler >>> controlnet = ControlNetModel.from_pretrained( - ... "lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16 + ... "lllyasviel/sd-controlnet-openpose", dtype=torch.float16 ... ) >>> motion_adapter = MotionAdapter.from_pretrained("wangfuyun/AnimateLCM") - >>> vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", dtype=torch.float16) >>> pipe = AnimateDiffVideoToVideoControlNetPipeline.from_pretrained( ... "SG161222/Realistic_Vision_V5.1_noVAE", diff --git a/src/diffusers/pipelines/anyflow/pipeline_anyflow.py b/src/diffusers/pipelines/anyflow/pipeline_anyflow.py index c3e1dbf3a459..31bf820521b1 100644 --- a/src/diffusers/pipelines/anyflow/pipeline_anyflow.py +++ b/src/diffusers/pipelines/anyflow/pipeline_anyflow.py @@ -46,7 +46,7 @@ >>> from diffusers.utils import export_to_video >>> pipe = AnyFlowPipeline.from_pretrained( - ... "nvidia/AnyFlow-Wan2.1-T2V-14B-Diffusers", torch_dtype=torch.bfloat16 + ... "nvidia/AnyFlow-Wan2.1-T2V-14B-Diffusers", dtype=torch.bfloat16 ... ).to("cuda") >>> prompt = "A red panda eating bamboo in a forest, cinematic lighting" diff --git a/src/diffusers/pipelines/anyflow/pipeline_anyflow_far.py b/src/diffusers/pipelines/anyflow/pipeline_anyflow_far.py index 96edc07a0043..5e032d0034d0 100644 --- a/src/diffusers/pipelines/anyflow/pipeline_anyflow_far.py +++ b/src/diffusers/pipelines/anyflow/pipeline_anyflow_far.py @@ -49,7 +49,7 @@ >>> from diffusers.utils import export_to_video, load_image >>> pipe = AnyFlowFARPipeline.from_pretrained( - ... "nvidia/AnyFlow-FAR-Wan2.1-1.3B-Diffusers", torch_dtype=torch.bfloat16 + ... "nvidia/AnyFlow-FAR-Wan2.1-1.3B-Diffusers", dtype=torch.bfloat16 ... ).to("cuda") >>> # Single-frame I2V: wrap the conditioning image as a (1, 1, 3, H, W) tensor in [0, 1]. diff --git a/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py b/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py index 110ddd1bfef3..d5c5790fbc42 100644 --- a/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py +++ b/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py @@ -71,7 +71,7 @@ >>> from diffusers import AudioLDM2Pipeline >>> repo_id = "cvssp/audioldm2" - >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> # define the prompts @@ -101,7 +101,7 @@ >>> from diffusers import AudioLDM2Pipeline >>> repo_id = "anhnct/audioldm2_gigaspeech" - >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> # define the prompts @@ -398,7 +398,7 @@ def encode_prompt( >>> from diffusers import AudioLDM2Pipeline >>> repo_id = "cvssp/audioldm2" - >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = AudioLDM2Pipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> # Get text embedding vectors diff --git a/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py b/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py index 30a12c2ba41f..0de3714f97a2 100644 --- a/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py +++ b/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py @@ -51,7 +51,7 @@ >>> import torch >>> from diffusers import AuraFlowPipeline - >>> pipe = AuraFlowPipeline.from_pretrained("fal/AuraFlow", torch_dtype=torch.float16) + >>> pipe = AuraFlowPipeline.from_pretrained("fal/AuraFlow", dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" >>> image = pipe(prompt).images[0] diff --git a/src/diffusers/pipelines/auto_pipeline.py b/src/diffusers/pipelines/auto_pipeline.py index 8a3a6a5dd799..09681d703f48 100644 --- a/src/diffusers/pipelines/auto_pipeline.py +++ b/src/diffusers/pipelines/auto_pipeline.py @@ -1384,7 +1384,7 @@ def from_pretrained(cls, pretrained_model_or_path, **kwargs): >>> from diffusers import AutoPipelineForText2Audio >>> pipeline = AutoPipelineForText2Audio.from_pretrained( - ... "stabilityai/stable-audio-open-1.0", torch_dtype=torch.float16 + ... "stabilityai/stable-audio-open-1.0", dtype=torch.float16 ... ) >>> pipeline = pipeline.to("cuda") @@ -1443,7 +1443,7 @@ def from_pipe(cls, pipeline, **kwargs): >>> import soundfile as sf >>> from diffusers import AutoPipelineForText2Audio, StableAudioPipeline - >>> pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0", torch_dtype=torch.float16) + >>> pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0", dtype=torch.float16) >>> pipe_audio = AutoPipelineForText2Audio.from_pipe(pipe) >>> output = pipe_audio( diff --git a/src/diffusers/pipelines/bria/pipeline_bria.py b/src/diffusers/pipelines/bria/pipeline_bria.py index 9b80278af21e..92845da224a8 100644 --- a/src/diffusers/pipelines/bria/pipeline_bria.py +++ b/src/diffusers/pipelines/bria/pipeline_bria.py @@ -49,7 +49,7 @@ >>> import torch >>> from diffusers import BriaPipeline - >>> pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.2", torch_dtype=torch.bfloat16) + >>> pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.2", dtype=torch.bfloat16) >>> pipe.to("cuda") # BRIA's T5 text encoder is sensitive to precision. We need to cast it to bfloat16 and keep the final layer in float32. diff --git a/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo.py b/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo.py index 2aef63215f08..4d0307c30056 100644 --- a/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo.py +++ b/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo.py @@ -57,7 +57,7 @@ pipe = BriaFiboPipeline.from_pretrained( "briaai/FIBO", trust_remote_code=True, - torch_dtype=torch.bfloat16, + dtype=torch.bfloat16, ) pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py b/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py index 664ee7d090d2..2b90529eaf67 100644 --- a/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py +++ b/src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py @@ -64,7 +64,7 @@ pipe = BriaFiboEditPipeline.from_pretrained( "briaai/fibo-edit", - torch_dtype=torch.bfloat16, + dtype=torch.bfloat16, ) pipe.to("cuda") diff --git a/src/diffusers/pipelines/chroma/pipeline_chroma.py b/src/diffusers/pipelines/chroma/pipeline_chroma.py index 3d91f43b07cf..b164f974c58a 100644 --- a/src/diffusers/pipelines/chroma/pipeline_chroma.py +++ b/src/diffusers/pipelines/chroma/pipeline_chroma.py @@ -54,11 +54,11 @@ >>> model_id = "lodestones/Chroma1-HD" >>> ckpt_path = "https://huggingface.co/lodestones/Chroma1-HD/blob/main/Chroma1-HD.safetensors" - >>> transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16) + >>> transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, dtype=torch.bfloat16) >>> pipe = ChromaPipeline.from_pretrained( ... model_id, ... transformer=transformer, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> pipe.enable_model_cpu_offload() >>> prompt = [ diff --git a/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py b/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py index 4a2d4cca049e..3859af1bec5c 100644 --- a/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py +++ b/src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py @@ -57,7 +57,7 @@ >>> pipe = ChromaImg2ImgPipeline.from_pretrained( ... model_id, ... transformer=transformer, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> pipe.enable_model_cpu_offload() >>> init_image = load_image( diff --git a/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py b/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py index b8d41a948207..4d8fd78f8af4 100644 --- a/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py +++ b/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py @@ -65,7 +65,7 @@ >>> from diffusers import ChromaInpaintPipeline >>> from diffusers.utils import load_image - >>> pipe = ChromaInpaintPipeline.from_pretrained("lodestones/Chroma1-HD", torch_dtype=torch.bfloat16) + >>> pipe = ChromaInpaintPipeline.from_pretrained("lodestones/Chroma1-HD", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" >>> img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" diff --git a/src/diffusers/pipelines/chronoedit/pipeline_chronoedit.py b/src/diffusers/pipelines/chronoedit/pipeline_chronoedit.py index 1e0cc0ea5c2a..c80c02ebbd4a 100644 --- a/src/diffusers/pipelines/chronoedit/pipeline_chronoedit.py +++ b/src/diffusers/pipelines/chronoedit/pipeline_chronoedit.py @@ -56,14 +56,14 @@ >>> # Available models: nvidia/ChronoEdit-14B-Diffusers >>> model_id = "nvidia/ChronoEdit-14B-Diffusers" >>> image_encoder = CLIPVisionModel.from_pretrained( - ... model_id, subfolder="image_encoder", torch_dtype=torch.float32 + ... model_id, subfolder="image_encoder", dtype=torch.float32 ... ) - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) >>> transformer = ChronoEditTransformer3DModel.from_pretrained( - ... model_id, subfolder="transformer", torch_dtype=torch.bfloat16 + ... model_id, subfolder="transformer", dtype=torch.bfloat16 ... ) >>> pipe = ChronoEditPipeline.from_pretrained( - ... model_id, vae=vae, image_encoder=image_encoder, transformer=transformer, torch_dtype=torch.bfloat16 + ... model_id, vae=vae, image_encoder=image_encoder, transformer=transformer, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox.py b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox.py index 9043abcab65e..d8c744a528ad 100644 --- a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox.py +++ b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox.py @@ -50,7 +50,7 @@ >>> from diffusers.utils import export_to_video >>> # Models: "THUDM/CogVideoX-2b" or "THUDM/CogVideoX-5b" - >>> pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-2b", torch_dtype=torch.float16).to("cuda") + >>> pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-2b", dtype=torch.float16).to("cuda") >>> prompt = ( ... "A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. " ... "The panda's fluffy paws strum a miniature acoustic guitar, producing soft, melodic tunes. Nearby, a few other " diff --git a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_fun_control.py b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_fun_control.py index e2b45a08ee90..c784f2fc6705 100644 --- a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_fun_control.py +++ b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_fun_control.py @@ -51,7 +51,7 @@ >>> from diffusers.utils import export_to_video, load_video >>> pipe = CogVideoXFunControlPipeline.from_pretrained( - ... "alibaba-pai/CogVideoX-Fun-V1.1-5b-Pose", torch_dtype=torch.bfloat16 + ... "alibaba-pai/CogVideoX-Fun-V1.1-5b-Pose", dtype=torch.bfloat16 ... ) >>> pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_image2video.py b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_image2video.py index 42f5109bb877..b0feb3837984 100644 --- a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_image2video.py +++ b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_image2video.py @@ -51,7 +51,7 @@ >>> from diffusers import CogVideoXImageToVideoPipeline >>> from diffusers.utils import export_to_video, load_image - >>> pipe = CogVideoXImageToVideoPipeline.from_pretrained("THUDM/CogVideoX-5b-I2V", torch_dtype=torch.bfloat16) + >>> pipe = CogVideoXImageToVideoPipeline.from_pretrained("THUDM/CogVideoX-5b-I2V", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "An astronaut hatching from an egg, on the surface of the moon, the darkness and depth of space realised in the background. High quality, ultrarealistic detail and breath-taking movie-like camera shot." diff --git a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_video2video.py b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_video2video.py index 3cd72b0c2126..a78ed23c1bc0 100644 --- a/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_video2video.py +++ b/src/diffusers/pipelines/cogvideo/pipeline_cogvideox_video2video.py @@ -51,7 +51,7 @@ >>> from diffusers.utils import export_to_video, load_video >>> # Models: "THUDM/CogVideoX-2b" or "THUDM/CogVideoX-5b" - >>> pipe = CogVideoXVideoToVideoPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16) + >>> pipe = CogVideoXVideoToVideoPipeline.from_pretrained("THUDM/CogVideoX-5b", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config) diff --git a/src/diffusers/pipelines/cogview3/pipeline_cogview3plus.py b/src/diffusers/pipelines/cogview3/pipeline_cogview3plus.py index c433c1b54477..c07327879c1f 100644 --- a/src/diffusers/pipelines/cogview3/pipeline_cogview3plus.py +++ b/src/diffusers/pipelines/cogview3/pipeline_cogview3plus.py @@ -45,7 +45,7 @@ >>> import torch >>> from diffusers import CogView3PlusPipeline - >>> pipe = CogView3PlusPipeline.from_pretrained("THUDM/CogView3-Plus-3B", torch_dtype=torch.bfloat16) + >>> pipe = CogView3PlusPipeline.from_pretrained("THUDM/CogView3-Plus-3B", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A photo of an astronaut riding a horse on mars" diff --git a/src/diffusers/pipelines/cogview4/pipeline_cogview4.py b/src/diffusers/pipelines/cogview4/pipeline_cogview4.py index 329b76d11e0d..f40407485637 100644 --- a/src/diffusers/pipelines/cogview4/pipeline_cogview4.py +++ b/src/diffusers/pipelines/cogview4/pipeline_cogview4.py @@ -46,7 +46,7 @@ >>> import torch >>> from diffusers import CogView4Pipeline - >>> pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16) + >>> pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A photo of an astronaut riding a horse on mars" diff --git a/src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py b/src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py index ba25c0ef92e6..c0e04b2ccf77 100644 --- a/src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py +++ b/src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py @@ -45,7 +45,7 @@ >>> import torch >>> from diffusers import CogView4ControlPipeline - >>> pipe = CogView4ControlPipeline.from_pretrained("THUDM/CogView4-6B-Control", torch_dtype=torch.bfloat16) + >>> pipe = CogView4ControlPipeline.from_pretrained("THUDM/CogView4-6B-Control", dtype=torch.bfloat16) >>> control_image = load_image( ... "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png" ... ) diff --git a/src/diffusers/pipelines/consisid/pipeline_consisid.py b/src/diffusers/pipelines/consisid/pipeline_consisid.py index 801d892b0916..6a4828f331bb 100644 --- a/src/diffusers/pipelines/consisid/pipeline_consisid.py +++ b/src/diffusers/pipelines/consisid/pipeline_consisid.py @@ -59,7 +59,7 @@ ... eva_transform_mean, ... eva_transform_std, ... ) = prepare_face_models("BestWishYsh/ConsisID-preview", device="cuda", dtype=torch.bfloat16) - >>> pipe = ConsisIDPipeline.from_pretrained("BestWishYsh/ConsisID-preview", torch_dtype=torch.bfloat16) + >>> pipe = ConsisIDPipeline.from_pretrained("BestWishYsh/ConsisID-preview", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # ConsisID works well with long and well-described prompts. Make sure the face in the image is clearly visible (e.g., preferably half-body or full-body). diff --git a/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py b/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py index b2b18b52e824..a8bdcdf49979 100644 --- a/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py +++ b/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py @@ -43,7 +43,7 @@ >>> device = "cuda" >>> # Load the cd_imagenet64_l2 checkpoint. >>> model_id_or_path = "openai/diffusers-cd_imagenet64_l2" - >>> pipe = ConsistencyModelPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16) + >>> pipe = ConsistencyModelPipeline.from_pretrained(model_id_or_path, dtype=torch.float16) >>> pipe.to(device) >>> # Onestep Sampling diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet.py index 7ef287ae8154..5e8706c007d3 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet.py @@ -78,9 +78,9 @@ >>> canny_image = Image.fromarray(image) >>> # load control net and stable diffusion v1-5 - >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16) + >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", dtype=torch.float16) >>> pipe = StableDiffusionControlNetPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, dtype=torch.float16 ... ) >>> # speed up diffusion process with faster scheduler and memory optimization diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py index 3b91229814cc..297c27b1a42c 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py @@ -45,7 +45,7 @@ >>> import torch >>> blip_diffusion_pipe = BlipDiffusionControlNetPipeline.from_pretrained( - ... "Salesforce/blipdiffusion-controlnet", torch_dtype=torch.float16 + ... "Salesforce/blipdiffusion-controlnet", dtype=torch.float16 ... ).to("cuda") >>> style_subject = "flower" diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py index b40dda940959..58be1978de7f 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py @@ -77,9 +77,9 @@ >>> canny_image = Image.fromarray(np_image) >>> # load control net and stable diffusion v1-5 - >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16) + >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", dtype=torch.float16) >>> pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, dtype=torch.float16 ... ) >>> # speed up diffusion process with faster scheduler and memory optimization diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py index c981dd14abd6..36e9efb97fe6 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py @@ -88,10 +88,10 @@ >>> control_image = make_canny_condition(init_image) >>> controlnet = ControlNetModel.from_pretrained( - ... "lllyasviel/control_v11p_sd15_inpaint", torch_dtype=torch.float16 + ... "lllyasviel/control_v11p_sd15_inpaint", dtype=torch.float16 ... ) >>> pipe = StableDiffusionControlNetInpaintPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config) diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py index f27fcd8aa26f..e22778a11bea 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py @@ -118,10 +118,10 @@ def retrieve_latents( >>> control_image = make_canny_condition(init_image) >>> controlnet = ControlNetModel.from_pretrained( - ... "diffusers/controlnet-canny-sdxl-1.0", torch_dtype=torch.float16 + ... "diffusers/controlnet-canny-sdxl-1.0", dtype=torch.float16 ... ) >>> pipe = StableDiffusionXLControlNetInpaintPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py index 9a4badb8ce1e..a31a8e1d5c71 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py @@ -94,11 +94,11 @@ >>> # initialize the models and pipeline >>> controlnet_conditioning_scale = 0.5 # recommended for good generalization >>> controlnet = ControlNetModel.from_pretrained( - ... "diffusers/controlnet-canny-sdxl-1.0", torch_dtype=torch.float16 + ... "diffusers/controlnet-canny-sdxl-1.0", dtype=torch.float16 ... ) - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> pipe = StableDiffusionXLControlNetPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, vae=vae, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, vae=vae, dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py index 1de2f5d66da0..e80941492f9f 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py @@ -90,16 +90,16 @@ ... "diffusers/controlnet-depth-sdxl-1.0-small", ... variant="fp16", ... use_safetensors=True, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> pipe = StableDiffusionXLControlNetImg2ImgPipeline.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", ... controlnet=controlnet, ... vae=vae, ... variant="fp16", ... use_safetensors=True, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py index 511611f036b4..9bf9ceda5331 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py @@ -107,14 +107,14 @@ def retrieve_latents( ).resize((1024, 1024)) # initialize the models and pipeline controlnet = ControlNetUnionModel.from_pretrained( - "brad-twinkl/controlnet-union-sdxl-1.0-promax", torch_dtype=torch.float16 + "brad-twinkl/controlnet-union-sdxl-1.0-promax", dtype=torch.float16 ) - vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) pipe = StableDiffusionXLControlNetUnionInpaintPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, vae=vae, - torch_dtype=torch.float16, + dtype=torch.float16, variant="fp16", ) pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py index b8ddeb894aab..dbdfad535f2a 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py @@ -92,14 +92,14 @@ ... ).resize((1024, 1024)) >>> # initialize the models and pipeline >>> controlnet = ControlNetUnionModel.from_pretrained( - ... "xinsir/controlnet-union-sdxl-1.0", torch_dtype=torch.float16 + ... "xinsir/controlnet-union-sdxl-1.0", dtype=torch.float16 ... ) - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> pipe = StableDiffusionXLControlNetUnionPipeline.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", ... controlnet=controlnet, ... vae=vae, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... variant="fp16", ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py index dee22942eb8f..b4be4c1702a8 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py @@ -97,14 +97,14 @@ ) # initialize the models and pipeline controlnet = ControlNetUnionModel.from_pretrained( - "brad-twinkl/controlnet-union-sdxl-1.0-promax", torch_dtype=torch.float16 + "brad-twinkl/controlnet-union-sdxl-1.0-promax", dtype=torch.float16 ) - vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) pipe = StableDiffusionXLControlNetUnionImg2ImgPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, vae=vae, - torch_dtype=torch.float16, + dtype=torch.float16, variant="fp16", ).to("cuda") # `enable_model_cpu_offload` is not recommended due to multiple generations diff --git a/src/diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py b/src/diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py index ba241bf4feb6..400590e543a0 100644 --- a/src/diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py +++ b/src/diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py @@ -49,11 +49,11 @@ import torch controlnet = HunyuanDiT2DControlNetModel.from_pretrained( - "Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Canny", torch_dtype=torch.float16 + "Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Canny", dtype=torch.float16 ) pipe = HunyuanDiTControlNetPipeline.from_pretrained( - "Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers", controlnet=controlnet, torch_dtype=torch.float16 + "Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers", controlnet=controlnet, dtype=torch.float16 ) pipe.to("cuda") diff --git a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py index 4530a424adb4..7fa7b801aa56 100644 --- a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py +++ b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py @@ -62,10 +62,10 @@ >>> from diffusers.models import SD3ControlNetModel, SD3MultiControlNetModel >>> from diffusers.utils import load_image - >>> controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Canny", torch_dtype=torch.float16) + >>> controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Canny", dtype=torch.float16) >>> pipe = StableDiffusion3ControlNetPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-3-medium-diffusers", controlnet=controlnet, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-3-medium-diffusers", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.to("cuda") >>> control_image = load_image( diff --git a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py index d2890d55811c..d2af4b1e544e 100644 --- a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py +++ b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py @@ -70,7 +70,7 @@ >>> pipe = StableDiffusion3ControlNetInpaintingPipeline.from_pretrained( ... "stabilityai/stable-diffusion-3-medium-diffusers", ... controlnet=controlnet, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.text_encoder.to(torch.float16) >>> pipe.controlnet.to(torch.float16) diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_predict.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_predict.py index c2c5e6d2c824..4cc765467dc0 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_predict.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_predict.py @@ -93,7 +93,7 @@ def retrieve_latents( >>> model_id = "nvidia/Cosmos-Predict2.5-2B" >>> pipe = Cosmos2_5_PredictBasePipeline.from_pretrained( - ... model_id, revision="diffusers/base/post-trained", torch_dtype=torch.bfloat16 + ... model_id, revision="diffusers/base/post-trained", dtype=torch.bfloat16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py index e38d926bbd28..eb6fbd5f416a 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py @@ -90,10 +90,10 @@ def retrieve_latents( >>> model_id = "nvidia/Cosmos-Transfer2.5-2B" >>> # Load a Transfer2.5 controlnet variant (edge, depth, seg, or blur) >>> controlnet = AutoModel.from_pretrained( - ... model_id, revision="diffusers/controlnet/general/edge", torch_dtype=torch.bfloat16 + ... model_id, revision="diffusers/controlnet/general/edge", dtype=torch.bfloat16 ... ) >>> pipe = Cosmos2_5_TransferPipeline.from_pretrained( - ... model_id, controlnet=controlnet, revision="diffusers/general", torch_dtype=torch.bfloat16 + ... model_id, controlnet=controlnet, revision="diffusers/general", dtype=torch.bfloat16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_text2image.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_text2image.py index 8c6de18b3a9a..1429420d311b 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_text2image.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_text2image.py @@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs): >>> # Available checkpoints: nvidia/Cosmos-Predict2-2B-Text2Image, nvidia/Cosmos-Predict2-14B-Text2Image >>> model_id = "nvidia/Cosmos-Predict2-2B-Text2Image" - >>> pipe = Cosmos2TextToImagePipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Cosmos2TextToImagePipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A close-up shot captures a vibrant yellow scrubber vigorously working on a grimy plate, its bristles moving in circular motions to lift stubborn grease and food residue. The dish, once covered in remnants of a hearty meal, gradually reveals its original glossy surface. Suds form and bubble around the scrubber, creating a satisfying visual of cleanliness in progress. The sound of scrubbing fills the air, accompanied by the gentle clinking of the dish against the sink. As the scrubber continues its task, the dish transforms, gleaming under the bright kitchen lights, symbolizing the triumph of cleanliness over mess." diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_video2world.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_video2world.py index 2a708e1118e0..88d6ca1dc0c1 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos2_video2world.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos2_video2world.py @@ -68,7 +68,7 @@ def __init__(self, *args, **kwargs): >>> # Available checkpoints: nvidia/Cosmos-Predict2-2B-Video2World, nvidia/Cosmos-Predict2-14B-Video2World >>> model_id = "nvidia/Cosmos-Predict2-2B-Video2World" - >>> pipe = Cosmos2VideoToWorldPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Cosmos2VideoToWorldPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A close-up shot captures a vibrant yellow scrubber vigorously working on a grimy plate, its bristles moving in circular motions to lift stubborn grease and food residue. The dish, once covered in remnants of a hearty meal, gradually reveals its original glossy surface. Suds form and bubble around the scrubber, creating a satisfying visual of cleanliness in progress. The sound of scrubbing fills the air, accompanied by the gentle clinking of the dish against the sink. As the scrubber continues its task, the dish transforms, gleaming under the bright kitchen lights, symbolizing the triumph of cleanliness over mess." diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos_text2world.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos_text2world.py index 61d9ec8f0574..32d56ac87b1a 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos_text2world.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos_text2world.py @@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs): >>> from diffusers.utils import export_to_video >>> model_id = "nvidia/Cosmos-1.0-Diffusion-7B-Text2World" - >>> pipe = CosmosTextToWorldPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = CosmosTextToWorldPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A sleek, humanoid robot stands in a vast warehouse filled with neatly stacked cardboard boxes on industrial shelves. The robot's metallic body gleams under the bright, even lighting, highlighting its futuristic design and intricate joints. A glowing blue light emanates from its chest, adding a touch of advanced technology. The background is dominated by rows of boxes, suggesting a highly organized storage system. The floor is lined with wooden pallets, enhancing the industrial setting. The camera remains static, capturing the robot's poised stance amidst the orderly environment, with a shallow depth of field that keeps the focus on the robot while subtly blurring the background for a cinematic effect." diff --git a/src/diffusers/pipelines/cosmos/pipeline_cosmos_video2world.py b/src/diffusers/pipelines/cosmos/pipeline_cosmos_video2world.py index bf7e28584967..8966119747f9 100644 --- a/src/diffusers/pipelines/cosmos/pipeline_cosmos_video2world.py +++ b/src/diffusers/pipelines/cosmos/pipeline_cosmos_video2world.py @@ -69,7 +69,7 @@ def __init__(self, *args, **kwargs): >>> from diffusers.utils import export_to_video, load_image >>> model_id = "nvidia/Cosmos-1.0-Diffusion-7B-Video2World" - >>> pipe = CosmosVideoToWorldPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = CosmosVideoToWorldPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "The video depicts a long, straight highway stretching into the distance, flanked by metal guardrails. The road is divided into multiple lanes, with a few vehicles visible in the far distance. The surrounding landscape features dry, grassy fields on one side and rolling hills on the other. The sky is mostly clear with a few scattered clouds, suggesting a bright, sunny day." @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs): >>> from diffusers.utils import export_to_video, load_video >>> model_id = "nvidia/Cosmos-1.0-Diffusion-7B-Video2World" - >>> pipe = CosmosVideoToWorldPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = CosmosVideoToWorldPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.transformer = torch.compile(pipe.transformer) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py index b8c70fc6528c..d417fe103e42 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py @@ -49,7 +49,7 @@ >>> from diffusers.utils import pt_to_pil >>> import torch - >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16) + >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", dtype=torch.float16) >>> pipe.enable_model_cpu_offload() >>> prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"' @@ -62,7 +62,7 @@ >>> pil_image[0].save("./if_stage_I.png") >>> super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained( - ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", dtype=torch.float16 ... ) >>> super_res_1_pipe.enable_model_cpu_offload() @@ -80,7 +80,7 @@ ... "watermarker": pipe.watermarker, ... } >>> super_res_2_pipe = DiffusionPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-x4-upscaler", **safety_modules, dtype=torch.float16 ... ) >>> super_res_2_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py index 3dadc63f4952..19c548c8c4e2 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py @@ -80,7 +80,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> pipe = IFImg2ImgPipeline.from_pretrained( ... "DeepFloyd/IF-I-XL-v1.0", ... variant="fp16", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.enable_model_cpu_offload() @@ -102,7 +102,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: ... "DeepFloyd/IF-II-L-v1.0", ... text_encoder=None, ... variant="fp16", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> super_res_1_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py index 4839a0860462..b3990841837d 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py @@ -84,7 +84,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> pipe = IFImg2ImgPipeline.from_pretrained( ... "DeepFloyd/IF-I-XL-v1.0", ... variant="fp16", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.enable_model_cpu_offload() @@ -106,7 +106,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: ... "DeepFloyd/IF-II-L-v1.0", ... text_encoder=None, ... variant="fp16", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> super_res_1_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py index 03a9d6f7c5e8..76cbbdfc3e54 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py @@ -84,7 +84,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> mask_image = mask_image >>> pipe = IFInpaintingPipeline.from_pretrained( - ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() @@ -104,7 +104,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> pil_image[0].save("./if_stage_I.png") >>> super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained( - ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", dtype=torch.float16 ... ) >>> super_res_1_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py index 841382ad9c63..f21770b22739 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py @@ -87,7 +87,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> mask_image = mask_image >>> pipe = IFInpaintingPipeline.from_pretrained( - ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() @@ -107,7 +107,7 @@ def resize(images: PIL.Image.Image, img_size: int) -> PIL.Image.Image: >>> pil_image[0].save("./if_stage_I.png") >>> super_res_1_pipe = IFInpaintingSuperResolutionPipeline.from_pretrained( - ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", dtype=torch.float16 ... ) >>> super_res_1_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py index 52ebebb6f9b4..3e3f020d567f 100644 --- a/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +++ b/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py @@ -54,7 +54,7 @@ >>> from diffusers.utils import pt_to_pil >>> import torch - >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16) + >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", dtype=torch.float16) >>> pipe.enable_model_cpu_offload() >>> prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"' @@ -67,7 +67,7 @@ >>> pil_image[0].save("./if_stage_I.png") >>> super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained( - ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", torch_dtype=torch.float16 + ... "DeepFloyd/IF-II-L-v1.0", text_encoder=None, variant="fp16", dtype=torch.float16 ... ) >>> super_res_1_pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py b/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py index d69bcc4424d0..113cd94f56b3 100644 --- a/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py +++ b/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py @@ -53,7 +53,7 @@ >>> import torch >>> from diffusers import AltDiffusionPipeline - >>> pipe = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9", torch_dtype=torch.float16) + >>> pipe = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9", dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> # "dark elf princess, highly detailed, d & d, fantasy, highly detailed, digital painting, trending on artstation, concept art, sharp focus, illustration, art by artgerm and greg rutkowski and fuji choko and viktoria gavrilenko and hoang lap" diff --git a/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py b/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py index 8d6862f433a6..4dc424cb4cfb 100644 --- a/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py +++ b/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py @@ -62,7 +62,7 @@ >>> device = "cuda" >>> model_id_or_path = "BAAI/AltDiffusion-m9" - >>> pipe = AltDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16) + >>> pipe = AltDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, dtype=torch.float16) >>> pipe = pipe.to(device) >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/deprecated/amused/pipeline_amused.py b/src/diffusers/pipelines/deprecated/amused/pipeline_amused.py index cf3984a0c9d2..04b222655acc 100644 --- a/src/diffusers/pipelines/deprecated/amused/pipeline_amused.py +++ b/src/diffusers/pipelines/deprecated/amused/pipeline_amused.py @@ -38,7 +38,7 @@ >>> import torch >>> from diffusers import AmusedPipeline - >>> pipe = AmusedPipeline.from_pretrained("amused/amused-512", variant="fp16", torch_dtype=torch.float16) + >>> pipe = AmusedPipeline.from_pretrained("amused/amused-512", variant="fp16", dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> prompt = "a photo of an astronaut riding a horse on mars" diff --git a/src/diffusers/pipelines/deprecated/amused/pipeline_amused_img2img.py b/src/diffusers/pipelines/deprecated/amused/pipeline_amused_img2img.py index d0c6da89f2bc..6f4371748e6e 100644 --- a/src/diffusers/pipelines/deprecated/amused/pipeline_amused_img2img.py +++ b/src/diffusers/pipelines/deprecated/amused/pipeline_amused_img2img.py @@ -40,7 +40,7 @@ >>> from diffusers.utils import load_image >>> pipe = AmusedImg2ImgPipeline.from_pretrained( - ... "amused/amused-512", variant="fp16", torch_dtype=torch.float16 + ... "amused/amused-512", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/amused/pipeline_amused_inpaint.py b/src/diffusers/pipelines/deprecated/amused/pipeline_amused_inpaint.py index d05302e3d28f..a29b670c4284 100644 --- a/src/diffusers/pipelines/deprecated/amused/pipeline_amused_inpaint.py +++ b/src/diffusers/pipelines/deprecated/amused/pipeline_amused_inpaint.py @@ -41,7 +41,7 @@ >>> from diffusers.utils import load_image >>> pipe = AmusedInpaintPipeline.from_pretrained( - ... "amused/amused-512", variant="fp16", torch_dtype=torch.float16 + ... "amused/amused-512", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/audioldm/pipeline_audioldm.py b/src/diffusers/pipelines/deprecated/audioldm/pipeline_audioldm.py index 6f9aa225b389..0fe3f8fba3f0 100644 --- a/src/diffusers/pipelines/deprecated/audioldm/pipeline_audioldm.py +++ b/src/diffusers/pipelines/deprecated/audioldm/pipeline_audioldm.py @@ -45,7 +45,7 @@ >>> import scipy >>> repo_id = "cvssp/audioldm-s-full-v2" - >>> pipe = AudioLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = AudioLDMPipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> prompt = "Techno music with a strong, upbeat tempo and high melodic riffs" diff --git a/src/diffusers/pipelines/deprecated/blip_diffusion/pipeline_blip_diffusion.py b/src/diffusers/pipelines/deprecated/blip_diffusion/pipeline_blip_diffusion.py index fa8405129425..45256556ee36 100644 --- a/src/diffusers/pipelines/deprecated/blip_diffusion/pipeline_blip_diffusion.py +++ b/src/diffusers/pipelines/deprecated/blip_diffusion/pipeline_blip_diffusion.py @@ -43,7 +43,7 @@ >>> import torch >>> blip_diffusion_pipe = BlipDiffusionPipeline.from_pretrained( - ... "Salesforce/blipdiffusion", torch_dtype=torch.float16 + ... "Salesforce/blipdiffusion", dtype=torch.float16 ... ).to("cuda") diff --git a/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py b/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py index 049f4994a4cf..9f233a1079b5 100644 --- a/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py +++ b/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py @@ -76,10 +76,10 @@ >>> controlnet_conditioning_scale = 0.5 >>> controlnet = ControlNetXSAdapter.from_pretrained( - ... "UmerHA/Testing-ConrolNetXS-SD2.1-canny", torch_dtype=torch.float16 + ... "UmerHA/Testing-ConrolNetXS-SD2.1-canny", dtype=torch.float16 ... ) >>> pipe = StableDiffusionControlNetXSPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-2-1-base", controlnet=controlnet, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-2-1-base", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs_sd_xl.py b/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs_sd_xl.py index 18d546b0a822..b06a6ffe1a57 100644 --- a/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs_sd_xl.py +++ b/src/diffusers/pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs_sd_xl.py @@ -86,12 +86,12 @@ >>> # initialize the models and pipeline >>> controlnet_conditioning_scale = 0.5 - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> controlnet = ControlNetXSAdapter.from_pretrained( - ... "UmerHA/Testing-ConrolNetXS-SDXL-canny", torch_dtype=torch.float16 + ... "UmerHA/Testing-ConrolNetXS-SDXL-canny", dtype=torch.float16 ... ) >>> pipe = StableDiffusionXLControlNetXSPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-base-1.0", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/i2vgen_xl/pipeline_i2vgen_xl.py b/src/diffusers/pipelines/deprecated/i2vgen_xl/pipeline_i2vgen_xl.py index 7712743e6bdd..cb9bb9776d88 100644 --- a/src/diffusers/pipelines/deprecated/i2vgen_xl/pipeline_i2vgen_xl.py +++ b/src/diffusers/pipelines/deprecated/i2vgen_xl/pipeline_i2vgen_xl.py @@ -54,7 +54,7 @@ >>> from diffusers.utils import export_to_gif, load_image >>> pipeline = I2VGenXLPipeline.from_pretrained( - ... "ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16" + ... "ali-vilab/i2vgen-xl", dtype=torch.float16, variant="fp16" ... ) >>> pipeline.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/musicldm/pipeline_musicldm.py b/src/diffusers/pipelines/deprecated/musicldm/pipeline_musicldm.py index 93acc4612cac..66cf55e774af 100644 --- a/src/diffusers/pipelines/deprecated/musicldm/pipeline_musicldm.py +++ b/src/diffusers/pipelines/deprecated/musicldm/pipeline_musicldm.py @@ -64,7 +64,7 @@ >>> import scipy >>> repo_id = "ucsd-reach/musicldm" - >>> pipe = MusicLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = MusicLDMPipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> prompt = "Techno music with a strong, upbeat tempo and high melodic riffs" diff --git a/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py b/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py index 665eae146b72..4dcb04deb40f 100644 --- a/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py +++ b/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py @@ -494,7 +494,7 @@ def __call__( >>> pipe = PaintByExamplePipeline.from_pretrained( ... "Fantasy-Studio/Paint-by-Example", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/pia/pipeline_pia.py b/src/diffusers/pipelines/deprecated/pia/pipeline_pia.py index d98de77aa871..0e0aaebaa1f6 100644 --- a/src/diffusers/pipelines/deprecated/pia/pipeline_pia.py +++ b/src/diffusers/pipelines/deprecated/pia/pipeline_pia.py @@ -73,7 +73,7 @@ >>> adapter = MotionAdapter.from_pretrained("openmmlab/PIA-condition-adapter") >>> pipe = PIAPipeline.from_pretrained( - ... "SG161222/Realistic_Vision_V6.0_B1_noVAE", motion_adapter=adapter, torch_dtype=torch.float16 + ... "SG161222/Realistic_Vision_V6.0_B1_noVAE", motion_adapter=adapter, dtype=torch.float16 ... ) >>> pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config) diff --git a/src/diffusers/pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py b/src/diffusers/pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py index bb3009d238a4..a171eb66a10b 100644 --- a/src/diffusers/pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py +++ b/src/diffusers/pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py @@ -331,7 +331,7 @@ def __call__( >>> from diffusers import SemanticStableDiffusionPipeline >>> pipe = SemanticStableDiffusionPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py b/src/diffusers/pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py index 6a9e031f8d14..1a85a5d63474 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py @@ -59,7 +59,7 @@ >>> from diffusers import StableDiffusionAttendAndExcitePipeline >>> pipe = StableDiffusionAttendAndExcitePipeline.from_pretrained( - ... "CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16 + ... "CompVis/stable-diffusion-v1-4", dtype=torch.float16 ... ).to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py b/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py index ee8675678f2d..d1c85068d66e 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py @@ -94,7 +94,7 @@ class DiffEditInversionPipelineOutput(BaseOutput): >>> init_image = download_image(img_url).resize((768, 768)) >>> pipeline = StableDiffusionDiffEditPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-2-1", dtype=torch.float16 ... ) >>> pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config) @@ -130,7 +130,7 @@ class DiffEditInversionPipelineOutput(BaseOutput): >>> init_image = download_image(img_url).resize((768, 768)) >>> pipeline = StableDiffusionDiffEditPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-2-1", dtype=torch.float16 ... ) >>> pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config) diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py b/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py index 38f5af842e1b..ce5410b2ecf9 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py @@ -60,7 +60,7 @@ >>> # Insert objects described by text at the region defined by bounding boxes >>> pipe = StableDiffusionGLIGENPipeline.from_pretrained( - ... "masterful/gligen-1-4-inpainting-text-box", variant="fp16", torch_dtype=torch.float16 + ... "masterful/gligen-1-4-inpainting-text-box", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") @@ -86,7 +86,7 @@ >>> # Generate an image described by the prompt and >>> # insert objects described by text at the region defined by bounding boxes >>> pipe = StableDiffusionGLIGENPipeline.from_pretrained( - ... "masterful/gligen-1-4-generation-text-box", variant="fp16", torch_dtype=torch.float16 + ... "masterful/gligen-1-4-generation-text-box", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py b/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py index d72d12a64945..724eee96af2d 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py @@ -66,7 +66,7 @@ >>> # Insert objects described by image at the region defined by bounding boxes >>> pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained( - ... "anhnct/Gligen_Inpainting_Text_Image", torch_dtype=torch.float16 + ... "anhnct/Gligen_Inpainting_Text_Image", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") @@ -96,7 +96,7 @@ >>> # Generate an image described by the prompt and >>> # insert objects described by text and image at the region defined by bounding boxes >>> pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained( - ... "anhnct/Gligen_Text_Image", torch_dtype=torch.float16 + ... "anhnct/Gligen_Text_Image", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") @@ -122,7 +122,7 @@ >>> # Generate an image described by the prompt and >>> # transfer style described by image at the region defined by bounding boxes >>> pipe = StableDiffusionGLIGENTextImagePipeline.from_pretrained( - ... "anhnct/Gligen_Text_Image", torch_dtype=torch.float16 + ... "anhnct/Gligen_Text_Image", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py b/src/diffusers/pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py index 481c9c93ddde..806114e616a8 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py @@ -57,7 +57,7 @@ >>> model_ckpt = "stabilityai/stable-diffusion-2-base" >>> scheduler = DDIMScheduler.from_pretrained(model_ckpt, subfolder="scheduler") >>> pipe = StableDiffusionPanoramaPipeline.from_pretrained( - ... model_ckpt, scheduler=scheduler, torch_dtype=torch.float16 + ... model_ckpt, scheduler=scheduler, dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py b/src/diffusers/pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py index 35c7f9b970b9..afe46001ad45 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py @@ -615,7 +615,7 @@ def __call__( from diffusers.pipelines.stable_diffusion_safe import SafetyConfig pipeline = StableDiffusionPipelineSafe.from_pretrained( - "AIML-TUDA/stable-diffusion-safe", torch_dtype=torch.float16 + "AIML-TUDA/stable-diffusion-safe", dtype=torch.float16 ).to("cuda") prompt = "the four horsewomen of the apocalypse, painting by tom of finland, gaston bussiere, craig mullins, j. c. leyendecker" image = pipeline(prompt=prompt, **SafetyConfig.MEDIUM).images[0] diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_sag/pipeline_stable_diffusion_sag.py b/src/diffusers/pipelines/deprecated/stable_diffusion_sag/pipeline_stable_diffusion_sag.py index 678ef74f387c..90778c3b70fb 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_sag/pipeline_stable_diffusion_sag.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_sag/pipeline_stable_diffusion_sag.py @@ -56,7 +56,7 @@ >>> from diffusers import StableDiffusionSAGPipeline >>> pipe = StableDiffusionSAGPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py b/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py index ea81be87a0f4..c140d2911ecd 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py @@ -51,7 +51,7 @@ ... ) >>> pipe = StableDiffusionParadigmsPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", scheduler=scheduler, torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", scheduler=scheduler, dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py b/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py index f88c6d8fbc30..55c63c66d511 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py @@ -87,7 +87,7 @@ class Pix2PixInversionPipelineOutput(BaseOutput, TextualInversionLoaderMixin): >>> model_ckpt = "CompVis/stable-diffusion-v1-4" - >>> pipeline = StableDiffusionPix2PixZeroPipeline.from_pretrained(model_ckpt, torch_dtype=torch.float16) + >>> pipeline = StableDiffusionPix2PixZeroPipeline.from_pretrained(model_ckpt, dtype=torch.float16) >>> pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config) >>> pipeline.to("cuda") @@ -125,7 +125,7 @@ class Pix2PixInversionPipelineOutput(BaseOutput, TextualInversionLoaderMixin): >>> captioner_id = "Salesforce/blip-image-captioning-base" >>> processor = BlipProcessor.from_pretrained(captioner_id) >>> model = BlipForConditionalGeneration.from_pretrained( - ... captioner_id, torch_dtype=torch.float16, low_cpu_mem_usage=True + ... captioner_id, dtype=torch.float16, low_cpu_mem_usage=True ... ) >>> sd_model_ckpt = "CompVis/stable-diffusion-v1-4" @@ -133,7 +133,7 @@ class Pix2PixInversionPipelineOutput(BaseOutput, TextualInversionLoaderMixin): ... sd_model_ckpt, ... caption_generator=model, ... caption_processor=processor, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... safety_checker=None, ... ) diff --git a/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth.py b/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth.py index b3d52f1de279..c879026eca47 100644 --- a/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth.py +++ b/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth.py @@ -55,7 +55,7 @@ >>> from diffusers.utils import export_to_video >>> pipe = TextToVideoSDPipeline.from_pretrained( - ... "damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16" + ... "damo-vilab/text-to-video-ms-1.7b", dtype=torch.float16, variant="fp16" ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py b/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py index c0d71c6ffd88..f56827e5cf8f 100644 --- a/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +++ b/src/diffusers/pipelines/deprecated/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py @@ -55,7 +55,7 @@ >>> from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler >>> from diffusers.utils import export_to_video - >>> pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", torch_dtype=torch.float16) + >>> pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", dtype=torch.float16) >>> pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config) >>> pipe.to("cuda") @@ -69,7 +69,7 @@ >>> # and load the image-to-image model >>> pipe = DiffusionPipeline.from_pretrained( - ... "cerspense/zeroscope_v2_XL", torch_dtype=torch.float16, revision="refs/pr/15" + ... "cerspense/zeroscope_v2_XL", dtype=torch.float16, revision="refs/pr/15" ... ) >>> pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py index 101a1b72e7f9..4615e6820453 100644 --- a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py +++ b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py @@ -155,7 +155,7 @@ def image_variation( >>> image = Image.open(BytesIO(response.content)).convert("RGB") >>> pipe = VersatileDiffusionPipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") @@ -258,7 +258,7 @@ def text_to_image( >>> import torch >>> pipe = VersatileDiffusionPipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") @@ -377,7 +377,7 @@ def dual_guided( >>> text = "a red car in the sun" >>> pipe = VersatileDiffusionPipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py index 038169770d8d..abec6ba3bc31 100644 --- a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py +++ b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py @@ -463,7 +463,7 @@ def __call__( >>> text = "a red car in the sun" >>> pipe = VersatileDiffusionDualGuidedPipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe.remove_unused_weights() >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py index 7481ab1c8cba..ea56b2a63aa0 100644 --- a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py +++ b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py @@ -312,7 +312,7 @@ def __call__( >>> image = Image.open(BytesIO(response.content)).convert("RGB") >>> pipe = VersatileDiffusionImageVariationPipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py index 5ee5758fac8a..dd02659d99d8 100644 --- a/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py +++ b/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py @@ -389,7 +389,7 @@ def __call__( >>> import torch >>> pipe = VersatileDiffusionTextToImagePipeline.from_pretrained( - ... "shi-labs/versatile-diffusion", torch_dtype=torch.float16 + ... "shi-labs/versatile-diffusion", dtype=torch.float16 ... ) >>> pipe.remove_unused_weights() >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen.py b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen.py index aeef16bc45e0..4dc2ff524ce1 100644 --- a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen.py +++ b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen.py @@ -43,9 +43,9 @@ >>> from diffusers import WuerstchenPriorPipeline, WuerstchenDecoderPipeline >>> prior_pipe = WuerstchenPriorPipeline.from_pretrained( - ... "warp-ai/wuerstchen-prior", torch_dtype=torch.float16 + ... "warp-ai/wuerstchen-prior", dtype=torch.float16 ... ).to("cuda") - >>> gen_pipe = WuerstchenDecoderPipeline.from_pretrain("warp-ai/wuerstchen", torch_dtype=torch.float16).to( + >>> gen_pipe = WuerstchenDecoderPipeline.from_pretrain("warp-ai/wuerstchen", dtype=torch.float16).to( ... "cuda" ... ) diff --git a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_combined.py b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_combined.py index 3bffdcae251d..0dcc420e5724 100644 --- a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_combined.py +++ b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_combined.py @@ -31,7 +31,7 @@ ```py >>> from diffusions import WuerstchenCombinedPipeline - >>> pipe = WuerstchenCombinedPipeline.from_pretrained("warp-ai/Wuerstchen", torch_dtype=torch.float16).to( + >>> pipe = WuerstchenCombinedPipeline.from_pretrained("warp-ai/Wuerstchen", dtype=torch.float16).to( ... "cuda" ... ) >>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" diff --git a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_prior.py b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_prior.py index 4a95796b6481..8a952147313c 100644 --- a/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_prior.py +++ b/src/diffusers/pipelines/deprecated/wuerstchen/pipeline_wuerstchen_prior.py @@ -47,7 +47,7 @@ >>> from diffusers import WuerstchenPriorPipeline >>> prior_pipe = WuerstchenPriorPipeline.from_pretrained( - ... "warp-ai/wuerstchen-prior", torch_dtype=torch.float16 + ... "warp-ai/wuerstchen-prior", dtype=torch.float16 ... ).to("cuda") >>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" diff --git a/src/diffusers/pipelines/dit/pipeline_dit.py b/src/diffusers/pipelines/dit/pipeline_dit.py index dd73d364067e..1c0c4481cd18 100644 --- a/src/diffusers/pipelines/dit/pipeline_dit.py +++ b/src/diffusers/pipelines/dit/pipeline_dit.py @@ -134,7 +134,7 @@ def __call__( >>> from diffusers import DiTPipeline, DPMSolverMultistepScheduler >>> import torch - >>> pipe = DiTPipeline.from_pretrained("facebook/DiT-XL-2-256", torch_dtype=torch.float16) + >>> pipe = DiTPipeline.from_pretrained("facebook/DiT-XL-2-256", dtype=torch.float16) >>> pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/dreamlite/pipeline_dreamlite.py b/src/diffusers/pipelines/dreamlite/pipeline_dreamlite.py index e9a0e3c2a767..c068ecf67fc8 100644 --- a/src/diffusers/pipelines/dreamlite/pipeline_dreamlite.py +++ b/src/diffusers/pipelines/dreamlite/pipeline_dreamlite.py @@ -51,7 +51,7 @@ >>> from diffusers import DreamLitePipeline >>> pipe = DreamLitePipeline.from_pretrained( - ... "carlofkl/DreamLite-base", revision="diffusers", torch_dtype=torch.bfloat16 + ... "carlofkl/DreamLite-base", revision="diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/dreamlite/pipeline_dreamlite_mobile.py b/src/diffusers/pipelines/dreamlite/pipeline_dreamlite_mobile.py index ca9e6b7b4c40..c671cbc385fc 100644 --- a/src/diffusers/pipelines/dreamlite/pipeline_dreamlite_mobile.py +++ b/src/diffusers/pipelines/dreamlite/pipeline_dreamlite_mobile.py @@ -139,7 +139,7 @@ def retrieve_timesteps( >>> from diffusers import DreamLiteMobilePipeline >>> pipe = DreamLiteMobilePipeline.from_pretrained( - ... "carlofkl/DreamLite-mobile", revision="diffusers", torch_dtype=torch.bfloat16 + ... "carlofkl/DreamLite-mobile", revision="diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py index 72e19a8cce1f..4d6345ecbc38 100755 --- a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py +++ b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py @@ -53,7 +53,7 @@ >>> # Models: "alibaba-pai/EasyAnimateV5.1-12b-zh" >>> pipe = EasyAnimatePipeline.from_pretrained( - ... "alibaba-pai/EasyAnimateV5.1-7b-zh-diffusers", torch_dtype=torch.float16 + ... "alibaba-pai/EasyAnimateV5.1-7b-zh-diffusers", dtype=torch.float16 ... ).to("cuda") >>> prompt = ( ... "A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. " diff --git a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py index 4ad3a48b70ec..19f6204c4b7d 100755 --- a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py +++ b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py @@ -57,7 +57,7 @@ >>> from diffusers.utils import export_to_video, load_video >>> pipe = EasyAnimateControlPipeline.from_pretrained( - ... "alibaba-pai/EasyAnimateV5.1-12b-zh-Control-diffusers", torch_dtype=torch.bfloat16 + ... "alibaba-pai/EasyAnimateV5.1-12b-zh-Control-diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py index 69bb332944d6..ab67ada9c885 100755 --- a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py +++ b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py @@ -57,7 +57,7 @@ >>> from diffusers.utils import export_to_video, load_image >>> pipe = EasyAnimateInpaintPipeline.from_pretrained( - ... "alibaba-pai/EasyAnimateV5.1-12b-zh-InP-diffusers", torch_dtype=torch.bfloat16 + ... "alibaba-pai/EasyAnimateV5.1-12b-zh-InP-diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/flux/pipeline_flux.py b/src/diffusers/pipelines/flux/pipeline_flux.py index d3e0682c5419..22ced8989f69 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux.py +++ b/src/diffusers/pipelines/flux/pipeline_flux.py @@ -59,7 +59,7 @@ >>> import torch >>> from diffusers import FluxPipeline - >>> pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) + >>> pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" >>> # Depending on the variant being used, the pipeline call will slightly vary. diff --git a/src/diffusers/pipelines/flux/pipeline_flux_control.py b/src/diffusers/pipelines/flux/pipeline_flux_control.py index 46671c44cca8..b6c8f779fce3 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_control.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_control.py @@ -56,7 +56,7 @@ >>> from diffusers.utils import load_image >>> pipe = FluxControlPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.1-Canny-dev", dtype=torch.bfloat16 ... ).to("cuda") >>> prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts." diff --git a/src/diffusers/pipelines/flux/pipeline_flux_control_img2img.py b/src/diffusers/pipelines/flux/pipeline_flux_control_img2img.py index b455c611e0ae..d9e3a73f0847 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_control_img2img.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_control_img2img.py @@ -56,7 +56,7 @@ >>> from diffusers.utils import load_image >>> pipe = FluxControlImg2ImgPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.1-Canny-dev", dtype=torch.bfloat16 ... ).to("cuda") >>> prompt = "A robot made of exotic candies and chocolates of different kinds. Abstract background" diff --git a/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py index 15e27653c3e2..151ec8a766c7 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py @@ -70,15 +70,15 @@ pipe = FluxControlInpaintPipeline.from_pretrained( "black-forest-labs/FLUX.1-Depth-dev", - torch_dtype=torch.bfloat16, + dtype=torch.bfloat16, ) # use following lines if you have GPU constraints # --------------------------------------------------------------- transformer = FluxTransformer2DModel.from_pretrained( - "sayakpaul/FLUX.1-Depth-dev-nf4", subfolder="transformer", torch_dtype=torch.bfloat16 + "sayakpaul/FLUX.1-Depth-dev-nf4", subfolder="transformer", dtype=torch.bfloat16 ) text_encoder_2 = T5EncoderModel.from_pretrained( - "sayakpaul/FLUX.1-Depth-dev-nf4", subfolder="text_encoder_2", torch_dtype=torch.bfloat16 + "sayakpaul/FLUX.1-Depth-dev-nf4", subfolder="text_encoder_2", dtype=torch.bfloat16 ) pipe.transformer = transformer pipe.text_encoder_2 = text_encoder_2 diff --git a/src/diffusers/pipelines/flux/pipeline_flux_controlnet.py b/src/diffusers/pipelines/flux/pipeline_flux_controlnet.py index e7792d667f16..f6dc66a7d733 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_controlnet.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_controlnet.py @@ -65,9 +65,9 @@ >>> base_model = "black-forest-labs/FLUX.1-dev" >>> controlnet_model = "InstantX/FLUX.1-dev-controlnet-canny" - >>> controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16) + >>> controlnet = FluxControlNetModel.from_pretrained(controlnet_model, dtype=torch.bfloat16) >>> pipe = FluxControlNetPipeline.from_pretrained( - ... base_model, controlnet=controlnet, torch_dtype=torch.bfloat16 + ... base_model, controlnet=controlnet, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> control_image = load_image("https://huggingface.co/InstantX/SD3-Controlnet-Canny/resolve/main/canny.jpg") diff --git a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_image_to_image.py b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_image_to_image.py index 61c9da0c9496..8ebec1b022f4 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_image_to_image.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_image_to_image.py @@ -48,11 +48,11 @@ >>> device = "cuda" if torch.cuda.is_available() else "cpu" >>> controlnet = FluxControlNetModel.from_pretrained( - ... "InstantX/FLUX.1-dev-Controlnet-Canny-alpha", torch_dtype=torch.bfloat16 + ... "InstantX/FLUX.1-dev-Controlnet-Canny-alpha", dtype=torch.bfloat16 ... ) >>> pipe = FluxControlNetImg2ImgPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-schnell", controlnet=controlnet, torch_dtype=torch.float16 + ... "black-forest-labs/FLUX.1-schnell", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.text_encoder.to(torch.float16) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py index eed671152bc9..f05662e66d30 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py @@ -48,10 +48,10 @@ >>> from diffusers.utils import load_image >>> controlnet = FluxControlNetModel.from_pretrained( - ... "InstantX/FLUX.1-dev-controlnet-canny", torch_dtype=torch.float16 + ... "InstantX/FLUX.1-dev-controlnet-canny", dtype=torch.float16 ... ) >>> pipe = FluxControlNetInpaintPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-schnell", controlnet=controlnet, torch_dtype=torch.float16 + ... "black-forest-labs/FLUX.1-schnell", controlnet=controlnet, dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/flux/pipeline_flux_fill.py b/src/diffusers/pipelines/flux/pipeline_flux_fill.py index ab4431b5b768..ed7a392d2c9a 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_fill.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_fill.py @@ -57,7 +57,7 @@ >>> image = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/cup.png") >>> mask = load_image("https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/cup_mask.png") - >>> pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16) + >>> pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() # save some VRAM by offloading the model to CPU >>> image = pipe( diff --git a/src/diffusers/pipelines/flux/pipeline_flux_img2img.py b/src/diffusers/pipelines/flux/pipeline_flux_img2img.py index 94582a84cf84..8b623e3f2ee8 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_img2img.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_img2img.py @@ -63,7 +63,7 @@ >>> from diffusers.utils import load_image >>> device = "cuda" - >>> pipe = FluxImg2ImgPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) + >>> pipe = FluxImg2ImgPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=torch.bfloat16) >>> pipe = pipe.to(device) >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py index 4c35ffefe088..bfd6fcbc1ce7 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py @@ -62,7 +62,7 @@ >>> from diffusers import FluxInpaintPipeline >>> from diffusers.utils import load_image - >>> pipe = FluxInpaintPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) + >>> pipe = FluxInpaintPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" >>> img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" diff --git a/src/diffusers/pipelines/flux/pipeline_flux_kontext.py b/src/diffusers/pipelines/flux/pipeline_flux_kontext.py index 849d9686de62..de90d86d1676 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_kontext.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_kontext.py @@ -61,7 +61,7 @@ >>> from diffusers.utils import load_image >>> pipe = FluxKontextPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.1-Kontext-dev", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py index 9a79aafd8760..14ad6292f760 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py @@ -63,7 +63,7 @@ >>> mask = load_image(mask_url) >>> pipe = FluxKontextInpaintPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.1-Kontext-dev", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") @@ -78,7 +78,7 @@ >>> from diffusers.utils import load_image >>> pipe = FluxKontextInpaintPipeline.from_pretrained( - ... "black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.1-Kontext-dev", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/flux/pipeline_flux_prior_redux.py b/src/diffusers/pipelines/flux/pipeline_flux_prior_redux.py index f173fdef88c6..64cebe1ba32c 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_prior_redux.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_prior_redux.py @@ -59,9 +59,9 @@ >>> repo_redux = "black-forest-labs/FLUX.1-Redux-dev" >>> repo_base = "black-forest-labs/FLUX.1-dev" - >>> pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(repo_redux, torch_dtype=dtype).to(device) + >>> pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(repo_redux, dtype=dtype).to(device) >>> pipe = FluxPipeline.from_pretrained( - ... repo_base, text_encoder=None, text_encoder_2=None, torch_dtype=torch.bfloat16 + ... repo_base, text_encoder=None, text_encoder_2=None, dtype=torch.bfloat16 ... ).to(device) >>> image = load_image( diff --git a/src/diffusers/pipelines/flux2/pipeline_flux2.py b/src/diffusers/pipelines/flux2/pipeline_flux2.py index b1645b4ae244..b8e763df51b3 100644 --- a/src/diffusers/pipelines/flux2/pipeline_flux2.py +++ b/src/diffusers/pipelines/flux2/pipeline_flux2.py @@ -47,7 +47,7 @@ >>> import torch >>> from diffusers import Flux2Pipeline - >>> pipe = Flux2Pipeline.from_pretrained("black-forest-labs/FLUX.2-dev", torch_dtype=torch.bfloat16) + >>> pipe = Flux2Pipeline.from_pretrained("black-forest-labs/FLUX.2-dev", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" >>> # Depending on the variant being used, the pipeline call will slightly vary. diff --git a/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py b/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py index d768e6127f26..9b73a37697bc 100644 --- a/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py +++ b/src/diffusers/pipelines/flux2/pipeline_flux2_klein.py @@ -47,7 +47,7 @@ >>> from diffusers import Flux2KleinPipeline >>> pipe = Flux2KleinPipeline.from_pretrained( - ... "black-forest-labs/FLUX.2-klein-base-9B", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.2-klein-base-9B", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/flux2/pipeline_flux2_klein_inpaint.py b/src/diffusers/pipelines/flux2/pipeline_flux2_klein_inpaint.py index fd9467003a71..a5e2ef924aa1 100644 --- a/src/diffusers/pipelines/flux2/pipeline_flux2_klein_inpaint.py +++ b/src/diffusers/pipelines/flux2/pipeline_flux2_klein_inpaint.py @@ -51,7 +51,7 @@ >>> from diffusers.utils import load_image >>> pipe = Flux2KleinInpaintPipeline.from_pretrained( - ... "black-forest-labs/FLUX.2-klein-base-9B", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.2-klein-base-9B", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" @@ -70,7 +70,7 @@ >>> from diffusers.utils import load_image >>> pipe = Flux2KleinInpaintPipeline.from_pretrained( - ... "black-forest-labs/FLUX.2-klein-base-9B", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.2-klein-base-9B", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py b/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py index 78ed42f20afb..68a53b5c365f 100644 --- a/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py +++ b/src/diffusers/pipelines/flux2/pipeline_flux2_klein_kv.py @@ -49,7 +49,7 @@ >>> from diffusers import Flux2KleinKVPipeline >>> pipe = Flux2KleinKVPipeline.from_pretrained( - ... "black-forest-labs/FLUX.2-klein-9b-kv", torch_dtype=torch.bfloat16 + ... "black-forest-labs/FLUX.2-klein-9b-kv", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> ref_image = Image.open("reference.png") diff --git a/src/diffusers/pipelines/glm_image/pipeline_glm_image.py b/src/diffusers/pipelines/glm_image/pipeline_glm_image.py index 8794e8195771..ce15cf594832 100644 --- a/src/diffusers/pipelines/glm_image/pipeline_glm_image.py +++ b/src/diffusers/pipelines/glm_image/pipeline_glm_image.py @@ -55,7 +55,7 @@ >>> import torch >>> from diffusers import GlmImagePipeline - >>> pipe = GlmImagePipeline.from_pretrained("zai-org/GLM-Image", torch_dtype=torch.bfloat16) + >>> pipe = GlmImagePipeline.from_pretrained("zai-org/GLM-Image", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A photo of an astronaut riding a horse on mars" diff --git a/src/diffusers/pipelines/helios/pipeline_helios.py b/src/diffusers/pipelines/helios/pipeline_helios.py index 90ac654bc77c..ba7a7d66ec7f 100644 --- a/src/diffusers/pipelines/helios/pipeline_helios.py +++ b/src/diffusers/pipelines/helios/pipeline_helios.py @@ -54,8 +54,8 @@ >>> # Available models: BestWishYsh/Helios-Base, BestWishYsh/Helios-Mid, BestWishYsh/Helios-Distilled >>> model_id = "BestWishYsh/Helios-Base" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = HeliosPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = HeliosPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window." diff --git a/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py b/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py index c187e436a857..0df313546ca7 100644 --- a/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py +++ b/src/diffusers/pipelines/helios/pipeline_helios_pyramid.py @@ -55,8 +55,8 @@ >>> # Available models: BestWishYsh/Helios-Base, BestWishYsh/Helios-Mid, BestWishYsh/Helios-Distilled >>> model_id = "BestWishYsh/Helios-Base" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = HeliosPyramidPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = HeliosPyramidPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window." diff --git a/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py b/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py index d723c7941ae9..827817a7c458 100644 --- a/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py +++ b/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py @@ -58,14 +58,14 @@ ... "meta-llama/Meta-Llama-3.1-8B-Instruct", ... output_hidden_states=True, ... output_attentions=True, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> pipe = HiDreamImagePipeline.from_pretrained( ... "HiDream-ai/HiDream-I1-Full", ... tokenizer_4=tokenizer_4, ... text_encoder_4=text_encoder_4, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage.py b/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage.py index 50239e9afa22..52a3db556d73 100644 --- a/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage.py +++ b/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage.py @@ -49,7 +49,7 @@ >>> from diffusers import HunyuanImagePipeline >>> pipe = HunyuanImagePipeline.from_pretrained( - ... "hunyuanvideo-community/HunyuanImage-2.1-Diffusers", torch_dtype=torch.bfloat16 + ... "hunyuanvideo-community/HunyuanImage-2.1-Diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage_refiner.py b/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage_refiner.py index efdb5505e604..a28ececeaec0 100644 --- a/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage_refiner.py +++ b/src/diffusers/pipelines/hunyuan_image/pipeline_hunyuanimage_refiner.py @@ -48,7 +48,7 @@ >>> from diffusers import HunyuanImageRefinerPipeline >>> pipe = HunyuanImageRefinerPipeline.from_pretrained( - ... "hunyuanvideo-community/HunyuanImage-2.1-Refiner-Diffusers", torch_dtype=torch.bfloat16 + ... "hunyuanvideo-community/HunyuanImage-2.1-Refiner-Diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py index bd54f2563b52..ac438bb85c99 100644 --- a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py +++ b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py @@ -51,10 +51,10 @@ >>> model_id = "hunyuanvideo-community/HunyuanVideo" >>> transformer_model_id = "Skywork/SkyReels-V1-Hunyuan-I2V" >>> transformer = HunyuanVideoTransformer3DModel.from_pretrained( - ... transformer_model_id, torch_dtype=torch.bfloat16 + ... transformer_model_id, dtype=torch.bfloat16 ... ) >>> pipe = HunyuanSkyreelsImageToVideoPipeline.from_pretrained( - ... model_id, transformer=transformer, torch_dtype=torch.float16 + ... model_id, transformer=transformer, dtype=torch.float16 ... ) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py index 5e785c38891c..e26fdce35bb3 100644 --- a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py +++ b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py @@ -49,9 +49,9 @@ >>> model_id = "hunyuanvideo-community/HunyuanVideo" >>> transformer = HunyuanVideoTransformer3DModel.from_pretrained( - ... model_id, subfolder="transformer", torch_dtype=torch.bfloat16 + ... model_id, subfolder="transformer", dtype=torch.bfloat16 ... ) - >>> pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=torch.float16) + >>> pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, dtype=torch.float16) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py index 349481492ac0..dc2dea7787da 100644 --- a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py +++ b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py @@ -62,20 +62,20 @@ >>> from transformers import SiglipImageProcessor, SiglipVisionModel >>> transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained( - ... "lllyasviel/FramePackI2V_HY", torch_dtype=torch.bfloat16 + ... "lllyasviel/FramePackI2V_HY", dtype=torch.bfloat16 ... ) >>> feature_extractor = SiglipImageProcessor.from_pretrained( ... "lllyasviel/flux_redux_bfl", subfolder="feature_extractor" ... ) >>> image_encoder = SiglipVisionModel.from_pretrained( - ... "lllyasviel/flux_redux_bfl", subfolder="image_encoder", torch_dtype=torch.float16 + ... "lllyasviel/flux_redux_bfl", subfolder="image_encoder", dtype=torch.float16 ... ) >>> pipe = HunyuanVideoFramepackPipeline.from_pretrained( ... "hunyuanvideo-community/HunyuanVideo", ... transformer=transformer, ... feature_extractor=feature_extractor, ... image_encoder=image_encoder, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") @@ -106,20 +106,20 @@ >>> from transformers import SiglipImageProcessor, SiglipVisionModel >>> transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained( - ... "lllyasviel/FramePackI2V_HY", torch_dtype=torch.bfloat16 + ... "lllyasviel/FramePackI2V_HY", dtype=torch.bfloat16 ... ) >>> feature_extractor = SiglipImageProcessor.from_pretrained( ... "lllyasviel/flux_redux_bfl", subfolder="feature_extractor" ... ) >>> image_encoder = SiglipVisionModel.from_pretrained( - ... "lllyasviel/flux_redux_bfl", subfolder="image_encoder", torch_dtype=torch.float16 + ... "lllyasviel/flux_redux_bfl", subfolder="image_encoder", dtype=torch.float16 ... ) >>> pipe = HunyuanVideoFramepackPipeline.from_pretrained( ... "hunyuanvideo-community/HunyuanVideo", ... transformer=transformer, ... feature_extractor=feature_extractor, ... image_encoder=image_encoder, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py index 13eb35386001..b6098f85e6c5 100644 --- a/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py +++ b/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py @@ -57,10 +57,10 @@ >>> # Available checkpoints: hunyuanvideo-community/HunyuanVideo-I2V, hunyuanvideo-community/HunyuanVideo-I2V-33ch >>> model_id = "hunyuanvideo-community/HunyuanVideo-I2V" >>> transformer = HunyuanVideoTransformer3DModel.from_pretrained( - ... model_id, subfolder="transformer", torch_dtype=torch.bfloat16 + ... model_id, subfolder="transformer", dtype=torch.bfloat16 ... ) >>> pipe = HunyuanVideoImageToVideoPipeline.from_pretrained( - ... model_id, transformer=transformer, torch_dtype=torch.float16 + ... model_id, transformer=transformer, dtype=torch.float16 ... ) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py index a0adff493ac0..662c4ffc2bb5 100644 --- a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py +++ b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py @@ -48,7 +48,7 @@ >>> from diffusers.utils import export_to_video >>> model_id = "hunyuanvideo-community/HunyuanVideo-1.5-480p_t2v" - >>> pipe = HunyuanVideo15Pipeline.from_pretrained(model_id, torch_dtype=torch.float16) + >>> pipe = HunyuanVideo15Pipeline.from_pretrained(model_id, dtype=torch.float16) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5_image2video.py b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5_image2video.py index 1d33c2ae188f..e9762c840b07 100644 --- a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5_image2video.py +++ b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5_image2video.py @@ -56,7 +56,7 @@ >>> from diffusers.utils import export_to_video >>> model_id = "hunyuanvideo-community/HunyuanVideo-1.5-480p_i2v" - >>> pipe = HunyuanVideo15ImageToVideoPipeline.from_pretrained(model_id, torch_dtype=torch.float16) + >>> pipe = HunyuanVideo15ImageToVideoPipeline.from_pretrained(model_id, dtype=torch.float16) >>> pipe.vae.enable_tiling() >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py b/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py index 5d656a3c370a..05ade9dab09f 100644 --- a/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py +++ b/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py @@ -49,7 +49,7 @@ >>> from diffusers import HunyuanDiTPipeline >>> pipe = HunyuanDiTPipeline.from_pretrained( - ... "Tencent-Hunyuan/HunyuanDiT-Diffusers", torch_dtype=torch.float16 + ... "Tencent-Hunyuan/HunyuanDiT-Diffusers", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/ideogram4/pipeline_ideogram4.py b/src/diffusers/pipelines/ideogram4/pipeline_ideogram4.py index 541259ed1f03..4b3f2a430521 100644 --- a/src/diffusers/pipelines/ideogram4/pipeline_ideogram4.py +++ b/src/diffusers/pipelines/ideogram4/pipeline_ideogram4.py @@ -57,7 +57,7 @@ >>> import torch >>> from diffusers import Ideogram4Pipeline - >>> pipe = Ideogram4Pipeline.from_pretrained("ideogram-ai/ideogram-v4", torch_dtype=torch.bfloat16) + >>> pipe = Ideogram4Pipeline.from_pretrained("ideogram-ai/ideogram-v4", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A photo of a cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit.py b/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit.py index bf9f12a34c21..931526b93965 100644 --- a/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit.py +++ b/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit.py @@ -29,7 +29,7 @@ >>> from diffusers.utils import load_image >>> model_id = "jdopensource/JoyAI-Image-Edit-Diffusers" - >>> pipe = JoyImageEditPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = JoyImageEditPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> image = load_image("https://huggingface.co/datasets/diffusers/docs-images/resolve/main/astronaut.jpg") diff --git a/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit_plus.py b/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit_plus.py index ac8e01278e3e..88bb95e72f64 100644 --- a/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit_plus.py +++ b/src/diffusers/pipelines/joyimage/pipeline_joyimage_edit_plus.py @@ -45,7 +45,7 @@ >>> from diffusers.utils import load_image >>> model_id = "jdopensource/JoyAI-Image-Edit-Plus-Diffusers" - >>> pipe = JoyImageEditPlusPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = JoyImageEditPlusPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> images = [ diff --git a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py index 3a0c3c07e8ca..7b3b9065af9e 100644 --- a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py +++ b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py @@ -43,7 +43,7 @@ import torch pipe = AutoPipelineForText2Image.from_pretrained( - "kandinsky-community/kandinsky-2-1", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-1", dtype=torch.float16 ) pipe.enable_model_cpu_offload() @@ -64,7 +64,7 @@ import os pipe = AutoPipelineForImage2Image.from_pretrained( - "kandinsky-community/kandinsky-2-1", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-1", dtype=torch.float16 ) pipe.enable_model_cpu_offload() @@ -90,7 +90,7 @@ import numpy as np pipe = AutoPipelineForInpainting.from_pretrained( - "kandinsky-community/kandinsky-2-1-inpaint", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-1-inpaint", dtype=torch.float16 ) pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py index f374741bd9fb..1180c71b3d0e 100644 --- a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py +++ b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py @@ -47,7 +47,7 @@ >>> import torch >>> pipe_prior = KandinskyPriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-1-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-1-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -55,7 +55,7 @@ >>> image_emb, zero_image_emb = pipe_prior(prompt, return_dict=False) >>> pipe = KandinskyImg2ImgPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-1", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-1", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py index 9bc52ce871f5..a7d69e254e86 100644 --- a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py +++ b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py @@ -53,7 +53,7 @@ >>> import numpy as np >>> pipe_prior = KandinskyPriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-1-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-1-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -61,7 +61,7 @@ >>> image_emb, zero_image_emb = pipe_prior(prompt, return_dict=False) >>> pipe = KandinskyInpaintPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-1-inpaint", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-1-inpaint", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py index 5708286b7d5a..3f195fce8a7a 100644 --- a/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py +++ b/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py @@ -82,7 +82,7 @@ >>> from torchvision import transforms >>> pipe_prior = KandinskyPriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-1-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-1-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -100,7 +100,7 @@ >>> weights = [0.3, 0.3, 0.4] >>> image_emb, zero_image_emb = pipe_prior.interpolate(images_texts, weights) - >>> pipe = KandinskyPipeline.from_pretrained("kandinsky-community/kandinsky-2-1", torch_dtype=torch.float16) + >>> pipe = KandinskyPipeline.from_pretrained("kandinsky-community/kandinsky-2-1", dtype=torch.float16) >>> pipe.to("cuda") >>> image = pipe( diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py index d5616958a563..74718145dd92 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py @@ -37,7 +37,7 @@ import torch pipe = AutoPipelineForText2Image.from_pretrained( - "kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-2-decoder", dtype=torch.float16 ) pipe.enable_model_cpu_offload() @@ -58,7 +58,7 @@ import os pipe = AutoPipelineForImage2Image.from_pretrained( - "kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-2-decoder", dtype=torch.float16 ) pipe.enable_model_cpu_offload() @@ -84,7 +84,7 @@ import numpy as np pipe = AutoPipelineForInpainting.from_pretrained( - "kandinsky-community/kandinsky-2-2-decoder-inpaint", torch_dtype=torch.float16 + "kandinsky-community/kandinsky-2-2-decoder-inpaint", dtype=torch.float16 ) pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py index a9b7be516114..9956d9813d1b 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py @@ -60,12 +60,12 @@ >>> depth_estimator = pipeline("depth-estimation") >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior = pipe_prior.to("cuda") >>> pipe = KandinskyV22ControlnetPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-controlnet-depth", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-controlnet-depth", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py index f77a40595194..b3efad91849a 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py @@ -62,12 +62,12 @@ >>> depth_estimator = pipeline("depth-estimation") >>> pipe_prior = KandinskyV22PriorEmb2EmbPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior = pipe_prior.to("cuda") >>> pipe = KandinskyV22ControlnetImg2ImgPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-controlnet-depth", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-controlnet-depth", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py index dc17f49bbfe0..e806ddc878b8 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py @@ -43,7 +43,7 @@ >>> import torch >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -51,7 +51,7 @@ >>> image_emb, zero_image_emb = pipe_prior(prompt, return_dict=False) >>> pipe = KandinskyV22Img2ImgPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-decoder", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py index f258dfc07094..737c74fc2166 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py @@ -49,7 +49,7 @@ >>> import numpy as np >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -57,7 +57,7 @@ >>> image_emb, zero_image_emb = pipe_prior(prompt, return_dict=False) >>> pipe = KandinskyV22InpaintPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-decoder-inpaint", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-decoder-inpaint", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py index 8095f79280d4..b8e265a39bce 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py @@ -56,7 +56,7 @@ >>> from torchvision import transforms >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") >>> img1 = load_image( @@ -71,7 +71,7 @@ >>> weights = [0.3, 0.3, 0.4] >>> out = pipe_prior.interpolate(images_texts, weights) >>> pipe = KandinskyV22Pipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-decoder", dtype=torch.float16 ... ) >>> pipe.to("cuda") >>> image = pipe( diff --git a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py index 72f1d8556ec5..0ccc99e3a92c 100644 --- a/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py +++ b/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py @@ -27,7 +27,7 @@ >>> import torch >>> pipe_prior = KandinskyPriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -39,7 +39,7 @@ >>> image_emb, nagative_image_emb = pipe_prior(prompt, image=img, strength=0.2).to_tuple() >>> pipe = KandinskyPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-decoder, torch_dtype=torch.float16" + ... "kandinsky-community/kandinsky-2-2-decoder, dtype=torch.float16" ... ) >>> pipe.to("cuda") @@ -66,7 +66,7 @@ >>> from torchvision import transforms >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-prior", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-prior", dtype=torch.float16 ... ) >>> pipe_prior.to("cuda") @@ -85,7 +85,7 @@ >>> image_emb, zero_image_emb = pipe_prior.interpolate(images_texts, weights) >>> pipe = KandinskyV22Pipeline.from_pretrained( - ... "kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-2-2-decoder", dtype=torch.float16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py b/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py index ca8f124c74cf..1dd5a7a4ac96 100644 --- a/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py +++ b/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py @@ -33,7 +33,7 @@ >>> import torch >>> pipe = AutoPipelineForText2Image.from_pretrained( - ... "kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-3", variant="fp16", dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py b/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py index beb4caafb6d3..24e5e9ac1cd5 100644 --- a/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py +++ b/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py @@ -38,7 +38,7 @@ >>> import torch >>> pipe = AutoPipelineForImage2Image.from_pretrained( - ... "kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16 + ... "kandinsky-community/kandinsky-3", variant="fp16", dtype=torch.float16 ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py index 1ce885b21f5b..dbd11ada5c1a 100644 --- a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py +++ b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py @@ -74,7 +74,7 @@ >>> # kandinskylab/Kandinsky-5.0-T2V-Lite-pretrain-10s-Diffusers >>> model_id = "kandinskylab/Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers" - >>> pipe = Kandinsky5T2VPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Kandinsky5T2VPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe = pipe.to("cuda") >>> prompt = "A cat and a dog baking a cake together in a kitchen." diff --git a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py index 0a8382d6031f..33339f8896df 100644 --- a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py +++ b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py @@ -67,7 +67,7 @@ >>> # kandinskylab/Kandinsky-5.0-I2I-Lite-pretrain-Diffusers >>> model_id = "kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers" - >>> pipe = Kandinsky5I2IPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Kandinsky5I2IPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe = pipe.to("cuda") >>> prompt = "A cat and a dog baking a cake together in a kitchen." diff --git a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2v.py b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2v.py index e82dc737f1a9..d080e28602b3 100644 --- a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2v.py +++ b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2v.py @@ -67,7 +67,7 @@ >>> # kandinskylab/Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers >>> model_id = "kandinskylab/Kandinsky-5.0-I2V-Pro-sft-5s-Diffusers" - >>> pipe = Kandinsky5I2VPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Kandinsky5I2VPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe = pipe.to("cuda") >>> image = load_image( diff --git a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py index 2a58d4bed33a..33d581aacbdc 100644 --- a/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py +++ b/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py @@ -67,7 +67,7 @@ >>> # kandinskylab/Kandinsky-5.0-T2I-Lite-pretrain-Diffusers >>> model_id = "kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers" - >>> pipe = Kandinsky5T2IPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = Kandinsky5T2IPipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> pipe = pipe.to("cuda") >>> prompt = "A cat and a dog baking a cake together in a kitchen." diff --git a/src/diffusers/pipelines/kolors/pipeline_kolors.py b/src/diffusers/pipelines/kolors/pipeline_kolors.py index 1e11faf8b9b6..3b5d64e95a48 100644 --- a/src/diffusers/pipelines/kolors/pipeline_kolors.py +++ b/src/diffusers/pipelines/kolors/pipeline_kolors.py @@ -48,7 +48,7 @@ >>> from diffusers import KolorsPipeline >>> pipe = KolorsPipeline.from_pretrained( - ... "Kwai-Kolors/Kolors-diffusers", variant="fp16", torch_dtype=torch.float16 + ... "Kwai-Kolors/Kolors-diffusers", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/kolors/pipeline_kolors_img2img.py b/src/diffusers/pipelines/kolors/pipeline_kolors_img2img.py index d9b519267216..a3dfc44e443d 100644 --- a/src/diffusers/pipelines/kolors/pipeline_kolors_img2img.py +++ b/src/diffusers/pipelines/kolors/pipeline_kolors_img2img.py @@ -50,7 +50,7 @@ >>> from diffusers.utils import load_image >>> pipe = KolorsImg2ImgPipeline.from_pretrained( - ... "Kwai-Kolors/Kolors-diffusers", variant="fp16", torch_dtype=torch.float16 + ... "Kwai-Kolors/Kolors-diffusers", variant="fp16", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") >>> url = ( diff --git a/src/diffusers/pipelines/krea2/pipeline_krea2.py b/src/diffusers/pipelines/krea2/pipeline_krea2.py index 51d33cb48619..e6031472491c 100644 --- a/src/diffusers/pipelines/krea2/pipeline_krea2.py +++ b/src/diffusers/pipelines/krea2/pipeline_krea2.py @@ -46,7 +46,7 @@ >>> from diffusers import Krea2Pipeline >>> # Load from a local directory produced by the Krea 2 conversion (no hub repo yet). - >>> pipe = Krea2Pipeline.from_pretrained("path/to/krea2-diffusers", torch_dtype=torch.bfloat16) + >>> pipe = Krea2Pipeline.from_pretrained("path/to/krea2-diffusers", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "a fox in the snow" >>> # Base (midtrain) checkpoint defaults. For the few-step distilled (TDM) checkpoint use diff --git a/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py b/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py index 424a2c46e06b..8a3903f0725d 100644 --- a/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +++ b/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py @@ -134,7 +134,7 @@ def retrieve_timesteps( >>> pipe = AutoPipelineForImage2Image.from_pretrained("SimianLuo/LCM_Dreamshaper_v7") >>> # To save GPU memory, torch.float16 can be used, but it may compromise image quality. - >>> pipe.to(torch_device="cuda", torch_dtype=torch.float32) + >>> pipe.to(torch_device="cuda", dtype=torch.float32) >>> prompt = "High altitude snowy mountains" >>> image = PIL.Image.open("./snowy_mountains.png") diff --git a/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py b/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py index 60f59ec7f9d3..9e128eb2bc39 100644 --- a/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +++ b/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py @@ -58,7 +58,7 @@ >>> pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7") >>> # To save GPU memory, torch.float16 can be used, but it may compromise image quality. - >>> pipe.to(torch_device="cuda", torch_dtype=torch.float32) + >>> pipe.to(torch_device="cuda", dtype=torch.float32) >>> prompt = "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k" diff --git a/src/diffusers/pipelines/latte/pipeline_latte.py b/src/diffusers/pipelines/latte/pipeline_latte.py index 7bc7b4aa915e..5000bdaaa6f3 100644 --- a/src/diffusers/pipelines/latte/pipeline_latte.py +++ b/src/diffusers/pipelines/latte/pipeline_latte.py @@ -66,7 +66,7 @@ >>> from diffusers.utils import export_to_gif >>> # You can replace the checkpoint id with "maxin-cn/Latte-1" too. - >>> pipe = LattePipeline.from_pretrained("maxin-cn/Latte-1", torch_dtype=torch.float16) + >>> pipe = LattePipeline.from_pretrained("maxin-cn/Latte-1", dtype=torch.float16) >>> # Enable memory optimizations. >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py b/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py index 9048b56b01f4..6262889f7354 100644 --- a/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py +++ b/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py @@ -49,7 +49,7 @@ >>> from diffusers.utils import load_image >>> pipe = LEditsPPPipelineStableDiffusion.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", variant="fp16", torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", variant="fp16", dtype=torch.float16 ... ) >>> pipe.vae.enable_tiling() >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py b/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py index c2e6f3caaf47..32716a2bf812 100644 --- a/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py +++ b/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py @@ -76,7 +76,7 @@ >>> from diffusers.utils import load_image >>> pipe = LEditsPPPipelineStableDiffusionXL.from_pretrained( - ... "stabilityai/stable-diffusion-xl-base-1.0", variant="fp16", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-base-1.0", variant="fp16", dtype=torch.float16 ... ) >>> pipe.vae.enable_tiling() >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py b/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py index 4eaa858e41c1..ed27ba1d9282 100644 --- a/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py +++ b/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py @@ -47,7 +47,7 @@ >>> import torch >>> from diffusers import LongCatImagePipeline - >>> pipe = LongCatImagePipeline.from_pretrained("meituan-longcat/LongCat-Image", torch_dtype=torch.bfloat16) + >>> pipe = LongCatImagePipeline.from_pretrained("meituan-longcat/LongCat-Image", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "一个年轻的亚裔女性,身穿黄色针织衫,搭配白色项链。她的双手放在膝盖上,表情恬静。背景是一堵粗糙的砖墙,午后的阳光温暖地洒在她身上,营造出一种宁静而温馨的氛围。镜头采用中距离视角,突出她的神态和服饰的细节。光线柔和地打在她的脸上,强调她的五官和饰品的质感,增加画面的层次感与亲和力。整个画面构图简洁,砖墙的纹理与阳光的光影效果相得益彰,突显出人物的优雅与从容。" diff --git a/src/diffusers/pipelines/longcat_image/pipeline_longcat_image_edit.py b/src/diffusers/pipelines/longcat_image/pipeline_longcat_image_edit.py index 119de3946fbc..a0f2e610069a 100644 --- a/src/diffusers/pipelines/longcat_image/pipeline_longcat_image_edit.py +++ b/src/diffusers/pipelines/longcat_image/pipeline_longcat_image_edit.py @@ -50,7 +50,7 @@ >>> from diffusers import LongCatImageEditPipeline >>> pipe = LongCatImageEditPipeline.from_pretrained( - ... "meituan-longcat/LongCat-Image-Edit", torch_dtype=torch.bfloat16 + ... "meituan-longcat/LongCat-Image-Edit", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/ltx/pipeline_ltx.py b/src/diffusers/pipelines/ltx/pipeline_ltx.py index ce9177547c52..b70c3b8efce7 100644 --- a/src/diffusers/pipelines/ltx/pipeline_ltx.py +++ b/src/diffusers/pipelines/ltx/pipeline_ltx.py @@ -47,7 +47,7 @@ >>> from diffusers import LTXPipeline >>> from diffusers.utils import export_to_video - >>> pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16) + >>> pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage" diff --git a/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py b/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py index 28d296695998..4f7f27e9bf48 100644 --- a/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py +++ b/src/diffusers/pipelines/ltx/pipeline_ltx_condition.py @@ -49,7 +49,7 @@ >>> from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXConditionPipeline, LTXVideoCondition >>> from diffusers.utils import export_to_video, load_video, load_image - >>> pipe = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.5", torch_dtype=torch.bfloat16) + >>> pipe = LTXConditionPipeline.from_pretrained("Lightricks/LTX-Video-0.9.5", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # Load input image and video diff --git a/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py b/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py index 81ecfce50efa..98e9aa31edfb 100644 --- a/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py +++ b/src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py @@ -48,7 +48,7 @@ >>> from diffusers import LTXImageToVideoPipeline >>> from diffusers.utils import export_to_video, load_image - >>> pipe = LTXImageToVideoPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16) + >>> pipe = LTXImageToVideoPipeline.from_pretrained("Lightricks/LTX-Video", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> image = load_image( diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2.py index 493db96e48a7..d998d20c78b9 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2.py @@ -50,7 +50,7 @@ >>> from diffusers import LTX2Pipeline >>> from diffusers.utils import encode_video - >>> pipe = LTX2Pipeline.from_pretrained("Lightricks/LTX-2", torch_dtype=torch.bfloat16) + >>> pipe = LTX2Pipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() >>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage" diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py index ecc89ae79a30..ab4fed491c0e 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py @@ -55,7 +55,7 @@ >>> from diffusers.pipelines.ltx2.pipeline_ltx2_condition import LTX2VideoCondition >>> from diffusers.utils import load_image - >>> pipe = LTX2ConditionPipeline.from_pretrained("Lightricks/LTX-2", torch_dtype=torch.bfloat16) + >>> pipe = LTX2ConditionPipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() >>> first_image = load_image( diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_hdr_lora.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_hdr_lora.py index 38cd69b66c64..e998d7c2a797 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_hdr_lora.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_hdr_lora.py @@ -80,7 +80,7 @@ class LTX2HDRReferenceCondition: >>> from diffusers.pipelines.ltx2.export_utils import encode_hdr_tensor_to_mp4 >>> from diffusers.utils import load_video - >>> pipe = LTX2HDRPipeline.from_pretrained("diffusers/LTX-2.3-Distilled-Diffusers", torch_dtype=torch.bfloat16) + >>> pipe = LTX2HDRPipeline.from_pretrained("diffusers/LTX-2.3-Distilled-Diffusers", dtype=torch.bfloat16) >>> pipe.enable_sequential_cpu_offload(device="cuda") >>> pipe.load_lora_weights( ... "Lightricks/LTX-2.3-22b-IC-LoRA-HDR", diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_ic_lora.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_ic_lora.py index 8f2e3504e777..c7b04b975b8f 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_ic_lora.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_ic_lora.py @@ -79,7 +79,7 @@ class LTX2ReferenceCondition: >>> from diffusers.pipelines.ltx2.utils import DEFAULT_NEGATIVE_PROMPT >>> from diffusers.utils import load_video - >>> pipe = LTX2InContextPipeline.from_pretrained("diffusers/LTX-2.3-Diffusers", torch_dtype=torch.bfloat16) + >>> pipe = LTX2InContextPipeline.from_pretrained("diffusers/LTX-2.3-Diffusers", dtype=torch.bfloat16) >>> pipe.enable_sequential_cpu_offload(device="cuda") >>> pipe.load_lora_weights( ... "Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In", diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py index 1f721bf54364..821d5ab8c388 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py @@ -52,7 +52,7 @@ >>> from diffusers.utils import encode_video >>> from diffusers.utils import load_image - >>> pipe = LTX2ImageToVideoPipeline.from_pretrained("Lightricks/LTX-2", torch_dtype=torch.bfloat16) + >>> pipe = LTX2ImageToVideoPipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() >>> image = load_image( diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py index 4d085ca8f4ca..cefb04550dc2 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py @@ -37,7 +37,7 @@ >>> from diffusers.pipelines.ltx2.latent_upsampler import LTX2LatentUpsamplerModel >>> from diffusers.utils import load_image - >>> pipe = LTX2ImageToVideoPipeline.from_pretrained("Lightricks/LTX-2", torch_dtype=torch.bfloat16) + >>> pipe = LTX2ImageToVideoPipeline.from_pretrained("Lightricks/LTX-2", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() >>> image = load_image( @@ -62,7 +62,7 @@ ... ) >>> latent_upsampler = LTX2LatentUpsamplerModel.from_pretrained( - ... "Lightricks/LTX-2", subfolder="latent_upsampler", torch_dtype=torch.bfloat16 + ... "Lightricks/LTX-2", subfolder="latent_upsampler", dtype=torch.bfloat16 ... ) >>> upsample_pipe = LTX2LatentUpsamplePipeline(vae=pipe.vae, latent_upsampler=latent_upsampler) >>> upsample_pipe.vae.enable_tiling() diff --git a/src/diffusers/pipelines/lucy/pipeline_lucy_edit.py b/src/diffusers/pipelines/lucy/pipeline_lucy_edit.py index 69eb2a02be5c..9d66a3e93fc1 100644 --- a/src/diffusers/pipelines/lucy/pipeline_lucy_edit.py +++ b/src/diffusers/pipelines/lucy/pipeline_lucy_edit.py @@ -79,8 +79,8 @@ >>> # Load model >>> model_id = "decart-ai/Lucy-Edit-Dev" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = LucyEditPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = LucyEditPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # Generate video diff --git a/src/diffusers/pipelines/lumina/pipeline_lumina.py b/src/diffusers/pipelines/lumina/pipeline_lumina.py index 1cfd9b482d8e..a5d34d70f9a9 100644 --- a/src/diffusers/pipelines/lumina/pipeline_lumina.py +++ b/src/diffusers/pipelines/lumina/pipeline_lumina.py @@ -63,7 +63,7 @@ >>> import torch >>> from diffusers import LuminaPipeline - >>> pipe = LuminaPipeline.from_pretrained("Alpha-VLLM/Lumina-Next-SFT-diffusers", torch_dtype=torch.bfloat16) + >>> pipe = LuminaPipeline.from_pretrained("Alpha-VLLM/Lumina-Next-SFT-diffusers", dtype=torch.bfloat16) >>> # Enable memory optimizations. >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/lumina2/pipeline_lumina2.py b/src/diffusers/pipelines/lumina2/pipeline_lumina2.py index 2129bfeb8fbf..94a785851df7 100644 --- a/src/diffusers/pipelines/lumina2/pipeline_lumina2.py +++ b/src/diffusers/pipelines/lumina2/pipeline_lumina2.py @@ -50,7 +50,7 @@ >>> import torch >>> from diffusers import Lumina2Pipeline - >>> pipe = Lumina2Pipeline.from_pretrained("Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16) + >>> pipe = Lumina2Pipeline.from_pretrained("Alpha-VLLM/Lumina-Image-2.0", dtype=torch.bfloat16) >>> # Enable memory optimizations. >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/marigold/pipeline_marigold_depth.py b/src/diffusers/pipelines/marigold/pipeline_marigold_depth.py index a81d1c51742c..90774970ca5c 100644 --- a/src/diffusers/pipelines/marigold/pipeline_marigold_depth.py +++ b/src/diffusers/pipelines/marigold/pipeline_marigold_depth.py @@ -64,7 +64,7 @@ >>> import torch >>> pipe = diffusers.MarigoldDepthPipeline.from_pretrained( -... "prs-eth/marigold-depth-v1-1", variant="fp16", torch_dtype=torch.float16 +... "prs-eth/marigold-depth-v1-1", variant="fp16", dtype=torch.float16 ... ).to("cuda") >>> image = diffusers.utils.load_image("https://marigoldmonodepth.github.io/images/einstein.jpg") diff --git a/src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py b/src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py index 9488d8f5c9b8..d172506f8afa 100644 --- a/src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py +++ b/src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py @@ -62,7 +62,7 @@ >>> import torch >>> pipe = diffusers.MarigoldIntrinsicsPipeline.from_pretrained( -... "prs-eth/marigold-iid-appearance-v1-1", variant="fp16", torch_dtype=torch.float16 +... "prs-eth/marigold-iid-appearance-v1-1", variant="fp16", dtype=torch.float16 ... ).to("cuda") >>> image = diffusers.utils.load_image("https://marigoldmonodepth.github.io/images/einstein.jpg") @@ -78,7 +78,7 @@ >>> import torch >>> pipe = diffusers.MarigoldIntrinsicsPipeline.from_pretrained( -... "prs-eth/marigold-iid-lighting-v1-1", variant="fp16", torch_dtype=torch.float16 +... "prs-eth/marigold-iid-lighting-v1-1", variant="fp16", dtype=torch.float16 ... ).to("cuda") >>> image = diffusers.utils.load_image("https://marigoldmonodepth.github.io/images/einstein.jpg") diff --git a/src/diffusers/pipelines/marigold/pipeline_marigold_normals.py b/src/diffusers/pipelines/marigold/pipeline_marigold_normals.py index 3f94ce441232..b4a9c10a33c6 100644 --- a/src/diffusers/pipelines/marigold/pipeline_marigold_normals.py +++ b/src/diffusers/pipelines/marigold/pipeline_marigold_normals.py @@ -62,7 +62,7 @@ >>> import torch >>> pipe = diffusers.MarigoldNormalsPipeline.from_pretrained( -... "prs-eth/marigold-normals-v1-1", variant="fp16", torch_dtype=torch.float16 +... "prs-eth/marigold-normals-v1-1", variant="fp16", dtype=torch.float16 ... ).to("cuda") >>> image = diffusers.utils.load_image("https://marigoldmonodepth.github.io/images/einstein.jpg") diff --git a/src/diffusers/pipelines/mochi/pipeline_mochi.py b/src/diffusers/pipelines/mochi/pipeline_mochi.py index 7108d4ff774f..4b65295a8220 100644 --- a/src/diffusers/pipelines/mochi/pipeline_mochi.py +++ b/src/diffusers/pipelines/mochi/pipeline_mochi.py @@ -47,7 +47,7 @@ >>> from diffusers import MochiPipeline >>> from diffusers.utils import export_to_video - >>> pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", torch_dtype=torch.bfloat16) + >>> pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", dtype=torch.bfloat16) >>> pipe.enable_model_cpu_offload() >>> pipe.vae.enable_tiling() >>> prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k." diff --git a/src/diffusers/pipelines/motif_video/pipeline_motif_video.py b/src/diffusers/pipelines/motif_video/pipeline_motif_video.py index 8ad37932e970..52df987a0f7a 100644 --- a/src/diffusers/pipelines/motif_video/pipeline_motif_video.py +++ b/src/diffusers/pipelines/motif_video/pipeline_motif_video.py @@ -52,7 +52,7 @@ >>> # Load the Motif-Video pipeline >>> motif_video_model_id = "Motif-Technologies/Motif-Video-2B" - >>> pipe = MotifVideoPipeline.from_pretrained(motif_video_model_id, torch_dtype=torch.bfloat16) + >>> pipe = MotifVideoPipeline.from_pretrained(motif_video_model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage" diff --git a/src/diffusers/pipelines/motif_video/pipeline_motif_video_image2video.py b/src/diffusers/pipelines/motif_video/pipeline_motif_video_image2video.py index 1b32ba74f24b..5d6972ee3a5c 100644 --- a/src/diffusers/pipelines/motif_video/pipeline_motif_video_image2video.py +++ b/src/diffusers/pipelines/motif_video/pipeline_motif_video_image2video.py @@ -55,7 +55,7 @@ >>> # Load the Motif-Video image-to-video pipeline >>> motif_video_model_id = "Motif-Technologies/Motif-Video-2B" - >>> pipe = MotifVideoImage2VideoPipeline.from_pretrained(motif_video_model_id, torch_dtype=torch.bfloat16) + >>> pipe = MotifVideoImage2VideoPipeline.from_pretrained(motif_video_model_id, dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # Load an image diff --git a/src/diffusers/pipelines/nucleusmoe_image/pipeline_nucleusmoe_image.py b/src/diffusers/pipelines/nucleusmoe_image/pipeline_nucleusmoe_image.py index f50f11c8c152..c2116c4f4360 100644 --- a/src/diffusers/pipelines/nucleusmoe_image/pipeline_nucleusmoe_image.py +++ b/src/diffusers/pipelines/nucleusmoe_image/pipeline_nucleusmoe_image.py @@ -46,7 +46,7 @@ >>> import torch >>> from diffusers import NucleusMoEImagePipeline - >>> pipe = NucleusMoEImagePipeline.from_pretrained("NucleusAI/NucleusMoE-Image", torch_dtype=torch.bfloat16) + >>> pipe = NucleusMoEImagePipeline.from_pretrained("NucleusAI/NucleusMoE-Image", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" >>> image = pipe(prompt, num_inference_steps=50).images[0] diff --git a/src/diffusers/pipelines/omnigen/pipeline_omnigen.py b/src/diffusers/pipelines/omnigen/pipeline_omnigen.py index 6e5db93d1f35..b2e49cd9a4c9 100644 --- a/src/diffusers/pipelines/omnigen/pipeline_omnigen.py +++ b/src/diffusers/pipelines/omnigen/pipeline_omnigen.py @@ -44,7 +44,7 @@ >>> import torch >>> from diffusers import OmniGenPipeline - >>> pipe = OmniGenPipeline.from_pretrained("Shitao/OmniGen-v1-diffusers", torch_dtype=torch.bfloat16) + >>> pipe = OmniGenPipeline.from_pretrained("Shitao/OmniGen-v1-diffusers", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/ovis_image/pipeline_ovis_image.py b/src/diffusers/pipelines/ovis_image/pipeline_ovis_image.py index b22f2f0cec2d..be8d22bf1fcb 100644 --- a/src/diffusers/pipelines/ovis_image/pipeline_ovis_image.py +++ b/src/diffusers/pipelines/ovis_image/pipeline_ovis_image.py @@ -44,7 +44,7 @@ >>> import torch >>> from diffusers import OvisImagePipeline - >>> pipe = OvisImagePipeline.from_pretrained("AIDC-AI/Ovis-Image-7B", torch_dtype=torch.bfloat16) + >>> pipe = OvisImagePipeline.from_pretrained("AIDC-AI/Ovis-Image-7B", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = 'A creative 3D artistic render where the text "OVIS-IMAGE" is written in a bold, expressive handwritten brush style using thick, wet oil paint. The paint is a mix of vibrant rainbow colors (red, blue, yellow) swirling together like toothpaste or impasto art. You can see the ridges of the brush bristles and the glossy, wet texture of the paint. The background is a clean artist\'s canvas. Dynamic lighting creates soft shadows behind the floating paint strokes. Colorful, expressive, tactile texture, 4k detail.' >>> image = pipe(prompt, negative_prompt="", num_inference_steps=50, guidance_scale=5.0).images[0] diff --git a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py index 3a88272f24f4..4360cf498aa5 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py @@ -78,11 +78,11 @@ >>> canny_image = Image.fromarray(image) >>> # load control net and stable diffusion v1-5 - >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16) + >>> controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", dtype=torch.float16) >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "stable-diffusion-v1-5/stable-diffusion-v1-5", ... controlnet=controlnet, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py index 98221e4c30ba..9ef49670ba89 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py @@ -90,12 +90,12 @@ >>> control_image = make_canny_condition(init_image) >>> controlnet = ControlNetModel.from_pretrained( - ... "lllyasviel/control_v11p_sd15_inpaint", torch_dtype=torch.float16 + ... "lllyasviel/control_v11p_sd15_inpaint", dtype=torch.float16 ... ) >>> pipe = AutoPipelineForInpainting.from_pretrained( ... "stable-diffusion-v1-5/stable-diffusion-v1-5", ... controlnet=controlnet, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py index 9ba42eb0352f..8f227259bb88 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py @@ -95,14 +95,14 @@ >>> # initialize the models and pipeline >>> controlnet_conditioning_scale = 0.5 # recommended for good generalization >>> controlnet = ControlNetModel.from_pretrained( - ... "diffusers/controlnet-canny-sdxl-1.0", torch_dtype=torch.float16 + ... "diffusers/controlnet-canny-sdxl-1.0", dtype=torch.float16 ... ) - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", ... controlnet=controlnet, ... vae=vae, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl_img2img.py b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl_img2img.py index bfe45761d5a0..6064e5cf3e73 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl_img2img.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl_img2img.py @@ -91,16 +91,16 @@ ... "diffusers/controlnet-depth-sdxl-1.0-small", ... variant="fp16", ... use_safetensors="True", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) - >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) + >>> vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.float16) >>> pipe = StableDiffusionXLControlNetPAGImg2ImgPipeline.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", ... controlnet=controlnet, ... vae=vae, ... variant="fp16", ... use_safetensors=True, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/pag/pipeline_pag_hunyuandit.py b/src/diffusers/pipelines/pag/pipeline_pag_hunyuandit.py index a443a19bd952..34f0b2364349 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_hunyuandit.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_hunyuandit.py @@ -52,7 +52,7 @@ >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... pag_applied_layers=[14], ... ).to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_kolors.py b/src/diffusers/pipelines/pag/pipeline_pag_kolors.py index 4f138d91d9c6..17e49d453c37 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_kolors.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_kolors.py @@ -51,7 +51,7 @@ >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "Kwai-Kolors/Kolors-diffusers", ... variant="fp16", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... pag_applied_layers=["down.block_2.attentions_1", "up.block_0.attentions_1"], ... ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py b/src/diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py index 2e7e8ab9814f..9d689631b13d 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py @@ -69,7 +69,7 @@ >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "PixArt-alpha/PixArt-Sigma-XL-2-1024-MS", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... pag_applied_layers=["blocks.14"], ... enable_pag=True, ... ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sana.py b/src/diffusers/pipelines/pag/pipeline_pag_sana.py index f621255325a0..c4ac79431707 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sana.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sana.py @@ -72,7 +72,7 @@ >>> pipe = SanaPAGPipeline.from_pretrained( ... "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers", ... pag_applied_layers=["transformer_blocks.8"], - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe.to("cuda") >>> pipe.text_encoder.to(torch.bfloat16) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd.py b/src/diffusers/pipelines/pag/pipeline_pag_sd.py index b12597460f65..1dda03bedf94 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd.py @@ -57,7 +57,7 @@ >>> from diffusers import AutoPipelineForText2Image >>> pipe = AutoPipelineForText2Image.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16, enable_pag=True + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.float16, enable_pag=True ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_3.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_3.py index d86adccc2ccf..8c4662fac1f4 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_3.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_3.py @@ -61,7 +61,7 @@ >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "stabilityai/stable-diffusion-3-medium-diffusers", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... pag_applied_layers=["blocks.13"], ... ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_3_img2img.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_3_img2img.py index 24f3d828bd81..7e912498d484 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_3_img2img.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_3_img2img.py @@ -63,7 +63,7 @@ >>> pipe = StableDiffusion3PAGImg2ImgPipeline.from_pretrained( ... "stabilityai/stable-diffusion-3-medium-diffusers", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... pag_applied_layers=["blocks.13"], ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py index 2baeda5649ad..c50d1c61d552 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py @@ -69,7 +69,7 @@ ... motion_adapter=motion_adapter, ... scheduler=scheduler, ... pag_applied_layers=["mid"], - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ).to("cuda") >>> video = pipe( diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_img2img.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_img2img.py index de6dfbc585fa..0c50315104d2 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_img2img.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_img2img.py @@ -62,7 +62,7 @@ >>> pipe = AutoPipelineForImage2Image.from_pretrained( ... "stable-diffusion-v1-5/stable-diffusion-v1-5", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py index 426419f12f73..afdc914b66f7 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py @@ -58,7 +58,7 @@ >>> from diffusers import AutoPipelineForInpainting >>> pipe = AutoPipelineForInpainting.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16, enable_pag=True + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.float16, enable_pag=True ... ) >>> pipe = pipe.to("cuda") >>> img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl.py index 1de57a922616..157f02eaa19a 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl.py @@ -71,7 +71,7 @@ >>> pipe = AutoPipelineForText2Image.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py index 201d16a86f8a..5feae84d6c18 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py @@ -74,7 +74,7 @@ >>> pipe = AutoPipelineForImage2Image.from_pretrained( ... "stabilityai/stable-diffusion-xl-refiner-1.0", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... enable_pag=True, ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py index 9e70a7779f1e..50ef63868292 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py @@ -75,7 +75,7 @@ >>> pipe = AutoPipelineForInpainting.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... variant="fp16", ... enable_pag=True, ... ) diff --git a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py index b98248f3ca7b..b3f7e2729763 100644 --- a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py +++ b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py @@ -60,7 +60,7 @@ >>> from diffusers import PixArtAlphaPipeline >>> # You can replace the checkpoint id with "PixArt-alpha/PixArt-XL-2-512x512" too. - >>> pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-1024-MS", torch_dtype=torch.float16) + >>> pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-1024-MS", dtype=torch.float16) >>> # Enable memory optimizations. >>> pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py index 286695aa8eb9..ac1a36eb43c3 100644 --- a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py +++ b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py @@ -111,7 +111,7 @@ >>> # You can replace the checkpoint id with "PixArt-alpha/PixArt-Sigma-XL-2-512-MS" too. >>> pipe = PixArtSigmaPipeline.from_pretrained( - ... "PixArt-alpha/PixArt-Sigma-XL-2-1024-MS", torch_dtype=torch.float16 + ... "PixArt-alpha/PixArt-Sigma-XL-2-1024-MS", dtype=torch.float16 ... ) >>> # Enable memory optimizations. >>> # pipe.enable_model_cpu_offload() diff --git a/src/diffusers/pipelines/prx/pipeline_prx_pixel.py b/src/diffusers/pipelines/prx/pipeline_prx_pixel.py index 22a4d8dd4b18..0eedbceed675 100644 --- a/src/diffusers/pipelines/prx/pipeline_prx_pixel.py +++ b/src/diffusers/pipelines/prx/pipeline_prx_pixel.py @@ -85,7 +85,7 @@ def _basic_clean(text: str) -> str: >>> import torch >>> from diffusers import PRXPixelPipeline - >>> pipe = PRXPixelPipeline.from_pretrained("Photoroom/prxpixel-t2i", torch_dtype=torch.bfloat16) + >>> pipe = PRXPixelPipeline.from_pretrained("Photoroom/prxpixel-t2i", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A front-facing portrait of a lion in the golden savanna at sunset." @@ -114,7 +114,7 @@ class PRXPixelPipeline(DiffusionPipeline): >>> import torch >>> from diffusers import PRXPixelPipeline - >>> pipe = PRXPixelPipeline.from_pretrained("Photoroom/prxpixel-t2i", torch_dtype=torch.bfloat16) + >>> pipe = PRXPixelPipeline.from_pretrained("Photoroom/prxpixel-t2i", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A front-facing portrait of a lion in the golden savanna at sunset." diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage.py index 1da0518a4f65..b83a8bdf6313 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage.py @@ -45,7 +45,7 @@ >>> import torch >>> from diffusers import QwenImagePipeline - >>> pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16) + >>> pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" >>> # Depending on the variant being used, the pipeline call will slightly vary. diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet.py index f946fdf27d00..520c77452bd0 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet.py @@ -49,10 +49,10 @@ >>> # QwenImageControlNetModel >>> controlnet = QwenImageControlNetModel.from_pretrained( - ... "InstantX/Qwen-Image-ControlNet-Union", torch_dtype=torch.bfloat16 + ... "InstantX/Qwen-Image-ControlNet-Union", dtype=torch.bfloat16 ... ) >>> pipe = QwenImageControlNetPipeline.from_pretrained( - ... "Qwen/Qwen-Image", controlnet=controlnet, torch_dtype=torch.bfloat16 + ... "Qwen/Qwen-Image", controlnet=controlnet, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "Aesthetics art, traditional asian pagoda, elaborate golden accents, sky blue and white color palette, swirling cloud pattern, digital illustration, east asian architecture, ornamental rooftop, intricate detailing on building, cultural representation." @@ -74,11 +74,11 @@ >>> # QwenImageMultiControlNetModel >>> controlnet = QwenImageControlNetModel.from_pretrained( - ... "InstantX/Qwen-Image-ControlNet-Union", torch_dtype=torch.bfloat16 + ... "InstantX/Qwen-Image-ControlNet-Union", dtype=torch.bfloat16 ... ) >>> controlnet = QwenImageMultiControlNetModel([controlnet]) >>> pipe = QwenImageControlNetPipeline.from_pretrained( - ... "Qwen/Qwen-Image", controlnet=controlnet, torch_dtype=torch.bfloat16 + ... "Qwen/Qwen-Image", controlnet=controlnet, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") >>> prompt = "Aesthetics art, traditional asian pagoda, elaborate golden accents, sky blue and white color palette, swirling cloud pattern, digital illustration, east asian architecture, ornamental rooftop, intricate detailing on building, cultural representation." diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet_inpaint.py index 97f510a6dbf4..6f6c948175b3 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_controlnet_inpaint.py @@ -49,9 +49,9 @@ >>> base_model_path = "Qwen/Qwen-Image" >>> controlnet_model_path = "InstantX/Qwen-Image-ControlNet-Inpainting" - >>> controlnet = QwenImageControlNetModel.from_pretrained(controlnet_model_path, torch_dtype=torch.bfloat16) + >>> controlnet = QwenImageControlNetModel.from_pretrained(controlnet_model_path, dtype=torch.bfloat16) >>> pipe = QwenImageControlNetInpaintPipeline.from_pretrained( - ... base_model_path, controlnet=controlnet, torch_dtype=torch.bfloat16 + ... base_model_path, controlnet=controlnet, dtype=torch.bfloat16 ... ).to("cuda") >>> image = load_image( ... "https://huggingface.co/InstantX/Qwen-Image-ControlNet-Inpainting/resolve/main/assets/images/image1.png" diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py index 85abb815cf23..d52e7bbc4777 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py @@ -48,7 +48,7 @@ >>> from diffusers import QwenImageEditPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> image = load_image( ... "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png" diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py index 57d1fdaaf99f..d733ead8e71a 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py @@ -49,7 +49,7 @@ >>> from diffusers import QwenImageEditInpaintPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageEditInpaintPipeline.from_pretrained("Qwen/Qwen-Image-Edit", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageEditInpaintPipeline.from_pretrained("Qwen/Qwen-Image-Edit", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py index 84d1b60152b1..92c38f26c985 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py @@ -48,7 +48,7 @@ >>> from diffusers import QwenImageEditPlusPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> image = load_image( ... "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png" diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py index 9b9af83737e5..fbd730c6d989 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py @@ -32,7 +32,7 @@ >>> from diffusers import QwenImageImg2ImgPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageImg2ImgPipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageImg2ImgPipeline.from_pretrained("Qwen/Qwen-Image", dtype=torch.bfloat16) >>> pipe = pipe.to("cuda") >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" >>> init_image = load_image(url).resize((1024, 1024)) diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py index 3d5f0040932a..ccba906e7f30 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py @@ -33,7 +33,7 @@ >>> from diffusers import QwenImageInpaintPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageInpaintPipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageInpaintPipeline.from_pretrained("Qwen/Qwen-Image", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" >>> img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_layered.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_layered.py index 7e06a7d36ffd..c67ab26ccabc 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_layered.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_layered.py @@ -48,7 +48,7 @@ >>> from diffusers import QwenImageLayeredPipeline >>> from diffusers.utils import load_image - >>> pipe = QwenImageLayeredPipeline.from_pretrained("Qwen/Qwen-Image-Layered", torch_dtype=torch.bfloat16) + >>> pipe = QwenImageLayeredPipeline.from_pretrained("Qwen/Qwen-Image-Layered", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> image = load_image( ... "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png" diff --git a/src/diffusers/pipelines/sana/pipeline_sana.py b/src/diffusers/pipelines/sana/pipeline_sana.py index 553e45a628d9..99cbb249b07b 100644 --- a/src/diffusers/pipelines/sana/pipeline_sana.py +++ b/src/diffusers/pipelines/sana/pipeline_sana.py @@ -114,7 +114,7 @@ >>> from diffusers import SanaPipeline >>> pipe = SanaPipeline.from_pretrained( - ... "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers", torch_dtype=torch.float32 + ... "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers", dtype=torch.float32 ... ) >>> pipe.to("cuda") >>> pipe.text_encoder.to(torch.bfloat16) diff --git a/src/diffusers/pipelines/sana/pipeline_sana_controlnet.py b/src/diffusers/pipelines/sana/pipeline_sana_controlnet.py index de1910f68192..78aeac6d629d 100644 --- a/src/diffusers/pipelines/sana/pipeline_sana_controlnet.py +++ b/src/diffusers/pipelines/sana/pipeline_sana_controlnet.py @@ -117,7 +117,7 @@ >>> pipe = SanaControlNetPipeline.from_pretrained( ... "ishan24/Sana_600M_1024px_ControlNetPlus_diffusers", ... variant="fp16", - ... torch_dtype={"default": torch.bfloat16, "controlnet": torch.float16, "transformer": torch.float16}, + ... dtype={"default": torch.bfloat16, "controlnet": torch.float16, "transformer": torch.float16}, ... device_map="balanced", ... ) >>> cond_image = load_image( diff --git a/src/diffusers/pipelines/sana/pipeline_sana_sprint.py b/src/diffusers/pipelines/sana/pipeline_sana_sprint.py index 812441d8e462..3cf2cb7274ec 100644 --- a/src/diffusers/pipelines/sana/pipeline_sana_sprint.py +++ b/src/diffusers/pipelines/sana/pipeline_sana_sprint.py @@ -67,7 +67,7 @@ >>> from diffusers import SanaSprintPipeline >>> pipe = SanaSprintPipeline.from_pretrained( - ... "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers", torch_dtype=torch.bfloat16 + ... "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/sana/pipeline_sana_sprint_img2img.py b/src/diffusers/pipelines/sana/pipeline_sana_sprint_img2img.py index e149e0c597b2..3f396e725629 100644 --- a/src/diffusers/pipelines/sana/pipeline_sana_sprint_img2img.py +++ b/src/diffusers/pipelines/sana/pipeline_sana_sprint_img2img.py @@ -68,7 +68,7 @@ >>> from diffusers.utils.loading_utils import load_image >>> pipe = SanaSprintImg2ImgPipeline.from_pretrained( - ... "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers", torch_dtype=torch.bfloat16 + ... "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers", dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/shap_e/pipeline_shap_e.py b/src/diffusers/pipelines/shap_e/pipeline_shap_e.py index eea83aff9e10..a95865268571 100644 --- a/src/diffusers/pipelines/shap_e/pipeline_shap_e.py +++ b/src/diffusers/pipelines/shap_e/pipeline_shap_e.py @@ -53,7 +53,7 @@ >>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu") >>> repo = "openai/shap-e" - >>> pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16) + >>> pipe = DiffusionPipeline.from_pretrained(repo, dtype=torch.float16) >>> pipe = pipe.to(device) >>> guidance_scale = 15.0 diff --git a/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py b/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py index f59fd298c684..bb261a6804f3 100644 --- a/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +++ b/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py @@ -53,7 +53,7 @@ >>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu") >>> repo = "openai/shap-e-img2img" - >>> pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16) + >>> pipe = DiffusionPipeline.from_pretrained(repo, dtype=torch.float16) >>> pipe = pipe.to(device) >>> guidance_scale = 3.0 diff --git a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py index faad0fb14086..9a6a15c4ecc7 100644 --- a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py +++ b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py @@ -61,12 +61,12 @@ >>> vae = AutoencoderKLWan.from_pretrained( ... "Skywork/SkyReels-V2-T2V-14B-720P-Diffusers", ... subfolder="vae", - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe = SkyReelsV2Pipeline.from_pretrained( ... "Skywork/SkyReels-V2-T2V-14B-720P-Diffusers", ... vae=vae, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> flow_shift = 8.0 # 8.0 for T2V, 5.0 for I2V >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) diff --git a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py index 8751240a1af9..ada7f2720a28 100644 --- a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py +++ b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py @@ -64,12 +64,12 @@ >>> vae = AutoencoderKLWan.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... subfolder="vae", - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe = SkyReelsV2DiffusionForcingPipeline.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... vae=vae, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> flow_shift = 8.0 # 8.0 for T2V, 5.0 for I2V >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) diff --git a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py index a8f1b3a84a4a..8a60f173d0ef 100644 --- a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py +++ b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py @@ -68,12 +68,12 @@ >>> vae = AutoencoderKLWan.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... subfolder="vae", - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe = SkyReelsV2DiffusionForcingImageToVideoPipeline.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... vae=vae, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> flow_shift = 5.0 # 8.0 for T2V, 5.0 for I2V >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) diff --git a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py index 924acb850d09..8d85030eda5c 100644 --- a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py +++ b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py @@ -66,12 +66,12 @@ >>> vae = AutoencoderKLWan.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... subfolder="vae", - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe = SkyReelsV2DiffusionForcingVideoToVideoPipeline.from_pretrained( ... "Skywork/SkyReels-V2-DF-14B-720P-Diffusers", ... vae=vae, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> flow_shift = 8.0 # 8.0 for T2V, 5.0 for I2V >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) diff --git a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py index 91c09a56fcfb..0ae2c2bf3fbb 100644 --- a/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py +++ b/src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py @@ -65,12 +65,12 @@ >>> vae = AutoencoderKLWan.from_pretrained( ... "Skywork/SkyReels-V2-I2V-14B-720P-Diffusers", ... subfolder="vae", - ... torch_dtype=torch.float32, + ... dtype=torch.float32, ... ) >>> pipe = SkyReelsV2ImageToVideoPipeline.from_pretrained( ... "Skywork/SkyReels-V2-I2V-14B-720P-Diffusers", ... vae=vae, - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> flow_shift = 5.0 # 8.0 for T2V, 5.0 for I2V >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) diff --git a/src/diffusers/pipelines/stable_audio/pipeline_stable_audio.py b/src/diffusers/pipelines/stable_audio/pipeline_stable_audio.py index 475f4032edab..08408644e03f 100644 --- a/src/diffusers/pipelines/stable_audio/pipeline_stable_audio.py +++ b/src/diffusers/pipelines/stable_audio/pipeline_stable_audio.py @@ -49,7 +49,7 @@ >>> from diffusers import StableAudioPipeline >>> repo_id = "stabilityai/stable-audio-open-1.0" - >>> pipe = StableAudioPipeline.from_pretrained(repo_id, torch_dtype=torch.float16) + >>> pipe = StableAudioPipeline.from_pretrained(repo_id, dtype=torch.float16) >>> pipe = pipe.to("cuda") >>> # define the prompts diff --git a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py index 0961d1c46e94..422b98b32744 100644 --- a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py +++ b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py @@ -42,10 +42,10 @@ >>> from diffusers import StableCascadePriorPipeline, StableCascadeDecoderPipeline >>> prior_pipe = StableCascadePriorPipeline.from_pretrained( - ... "stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16 + ... "stabilityai/stable-cascade-prior", dtype=torch.bfloat16 ... ).to("cuda") >>> gen_pipe = StableCascadeDecoderPipeline.from_pretrain( - ... "stabilityai/stable-cascade", torch_dtype=torch.float16 + ... "stabilityai/stable-cascade", dtype=torch.float16 ... ).to("cuda") >>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" diff --git a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py index 71bfc3f7bab6..cc8070e12ac2 100644 --- a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py +++ b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py @@ -33,7 +33,7 @@ >>> from diffusers import StableCascadeCombinedPipeline >>> pipe = StableCascadeCombinedPipeline.from_pretrained( - ... "stabilityai/stable-cascade", variant="bf16", torch_dtype=torch.bfloat16 + ... "stabilityai/stable-cascade", variant="bf16", dtype=torch.bfloat16 ... ) >>> pipe.enable_model_cpu_offload() >>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" diff --git a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py index fb58094f964b..c2bab5040085 100644 --- a/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py +++ b/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py @@ -47,7 +47,7 @@ >>> from diffusers import StableCascadePriorPipeline >>> prior_pipe = StableCascadePriorPipeline.from_pretrained( - ... "stabilityai/stable-cascade-prior", torch_dtype=torch.bfloat16 + ... "stabilityai/stable-cascade-prior", dtype=torch.bfloat16 ... ).to("cuda") >>> prompt = "an image of a shiba inu, donning a spacesuit and helmet" diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py index d28bb2a9fe59..15f56ecd2a82 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py @@ -56,7 +56,7 @@ >>> from diffusers import StableDiffusionPipeline >>> pipe = StableDiffusionPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py index 977de5d7fb39..6c3687b86c33 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py @@ -726,7 +726,7 @@ def __call__( >>> pipe = StableDiffusionDepth2ImgPipeline.from_pretrained( ... "stabilityai/stable-diffusion-2-depth", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py index 719be9258341..3c01aaa04348 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py @@ -66,7 +66,7 @@ >>> device = "cuda" >>> model_id_or_path = "stable-diffusion-v1-5/stable-diffusion-v1-5" - >>> pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16) + >>> pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, dtype=torch.float16) >>> pipe = pipe.to(device) >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py index 96794eaa297a..e4bf3e5000ca 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py @@ -1032,7 +1032,7 @@ def __call__( >>> mask_image = download_image(mask_url).resize((512, 512)) >>> pipe = StableDiffusionInpaintPipeline.from_pretrained( - ... "stable-diffusion-v1-5/stable-diffusion-inpainting", torch_dtype=torch.float16 + ... "stable-diffusion-v1-5/stable-diffusion-inpainting", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py index 7a24e6008351..95b6999da7a2 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py @@ -280,7 +280,7 @@ def __call__( >>> image = download_image(img_url).resize((512, 512)) >>> pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained( - ... "timbrooks/instruct-pix2pix", torch_dtype=torch.float16 + ... "timbrooks/instruct-pix2pix", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py index 1920f033c126..afbc3df2d8e8 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py @@ -470,12 +470,12 @@ def __call__( >>> import torch >>> pipeline = StableDiffusionPipeline.from_pretrained( - ... "CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16 + ... "CompVis/stable-diffusion-v1-4", dtype=torch.float16 ... ) >>> pipeline.to("cuda") >>> model_id = "stabilityai/sd-x2-latent-upscaler" - >>> upscaler = StableDiffusionLatentUpscalePipeline.from_pretrained(model_id, torch_dtype=torch.float16) + >>> upscaler = StableDiffusionLatentUpscalePipeline.from_pretrained(model_id, dtype=torch.float16) >>> upscaler.to("cuda") >>> prompt = "a photo of an astronaut high resolution, unreal engine, ultra realistic" diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py index 1a0a7412e5d7..d9b0b22ef06b 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py @@ -621,7 +621,7 @@ def __call__( >>> # load model and scheduler >>> model_id = "stabilityai/stable-diffusion-x4-upscaler" >>> pipeline = StableDiffusionUpscalePipeline.from_pretrained( - ... model_id, variant="fp16", torch_dtype=torch.float16 + ... model_id, variant="fp16", dtype=torch.float16 ... ) >>> pipeline = pipeline.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py index d2c9bf0c4162..95398b995f0d 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py @@ -56,7 +56,7 @@ >>> from diffusers import StableUnCLIPPipeline >>> pipe = StableUnCLIPPipeline.from_pretrained( - ... "fusing/stable-unclip-2-1-l", torch_dtype=torch.float16 + ... "fusing/stable-unclip-2-1-l", dtype=torch.float16 ... ) # TODO update model path >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py index 059ae1e6fd4d..f52097a342ce 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py @@ -60,7 +60,7 @@ >>> from diffusers import StableUnCLIPImg2ImgPipeline >>> pipe = StableUnCLIPImg2ImgPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-2-1-unclip-small", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-2-1-unclip-small", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py index 5c05b469660f..107d97091828 100644 --- a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py +++ b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py @@ -61,7 +61,7 @@ >>> from diffusers import StableDiffusion3Pipeline >>> pipe = StableDiffusion3Pipeline.from_pretrained( - ... "stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.float16 ... ) >>> pipe.to("cuda") >>> prompt = "A cat holding a sign that says hello world" diff --git a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py index c0ab805a4ef4..c02a1ff5c994 100644 --- a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py +++ b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py @@ -64,7 +64,7 @@ >>> device = "cuda" >>> model_id_or_path = "stabilityai/stable-diffusion-3-medium-diffusers" - >>> pipe = AutoPipelineForImage2Image.from_pretrained(model_id_or_path, torch_dtype=torch.float16) + >>> pipe = AutoPipelineForImage2Image.from_pretrained(model_id_or_path, dtype=torch.float16) >>> pipe = pipe.to(device) >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py index 321e9f8dd80e..465f17e8abb1 100644 --- a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py @@ -62,7 +62,7 @@ >>> from diffusers.utils import load_image >>> pipe = StableDiffusion3InpaintPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.float16 ... ) >>> pipe.to("cuda") >>> prompt = "Face of a yellow cat, high resolution, sitting on a park bench" diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py index ba94e3051fd3..62f8403c440b 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py @@ -70,7 +70,7 @@ >>> from diffusers import StableDiffusionXLPipeline >>> pipe = StableDiffusionXLPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-base-1.0", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py index c7a13ca02524..7bca64f50db5 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py @@ -72,7 +72,7 @@ >>> from diffusers.utils import load_image >>> pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained( - ... "stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16 + ... "stabilityai/stable-diffusion-xl-refiner-1.0", dtype=torch.float16 ... ) >>> pipe = pipe.to("cuda") >>> url = "https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/aa_xl/000000009.png" diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py index 3f18cbe21d0f..103237c2b373 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py @@ -75,7 +75,7 @@ >>> pipe = StableDiffusionXLInpaintPipeline.from_pretrained( ... "stabilityai/stable-diffusion-xl-base-1.0", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... variant="fp16", ... use_safetensors=True, ... ) diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py index bcd337414bac..473acc780c57 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py @@ -65,7 +65,7 @@ >>> edit_instruction = "Turn sky into a cloudy one" >>> pipe = StableDiffusionXLInstructPix2PixPipeline.from_pretrained( - ... "diffusers/sdxl-instructpix2pix-768", torch_dtype=torch.float16 + ... "diffusers/sdxl-instructpix2pix-768", dtype=torch.float16 ... ).to("cuda") >>> edited_image = pipe( diff --git a/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py b/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py index fd46ddd1b602..9978a4ce86f2 100644 --- a/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py +++ b/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py @@ -47,7 +47,7 @@ >>> from diffusers.utils import load_image, export_to_video >>> pipe = StableVideoDiffusionPipeline.from_pretrained( - ... "stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16" + ... "stabilityai/stable-video-diffusion-img2vid-xt", dtype=torch.float16, variant="fp16" ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py b/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py index ffb877cfd0f6..1f7d29487e5b 100644 --- a/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +++ b/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py @@ -84,11 +84,11 @@ class StableDiffusionAdapterPipelineOutput(BaseOutput): >>> color_palette = image.resize((8, 8)) >>> color_palette = color_palette.resize((512, 512), resample=Image.Resampling.NEAREST) - >>> adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_color_sd14v1", torch_dtype=torch.float16) + >>> adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_color_sd14v1", dtype=torch.float16) >>> pipe = StableDiffusionAdapterPipeline.from_pretrained( ... "CompVis/stable-diffusion-v1-4", ... adapter=adapter, - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py b/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py index a6dd07847de2..1e2755380ce9 100644 --- a/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +++ b/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py @@ -75,13 +75,13 @@ >>> adapter = T2IAdapter.from_pretrained( ... "Adapter/t2iadapter", ... subfolder="sketch_sdxl_1.0", - ... torch_dtype=torch.float16, + ... dtype=torch.float16, ... adapter_type="full_adapter_xl", ... ) >>> scheduler = DDPMScheduler.from_pretrained(model_id, subfolder="scheduler") >>> pipe = StableDiffusionXLAdapterPipeline.from_pretrained( - ... model_id, adapter=adapter, torch_dtype=torch.float16, variant="fp16", scheduler=scheduler + ... model_id, adapter=adapter, dtype=torch.float16, variant="fp16", scheduler=scheduler ... ).to("cuda") >>> generator = torch.manual_seed(42) diff --git a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py index f640fddc2bc5..cfde5f7df9ff 100644 --- a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py +++ b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py @@ -65,7 +65,7 @@ >>> task_prompt = "In each row, a logical task is demonstrated to achieve [IMAGE2] an aesthetically pleasing photograph based on [IMAGE1] sam 2-generated masks with rich color coding." >>> content_prompt = "Majestic photo of a golden eagle perched on a rocky outcrop in a mountainous landscape. The eagle is positioned in the right foreground, facing left, with its sharp beak and keen eyes prominently visible. Its plumage is a mix of dark brown and golden hues, with intricate feather details. The background features a soft-focus view of snow-capped mountains under a cloudy sky, creating a serene and grandiose atmosphere. The foreground includes rugged rocks and patches of green moss. Photorealistic, medium depth of field, soft natural lighting, cool color palette, high contrast, sharp focus on the eagle, blurred background, tranquil, majestic, wildlife photography." >>> pipe = VisualClozePipeline.from_pretrained( - ... "VisualCloze/VisualClozePipeline-384", resolution=384, torch_dtype=torch.bfloat16 + ... "VisualCloze/VisualClozePipeline-384", resolution=384, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py index 17aa366ebacd..c9a6a5eaff29 100644 --- a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py +++ b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py @@ -77,7 +77,7 @@ >>> task_prompt = "In each row, a logical task is demonstrated to achieve [IMAGE2] an aesthetically pleasing photograph based on [IMAGE1] sam 2-generated masks with rich color coding." >>> content_prompt = "Majestic photo of a golden eagle perched on a rocky outcrop in a mountainous landscape. The eagle is positioned in the right foreground, facing left, with its sharp beak and keen eyes prominently visible. Its plumage is a mix of dark brown and golden hues, with intricate feather details. The background features a soft-focus view of snow-capped mountains under a cloudy sky, creating a serene and grandiose atmosphere. The foreground includes rugged rocks and patches of green moss. Photorealistic, medium depth of field, soft natural lighting, cool color palette, high contrast, sharp focus on the eagle, blurred background, tranquil, majestic, wildlife photography." >>> pipe = VisualClozeGenerationPipeline.from_pretrained( - ... "VisualCloze/VisualClozePipeline-384", resolution=384, torch_dtype=torch.bfloat16 + ... "VisualCloze/VisualClozePipeline-384", resolution=384, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/wan/pipeline_wan.py b/src/diffusers/pipelines/wan/pipeline_wan.py index be2d53f17932..179e9a737bcb 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan.py +++ b/src/diffusers/pipelines/wan/pipeline_wan.py @@ -53,8 +53,8 @@ >>> # Available models: Wan-AI/Wan2.1-T2V-14B-Diffusers, Wan-AI/Wan2.1-T2V-1.3B-Diffusers >>> model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = WanPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> flow_shift = 5.0 # 5.0 for 720P, 3.0 for 480P >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/wan/pipeline_wan_animate.py b/src/diffusers/pipelines/wan/pipeline_wan_animate.py index 5806032c0142..cd7dc77b677c 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan_animate.py +++ b/src/diffusers/pipelines/wan/pipeline_wan_animate.py @@ -56,7 +56,7 @@ >>> from diffusers.utils import export_to_video, load_image, load_video >>> model_id = "Wan-AI/Wan2.2-Animate-14B-Diffusers" - >>> pipe = WanAnimatePipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) + >>> pipe = WanAnimatePipeline.from_pretrained(model_id, dtype=torch.bfloat16) >>> # Optionally upcast the Wan VAE to FP32 >>> pipe.vae.to(torch.float32) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/wan/pipeline_wan_i2v.py b/src/diffusers/pipelines/wan/pipeline_wan_i2v.py index 8061f67ab6b9..e45c01ef2561 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan_i2v.py +++ b/src/diffusers/pipelines/wan/pipeline_wan_i2v.py @@ -56,11 +56,11 @@ >>> # Available models: Wan-AI/Wan2.1-I2V-14B-480P-Diffusers, Wan-AI/Wan2.1-I2V-14B-720P-Diffusers >>> model_id = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers" >>> image_encoder = CLIPVisionModel.from_pretrained( - ... model_id, subfolder="image_encoder", torch_dtype=torch.float32 + ... model_id, subfolder="image_encoder", dtype=torch.float32 ... ) - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) >>> pipe = WanImageToVideoPipeline.from_pretrained( - ... model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16 + ... model_id, vae=vae, image_encoder=image_encoder, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/wan/pipeline_wan_vace.py b/src/diffusers/pipelines/wan/pipeline_wan_vace.py index b0896d382d67..7a48f6abe2ad 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan_vace.py +++ b/src/diffusers/pipelines/wan/pipeline_wan_vace.py @@ -70,8 +70,8 @@ def prepare_video_and_mask(first_img: PIL.Image.Image, last_img: PIL.Image.Image >>> # Available checkpoints: Wan-AI/Wan2.1-VACE-1.3B-diffusers, Wan-AI/Wan2.1-VACE-14B-diffusers >>> model_id = "Wan-AI/Wan2.1-VACE-1.3B-diffusers" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = WanVACEPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = WanVACEPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> flow_shift = 3.0 # 5.0 for 720P, 3.0 for 480P >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/wan/pipeline_wan_video2video.py b/src/diffusers/pipelines/wan/pipeline_wan_video2video.py index 8993475a2851..2352c60f58d6 100644 --- a/src/diffusers/pipelines/wan/pipeline_wan_video2video.py +++ b/src/diffusers/pipelines/wan/pipeline_wan_video2video.py @@ -55,8 +55,8 @@ >>> # Available models: Wan-AI/Wan2.1-T2V-14B-Diffusers, Wan-AI/Wan2.1-T2V-1.3B-Diffusers >>> model_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers" - >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) - >>> pipe = WanVideoToVideoPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) + >>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32) + >>> pipe = WanVideoToVideoPipeline.from_pretrained(model_id, vae=vae, dtype=torch.bfloat16) >>> flow_shift = 3.0 # 5.0 for 720P, 3.0 for 480P >>> pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image.py b/src/diffusers/pipelines/z_image/pipeline_z_image.py index 3e2055c6257f..c9d589af03fe 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image.py @@ -37,7 +37,7 @@ >>> import torch >>> from diffusers import ZImagePipeline - >>> pipe = ZImagePipeline.from_pretrained("Z-a-o/Z-Image-Turbo", torch_dtype=torch.bfloat16) + >>> pipe = ZImagePipeline.from_pretrained("Z-a-o/Z-Image-Turbo", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # Optionally, set the attention backend to flash-attn 2 or 3, default is SDPA in PyTorch. diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet.py b/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet.py index 81373ffb56ff..28e52ab08a1e 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet.py @@ -46,7 +46,7 @@ ... "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union", ... filename="Z-Image-Turbo-Fun-Controlnet-Union.safetensors", ... ), - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> # 2.1 @@ -55,7 +55,7 @@ >>> # "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0", >>> # filename="Z-Image-Turbo-Fun-Controlnet-Union-2.1.safetensors", >>> # ), - >>> # torch_dtype=torch.bfloat16, + >>> # dtype=torch.bfloat16, >>> # ) >>> # 2.0 @@ -64,11 +64,11 @@ >>> # "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0", >>> # filename="Z-Image-Turbo-Fun-Controlnet-Union-2.0.safetensors", >>> # ), - >>> # torch_dtype=torch.bfloat16, + >>> # dtype=torch.bfloat16, >>> # ) >>> pipe = ZImageControlNetPipeline.from_pretrained( - ... "Tongyi-MAI/Z-Image-Turbo", controlnet=controlnet, torch_dtype=torch.bfloat16 + ... "Tongyi-MAI/Z-Image-Turbo", controlnet=controlnet, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet_inpaint.py b/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet_inpaint.py index 178e74dea4fa..1dfbdea297d9 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet_inpaint.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image_controlnet_inpaint.py @@ -47,7 +47,7 @@ ... "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0", ... filename="Z-Image-Turbo-Fun-Controlnet-Union-2.1.safetensors", ... ), - ... torch_dtype=torch.bfloat16, + ... dtype=torch.bfloat16, ... ) >>> # 2.0 @@ -56,11 +56,11 @@ >>> # "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0", >>> # filename="Z-Image-Turbo-Fun-Controlnet-Union-2.0.safetensors", >>> # ), - >>> # torch_dtype=torch.bfloat16, + >>> # dtype=torch.bfloat16, >>> # ) >>> pipe = ZImageControlNetInpaintPipeline.from_pretrained( - ... "Tongyi-MAI/Z-Image-Turbo", controlnet=controlnet, torch_dtype=torch.bfloat16 + ... "Tongyi-MAI/Z-Image-Turbo", controlnet=controlnet, dtype=torch.bfloat16 ... ) >>> pipe.to("cuda") diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image_img2img.py b/src/diffusers/pipelines/z_image/pipeline_z_image_img2img.py index b5c7740bb0c1..2bbea56178db 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image_img2img.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image_img2img.py @@ -38,7 +38,7 @@ >>> from diffusers import ZImageImg2ImgPipeline >>> from diffusers.utils import load_image - >>> pipe = ZImageImg2ImgPipeline.from_pretrained("Z-a-o/Z-Image-Turbo", torch_dtype=torch.bfloat16) + >>> pipe = ZImageImg2ImgPipeline.from_pretrained("Z-a-o/Z-Image-Turbo", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py b/src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py index 132c22c0cff3..080e94ef274a 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py @@ -45,7 +45,7 @@ >>> from diffusers import ZImageInpaintPipeline >>> from diffusers.utils import load_image - >>> pipe = ZImageInpaintPipeline.from_pretrained("Tongyi-MAI/Z-Image-Turbo", torch_dtype=torch.bfloat16) + >>> pipe = ZImageInpaintPipeline.from_pretrained("Tongyi-MAI/Z-Image-Turbo", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" diff --git a/src/diffusers/pipelines/z_image/pipeline_z_image_omni.py b/src/diffusers/pipelines/z_image/pipeline_z_image_omni.py index 50776ceaf34d..8a2821f7d26d 100644 --- a/src/diffusers/pipelines/z_image/pipeline_z_image_omni.py +++ b/src/diffusers/pipelines/z_image/pipeline_z_image_omni.py @@ -38,7 +38,7 @@ >>> import torch >>> from diffusers import ZImageOmniPipeline - >>> pipe = ZImageOmniPipeline.from_pretrained("Z-a-o/Z-Image-Turbo", torch_dtype=torch.bfloat16) + >>> pipe = ZImageOmniPipeline.from_pretrained("Z-a-o/Z-Image-Turbo", dtype=torch.bfloat16) >>> pipe.to("cuda") >>> # Optionally, set the attention backend to flash-attn 2 or 3, default is SDPA in PyTorch.