diffusers 0.19.3__py3-none-any.whl → 0.20.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- diffusers/__init__.py +3 -1
- diffusers/commands/fp16_safetensors.py +2 -7
- diffusers/configuration_utils.py +23 -1
- diffusers/dependency_versions_table.py +1 -1
- diffusers/loaders.py +62 -64
- diffusers/models/__init__.py +1 -0
- diffusers/models/activations.py +2 -0
- diffusers/models/attention.py +45 -1
- diffusers/models/autoencoder_tiny.py +193 -0
- diffusers/models/controlnet.py +1 -1
- diffusers/models/embeddings.py +56 -0
- diffusers/models/lora.py +0 -6
- diffusers/models/modeling_flax_utils.py +28 -2
- diffusers/models/modeling_utils.py +33 -16
- diffusers/models/transformer_2d.py +26 -9
- diffusers/models/unet_1d.py +2 -2
- diffusers/models/unet_2d_blocks.py +106 -56
- diffusers/models/unet_2d_condition.py +20 -5
- diffusers/models/vae.py +106 -1
- diffusers/pipelines/__init__.py +1 -0
- diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py +10 -3
- diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py +10 -3
- diffusers/pipelines/audioldm/pipeline_audioldm.py +1 -1
- diffusers/pipelines/auto_pipeline.py +33 -43
- diffusers/pipelines/controlnet/multicontrolnet.py +4 -2
- diffusers/pipelines/controlnet/pipeline_controlnet.py +20 -4
- diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +15 -7
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +14 -4
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +157 -10
- diffusers/pipelines/controlnet/pipeline_flax_controlnet.py +2 -10
- diffusers/pipelines/deepfloyd_if/pipeline_if.py +1 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +1 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +1 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +1 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +1 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +1 -1
- diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py +43 -2
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py +44 -2
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py +1 -1
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py +1 -1
- diffusers/pipelines/pipeline_flax_utils.py +41 -4
- diffusers/pipelines/pipeline_utils.py +60 -16
- diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py +2 -2
- diffusers/pipelines/stable_diffusion/__init__.py +1 -0
- diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +81 -37
- diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py +12 -5
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_gligen.py +832 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_k_diffusion.py +9 -2
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py +17 -8
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_model_editing.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_pix2pix_zero.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_sag.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +10 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +10 -3
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +3 -5
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +75 -3
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +76 -6
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +1 -2
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +10 -3
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +10 -3
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +11 -4
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +1 -1
- diffusers/pipelines/versatile_diffusion/modeling_text_unet.py +131 -28
- diffusers/schedulers/scheduling_consistency_models.py +70 -57
- diffusers/schedulers/scheduling_ddim.py +76 -71
- diffusers/schedulers/scheduling_ddim_inverse.py +76 -44
- diffusers/schedulers/scheduling_ddim_parallel.py +11 -8
- diffusers/schedulers/scheduling_ddpm.py +68 -67
- diffusers/schedulers/scheduling_ddpm_parallel.py +18 -15
- diffusers/schedulers/scheduling_deis_multistep.py +93 -85
- diffusers/schedulers/scheduling_dpmsolver_multistep.py +118 -120
- diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +116 -109
- diffusers/schedulers/scheduling_dpmsolver_sde.py +57 -43
- diffusers/schedulers/scheduling_dpmsolver_singlestep.py +122 -121
- diffusers/schedulers/scheduling_euler_ancestral_discrete.py +54 -44
- diffusers/schedulers/scheduling_euler_discrete.py +63 -56
- diffusers/schedulers/scheduling_heun_discrete.py +57 -45
- diffusers/schedulers/scheduling_ipndm.py +27 -22
- diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +54 -41
- diffusers/schedulers/scheduling_k_dpm_2_discrete.py +52 -41
- diffusers/schedulers/scheduling_karras_ve.py +55 -45
- diffusers/schedulers/scheduling_lms_discrete.py +58 -52
- diffusers/schedulers/scheduling_pndm.py +77 -62
- diffusers/schedulers/scheduling_repaint.py +56 -38
- diffusers/schedulers/scheduling_sde_ve.py +62 -50
- diffusers/schedulers/scheduling_sde_vp.py +32 -11
- diffusers/schedulers/scheduling_unclip.py +3 -3
- diffusers/schedulers/scheduling_unipc_multistep.py +131 -91
- diffusers/schedulers/scheduling_utils.py +41 -35
- diffusers/schedulers/scheduling_utils_flax.py +8 -2
- diffusers/schedulers/scheduling_vq_diffusion.py +39 -68
- diffusers/utils/__init__.py +2 -2
- diffusers/utils/dummy_pt_objects.py +15 -0
- diffusers/utils/dummy_torch_and_transformers_objects.py +15 -0
- diffusers/utils/hub_utils.py +105 -2
- diffusers/utils/import_utils.py +0 -4
- diffusers/utils/pil_utils.py +19 -0
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/METADATA +5 -7
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/RECORD +113 -112
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/WHEEL +1 -1
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/entry_points.txt +0 -1
- diffusers/models/cross_attention.py +0 -94
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/LICENSE +0 -0
- {diffusers-0.19.3.dist-info → diffusers-0.20.1.dist-info}/top_level.txt +0 -0
@@ -335,7 +335,14 @@ class StableDiffusionAttendAndExcitePipeline(DiffusionPipeline, TextualInversion
|
|
335
335
|
)
|
336
336
|
prompt_embeds = prompt_embeds[0]
|
337
337
|
|
338
|
-
|
338
|
+
if self.text_encoder is not None:
|
339
|
+
prompt_embeds_dtype = self.text_encoder.dtype
|
340
|
+
elif self.unet is not None:
|
341
|
+
prompt_embeds_dtype = self.unet.dtype
|
342
|
+
else:
|
343
|
+
prompt_embeds_dtype = prompt_embeds.dtype
|
344
|
+
|
345
|
+
prompt_embeds = prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
339
346
|
|
340
347
|
bs_embed, seq_len, _ = prompt_embeds.shape
|
341
348
|
# duplicate text embeddings for each generation per prompt, using mps friendly method
|
@@ -391,7 +398,7 @@ class StableDiffusionAttendAndExcitePipeline(DiffusionPipeline, TextualInversion
|
|
391
398
|
# duplicate unconditional embeddings for each generation per prompt, using mps friendly method
|
392
399
|
seq_len = negative_prompt_embeds.shape[1]
|
393
400
|
|
394
|
-
negative_prompt_embeds = negative_prompt_embeds.to(dtype=
|
401
|
+
negative_prompt_embeds = negative_prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
395
402
|
|
396
403
|
negative_prompt_embeds = negative_prompt_embeds.repeat(1, num_images_per_prompt, 1)
|
397
404
|
negative_prompt_embeds = negative_prompt_embeds.view(batch_size * num_images_per_prompt, seq_len, -1)
|
@@ -750,7 +757,7 @@ class StableDiffusionAttendAndExcitePipeline(DiffusionPipeline, TextualInversion
|
|
750
757
|
every step.
|
751
758
|
cross_attention_kwargs (`dict`, *optional*):
|
752
759
|
A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
|
753
|
-
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/
|
760
|
+
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
|
754
761
|
max_iter_to_alter (`int`, *optional*, defaults to `25`):
|
755
762
|
Number of denoising steps to apply attend-and-excite. The `max_iter_to_alter` denoising steps are when
|
756
763
|
attend-and-excite is applied. For example, if `max_iter_to_alter` is `25` and there are a total of `30`
|
@@ -220,7 +220,14 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline, TextualInversionLoader
|
|
220
220
|
)
|
221
221
|
prompt_embeds = prompt_embeds[0]
|
222
222
|
|
223
|
-
|
223
|
+
if self.text_encoder is not None:
|
224
|
+
prompt_embeds_dtype = self.text_encoder.dtype
|
225
|
+
elif self.unet is not None:
|
226
|
+
prompt_embeds_dtype = self.unet.dtype
|
227
|
+
else:
|
228
|
+
prompt_embeds_dtype = prompt_embeds.dtype
|
229
|
+
|
230
|
+
prompt_embeds = prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
224
231
|
|
225
232
|
bs_embed, seq_len, _ = prompt_embeds.shape
|
226
233
|
# duplicate text embeddings for each generation per prompt, using mps friendly method
|
@@ -276,7 +283,7 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline, TextualInversionLoader
|
|
276
283
|
# duplicate unconditional embeddings for each generation per prompt, using mps friendly method
|
277
284
|
seq_len = negative_prompt_embeds.shape[1]
|
278
285
|
|
279
|
-
negative_prompt_embeds = negative_prompt_embeds.to(dtype=
|
286
|
+
negative_prompt_embeds = negative_prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
280
287
|
|
281
288
|
negative_prompt_embeds = negative_prompt_embeds.repeat(1, num_images_per_prompt, 1)
|
282
289
|
negative_prompt_embeds = negative_prompt_embeds.view(batch_size * num_images_per_prompt, seq_len, -1)
|
@@ -570,7 +577,7 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline, TextualInversionLoader
|
|
570
577
|
every step.
|
571
578
|
cross_attention_kwargs (`dict`, *optional*):
|
572
579
|
A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
|
573
|
-
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/
|
580
|
+
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
|
574
581
|
|
575
582
|
Examples:
|
576
583
|
|
@@ -521,7 +521,14 @@ class StableDiffusionDiffEditPipeline(DiffusionPipeline, TextualInversionLoaderM
|
|
521
521
|
)
|
522
522
|
prompt_embeds = prompt_embeds[0]
|
523
523
|
|
524
|
-
|
524
|
+
if self.text_encoder is not None:
|
525
|
+
prompt_embeds_dtype = self.text_encoder.dtype
|
526
|
+
elif self.unet is not None:
|
527
|
+
prompt_embeds_dtype = self.unet.dtype
|
528
|
+
else:
|
529
|
+
prompt_embeds_dtype = prompt_embeds.dtype
|
530
|
+
|
531
|
+
prompt_embeds = prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
525
532
|
|
526
533
|
bs_embed, seq_len, _ = prompt_embeds.shape
|
527
534
|
# duplicate text embeddings for each generation per prompt, using mps friendly method
|
@@ -577,7 +584,7 @@ class StableDiffusionDiffEditPipeline(DiffusionPipeline, TextualInversionLoaderM
|
|
577
584
|
# duplicate unconditional embeddings for each generation per prompt, using mps friendly method
|
578
585
|
seq_len = negative_prompt_embeds.shape[1]
|
579
586
|
|
580
|
-
negative_prompt_embeds = negative_prompt_embeds.to(dtype=
|
587
|
+
negative_prompt_embeds = negative_prompt_embeds.to(dtype=prompt_embeds_dtype, device=device)
|
581
588
|
|
582
589
|
negative_prompt_embeds = negative_prompt_embeds.repeat(1, num_images_per_prompt, 1)
|
583
590
|
negative_prompt_embeds = negative_prompt_embeds.view(batch_size * num_images_per_prompt, seq_len, -1)
|
@@ -902,7 +909,7 @@ class StableDiffusionDiffEditPipeline(DiffusionPipeline, TextualInversionLoaderM
|
|
902
909
|
The output format of the generated image. Choose between `PIL.Image` or `np.array`.
|
903
910
|
cross_attention_kwargs (`dict`, *optional*):
|
904
911
|
A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
|
905
|
-
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/
|
912
|
+
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
|
906
913
|
|
907
914
|
Examples:
|
908
915
|
|
@@ -1110,7 +1117,7 @@ class StableDiffusionDiffEditPipeline(DiffusionPipeline, TextualInversionLoaderM
|
|
1110
1117
|
every step.
|
1111
1118
|
cross_attention_kwargs (`dict`, *optional*):
|
1112
1119
|
A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
|
1113
|
-
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/
|
1120
|
+
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
|
1114
1121
|
lambda_auto_corr (`float`, *optional*, defaults to 20.0):
|
1115
1122
|
Lambda parameter to control auto correction.
|
1116
1123
|
lambda_kl (`float`, *optional*, defaults to 20.0):
|
@@ -1352,7 +1359,7 @@ class StableDiffusionDiffEditPipeline(DiffusionPipeline, TextualInversionLoaderM
|
|
1352
1359
|
every step.
|
1353
1360
|
cross_attention_kwargs (`dict`, *optional*):
|
1354
1361
|
A kwargs dictionary that if specified is passed along to the [`AttentionProcessor`] as defined in
|
1355
|
-
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/
|
1362
|
+
[`self.processor`](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py).
|
1356
1363
|
|
1357
1364
|
Examples:
|
1358
1365
|
|