diffusers 0.26.2__tar.gz → 0.27.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (408) hide show
  1. {diffusers-0.26.2/src/diffusers.egg-info → diffusers-0.27.0}/PKG-INFO +1 -1
  2. {diffusers-0.26.2 → diffusers-0.27.0}/setup.py +4 -4
  3. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/__init__.py +20 -1
  4. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/commands/__init__.py +1 -1
  5. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/commands/diffusers_cli.py +1 -1
  6. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/commands/env.py +1 -1
  7. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/commands/fp16_safetensors.py +1 -1
  8. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/configuration_utils.py +7 -3
  9. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/dependency_versions_check.py +1 -1
  10. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/dependency_versions_table.py +2 -2
  11. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/experimental/rl/value_guided_sampling.py +1 -1
  12. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/image_processor.py +110 -4
  13. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/autoencoder.py +28 -8
  14. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/controlnet.py +17 -8
  15. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/ip_adapter.py +86 -23
  16. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/lora.py +105 -310
  17. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/lora_conversion_utils.py +1 -1
  18. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/peft.py +1 -1
  19. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/single_file.py +51 -12
  20. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/single_file_utils.py +278 -49
  21. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/textual_inversion.py +23 -4
  22. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/unet.py +195 -41
  23. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/utils.py +1 -1
  24. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/__init__.py +3 -1
  25. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/activations.py +9 -9
  26. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/attention.py +26 -36
  27. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/attention_flax.py +1 -1
  28. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/attention_processor.py +171 -114
  29. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/autoencoder_asym_kl.py +1 -1
  30. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/autoencoder_kl.py +3 -1
  31. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py +1 -1
  32. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/autoencoder_tiny.py +4 -2
  33. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/consistency_decoder_vae.py +1 -1
  34. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/vae.py +1 -1
  35. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/controlnet.py +1 -1
  36. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/controlnet_flax.py +1 -1
  37. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/downsampling.py +8 -12
  38. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/dual_transformer_2d.py +1 -1
  39. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/embeddings.py +3 -4
  40. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/embeddings_flax.py +1 -1
  41. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/lora.py +33 -10
  42. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/modeling_flax_pytorch_utils.py +1 -1
  43. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/modeling_flax_utils.py +1 -1
  44. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/modeling_pytorch_flax_utils.py +1 -1
  45. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/modeling_utils.py +4 -6
  46. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/normalization.py +1 -1
  47. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/resnet.py +31 -58
  48. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/resnet_flax.py +1 -1
  49. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/t5_film_transformer.py +1 -1
  50. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformer_2d.py +1 -1
  51. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformer_temporal.py +1 -1
  52. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/dual_transformer_2d.py +1 -1
  53. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/t5_film_transformer.py +1 -1
  54. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/transformer_2d.py +29 -31
  55. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/transformer_temporal.py +1 -1
  56. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unet_1d.py +1 -1
  57. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unet_1d_blocks.py +1 -1
  58. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unet_2d.py +1 -1
  59. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unet_2d_blocks.py +1 -1
  60. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unet_2d_condition.py +1 -1
  61. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/__init__.py +1 -0
  62. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_1d.py +1 -1
  63. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_1d_blocks.py +1 -1
  64. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_2d.py +4 -4
  65. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_2d_blocks.py +238 -98
  66. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_2d_blocks_flax.py +1 -1
  67. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_2d_condition.py +420 -323
  68. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_2d_condition_flax.py +21 -12
  69. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_3d_blocks.py +50 -40
  70. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_3d_condition.py +47 -8
  71. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_i2vgen_xl.py +75 -30
  72. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_kandinsky3.py +1 -1
  73. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_motion_model.py +48 -8
  74. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/unet_spatio_temporal_condition.py +1 -1
  75. diffusers-0.27.0/src/diffusers/models/unets/unet_stable_cascade.py +610 -0
  76. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/unets/uvit_2d.py +1 -1
  77. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/upsampling.py +10 -16
  78. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/vae_flax.py +1 -1
  79. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/vq_model.py +1 -1
  80. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/optimization.py +1 -1
  81. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/__init__.py +26 -0
  82. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/amused/pipeline_amused.py +1 -1
  83. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/amused/pipeline_amused_img2img.py +1 -1
  84. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/amused/pipeline_amused_inpaint.py +1 -1
  85. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/animatediff/pipeline_animatediff.py +162 -417
  86. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py +165 -137
  87. diffusers-0.27.0/src/diffusers/pipelines/animatediff/pipeline_output.py +23 -0
  88. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/audioldm/pipeline_audioldm.py +3 -19
  89. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/audioldm2/modeling_audioldm2.py +1 -1
  90. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py +3 -3
  91. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/auto_pipeline.py +7 -16
  92. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/blip_diffusion/blip_image_processing.py +1 -1
  93. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/blip_diffusion/modeling_blip2.py +1 -1
  94. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/blip_diffusion/modeling_ctx_clip.py +2 -2
  95. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/blip_diffusion/pipeline_blip_diffusion.py +2 -2
  96. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py +1 -1
  97. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet.py +90 -90
  98. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py +2 -2
  99. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +98 -90
  100. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +92 -90
  101. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +145 -70
  102. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +126 -89
  103. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +108 -96
  104. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py +2 -2
  105. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py +1 -1
  106. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/ddim/pipeline_ddim.py +1 -1
  107. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/ddpm/pipeline_ddpm.py +1 -1
  108. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if.py +4 -4
  109. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +4 -4
  110. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +5 -5
  111. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +4 -4
  112. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +5 -5
  113. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +5 -5
  114. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py +10 -120
  115. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py +10 -91
  116. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/audio_diffusion/mel.py +1 -1
  117. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/audio_diffusion/pipeline_audio_diffusion.py +1 -1
  118. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py +1 -1
  119. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/pndm/pipeline_pndm.py +1 -1
  120. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/repaint/pipeline_repaint.py +1 -1
  121. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/score_sde_ve/pipeline_score_sde_ve.py +1 -1
  122. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/spectrogram_diffusion/continuous_encoder.py +1 -1
  123. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/spectrogram_diffusion/midi_utils.py +1 -1
  124. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/spectrogram_diffusion/notes_encoder.py +1 -1
  125. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py +1 -1
  126. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_cycle_diffusion.py +5 -4
  127. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py +5 -4
  128. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_model_editing.py +7 -22
  129. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py +5 -39
  130. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py +5 -5
  131. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stochastic_karras_ve/pipeline_stochastic_karras_ve.py +1 -1
  132. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py +31 -22
  133. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py +1 -1
  134. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py +1 -1
  135. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py +1 -2
  136. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/vq_diffusion/pipeline_vq_diffusion.py +1 -1
  137. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/dit/pipeline_dit.py +1 -1
  138. diffusers-0.27.0/src/diffusers/pipelines/free_init_utils.py +184 -0
  139. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/i2vgen_xl/pipeline_i2vgen_xl.py +22 -104
  140. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py +1 -1
  141. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py +1 -1
  142. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py +1 -1
  143. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py +2 -2
  144. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py +1 -1
  145. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py +1 -1
  146. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py +1 -1
  147. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py +1 -1
  148. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py +1 -1
  149. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py +1 -1
  150. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py +2 -2
  151. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +104 -93
  152. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +112 -74
  153. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py +1 -1
  154. diffusers-0.27.0/src/diffusers/pipelines/ledits_pp/__init__.py +55 -0
  155. diffusers-0.27.0/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py +1505 -0
  156. diffusers-0.27.0/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py +1797 -0
  157. diffusers-0.27.0/src/diffusers/pipelines/ledits_pp/pipeline_output.py +43 -0
  158. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/musicldm/pipeline_musicldm.py +3 -19
  159. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/onnx_utils.py +1 -1
  160. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/paint_by_example/image_encoder.py +1 -1
  161. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py +3 -3
  162. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pia/pipeline_pia.py +168 -327
  163. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pipeline_flax_utils.py +1 -1
  164. diffusers-0.27.0/src/diffusers/pipelines/pipeline_loading_utils.py +508 -0
  165. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pipeline_utils.py +188 -534
  166. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py +56 -10
  167. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py +3 -3
  168. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/shap_e/camera.py +1 -1
  169. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/shap_e/pipeline_shap_e.py +1 -1
  170. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +1 -1
  171. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/shap_e/renderer.py +1 -1
  172. diffusers-0.27.0/src/diffusers/pipelines/stable_cascade/__init__.py +50 -0
  173. diffusers-0.27.0/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py +482 -0
  174. diffusers-0.27.0/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py +311 -0
  175. diffusers-0.27.0/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py +638 -0
  176. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/clip_image_project_model.py +1 -1
  177. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +4 -1
  178. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py +1 -1
  179. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py +2 -2
  180. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py +1 -1
  181. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py +1 -1
  182. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py +1 -1
  183. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py +1 -1
  184. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_upscale.py +1 -1
  185. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +90 -146
  186. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +5 -4
  187. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py +4 -32
  188. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +92 -119
  189. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +92 -119
  190. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +13 -59
  191. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py +3 -31
  192. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +5 -33
  193. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +5 -21
  194. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +7 -21
  195. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/safety_checker.py +1 -1
  196. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/safety_checker_flax.py +1 -1
  197. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/stable_unclip_image_normalizer.py +1 -1
  198. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py +5 -21
  199. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py +9 -38
  200. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py +5 -34
  201. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py +6 -35
  202. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py +7 -6
  203. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py +4 -124
  204. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_ldm3d/pipeline_stable_diffusion_ldm3d.py +282 -80
  205. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py +94 -46
  206. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py +3 -3
  207. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_safe/safety_checker.py +1 -1
  208. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_sag/pipeline_stable_diffusion_sag.py +6 -22
  209. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py +1 -1
  210. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +96 -148
  211. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +98 -154
  212. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +98 -153
  213. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +25 -87
  214. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py +89 -80
  215. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +5 -49
  216. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +80 -88
  217. diffusers-0.27.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py +25 -0
  218. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +15 -86
  219. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +20 -93
  220. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +5 -5
  221. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +3 -19
  222. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unclip/pipeline_unclip.py +1 -1
  223. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unclip/pipeline_unclip_image_variation.py +1 -1
  224. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unclip/text_proj.py +1 -1
  225. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py +35 -35
  226. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py +1 -1
  227. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_common.py +4 -21
  228. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_diffnext.py +2 -2
  229. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_prior.py +4 -5
  230. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen.py +8 -8
  231. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_combined.py +1 -1
  232. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py +2 -2
  233. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/__init__.py +7 -1
  234. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/deprecated/scheduling_karras_ve.py +1 -1
  235. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py +1 -1
  236. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_consistency_models.py +42 -19
  237. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddim.py +2 -4
  238. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddim_flax.py +13 -5
  239. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddim_inverse.py +2 -4
  240. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddim_parallel.py +2 -4
  241. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddpm.py +2 -4
  242. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddpm_flax.py +1 -1
  243. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddpm_parallel.py +2 -4
  244. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py +1 -1
  245. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_deis_multistep.py +46 -19
  246. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py +107 -21
  247. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_dpmsolver_multistep_flax.py +1 -1
  248. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +9 -7
  249. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_dpmsolver_sde.py +35 -35
  250. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py +52 -21
  251. diffusers-0.27.0/src/diffusers/schedulers/scheduling_edm_dpmsolver_multistep.py +683 -0
  252. diffusers-0.27.0/src/diffusers/schedulers/scheduling_edm_euler.py +381 -0
  253. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py +43 -15
  254. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_euler_discrete.py +42 -17
  255. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_euler_discrete_flax.py +1 -1
  256. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_heun_discrete.py +35 -35
  257. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_ipndm.py +37 -11
  258. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +44 -44
  259. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_k_dpm_2_discrete.py +44 -44
  260. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_karras_ve_flax.py +1 -1
  261. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_lcm.py +38 -14
  262. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_lms_discrete.py +43 -15
  263. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_lms_discrete_flax.py +1 -1
  264. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_pndm.py +2 -4
  265. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_pndm_flax.py +2 -4
  266. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_repaint.py +1 -1
  267. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_sasolver.py +41 -9
  268. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_sde_ve.py +1 -1
  269. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_sde_ve_flax.py +1 -1
  270. diffusers-0.27.0/src/diffusers/schedulers/scheduling_tcd.py +686 -0
  271. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_unclip.py +1 -1
  272. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_unipc_multistep.py +46 -19
  273. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_utils.py +2 -1
  274. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_utils_flax.py +1 -1
  275. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_vq_diffusion.py +1 -1
  276. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/training_utils.py +9 -2
  277. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/__init__.py +2 -1
  278. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/accelerate_utils.py +1 -1
  279. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/constants.py +1 -1
  280. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/doc_utils.py +1 -1
  281. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_pt_objects.py +60 -0
  282. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_transformers_objects.py +75 -0
  283. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dynamic_modules_utils.py +1 -1
  284. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/export_utils.py +3 -3
  285. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/hub_utils.py +60 -16
  286. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/import_utils.py +15 -1
  287. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/loading_utils.py +2 -0
  288. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/logging.py +1 -1
  289. diffusers-0.27.0/src/diffusers/utils/model_card_template.md +24 -0
  290. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/outputs.py +14 -7
  291. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/peft_utils.py +1 -1
  292. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/state_dict_utils.py +1 -1
  293. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/testing_utils.py +2 -0
  294. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/torch_utils.py +1 -1
  295. {diffusers-0.26.2 → diffusers-0.27.0/src/diffusers.egg-info}/PKG-INFO +1 -1
  296. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers.egg-info/SOURCES.txt +15 -0
  297. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers.egg-info/requires.txt +4 -4
  298. diffusers-0.26.2/src/diffusers/pipelines/animatediff/pipeline_output.py +0 -22
  299. diffusers-0.26.2/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py +0 -23
  300. {diffusers-0.26.2 → diffusers-0.27.0}/LICENSE +0 -0
  301. {diffusers-0.26.2 → diffusers-0.27.0}/MANIFEST.in +0 -0
  302. {diffusers-0.26.2 → diffusers-0.27.0}/README.md +0 -0
  303. {diffusers-0.26.2 → diffusers-0.27.0}/pyproject.toml +0 -0
  304. {diffusers-0.26.2 → diffusers-0.27.0}/setup.cfg +0 -0
  305. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/experimental/__init__.py +0 -0
  306. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/experimental/rl/__init__.py +0 -0
  307. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/loaders/__init__.py +0 -0
  308. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/adapter.py +0 -0
  309. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/autoencoders/__init__.py +0 -0
  310. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/modeling_outputs.py +0 -0
  311. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/prior_transformer.py +0 -0
  312. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/__init__.py +0 -0
  313. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/models/transformers/prior_transformer.py +0 -0
  314. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/amused/__init__.py +0 -0
  315. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/animatediff/__init__.py +0 -0
  316. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/audioldm/__init__.py +0 -0
  317. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/audioldm2/__init__.py +0 -0
  318. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/blip_diffusion/__init__.py +0 -0
  319. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/consistency_models/__init__.py +0 -0
  320. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/__init__.py +0 -0
  321. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/controlnet/multicontrolnet.py +0 -0
  322. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/dance_diffusion/__init__.py +0 -0
  323. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/ddim/__init__.py +0 -0
  324. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/ddpm/__init__.py +0 -0
  325. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/__init__.py +0 -0
  326. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/pipeline_output.py +0 -0
  327. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/safety_checker.py +0 -0
  328. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/timesteps.py +0 -0
  329. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deepfloyd_if/watermark.py +0 -0
  330. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/__init__.py +0 -0
  331. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/alt_diffusion/__init__.py +0 -0
  332. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/alt_diffusion/modeling_roberta_series.py +0 -0
  333. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/alt_diffusion/pipeline_output.py +0 -0
  334. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/audio_diffusion/__init__.py +0 -0
  335. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/__init__.py +0 -0
  336. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/pndm/__init__.py +0 -0
  337. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/repaint/__init__.py +0 -0
  338. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/score_sde_ve/__init__.py +0 -0
  339. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/spectrogram_diffusion/__init__.py +0 -0
  340. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py +0 -0
  341. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py +0 -0
  342. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/stochastic_karras_ve/__init__.py +0 -0
  343. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/__init__.py +0 -0
  344. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py +0 -0
  345. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/deprecated/vq_diffusion/__init__.py +0 -0
  346. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/dit/__init__.py +0 -0
  347. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/i2vgen_xl/__init__.py +0 -0
  348. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/__init__.py +0 -0
  349. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky/text_encoder.py +0 -0
  350. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/__init__.py +0 -0
  351. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py +0 -0
  352. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py +0 -0
  353. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky3/__init__.py +0 -0
  354. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky3/convert_kandinsky3_unet.py +0 -0
  355. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py +0 -0
  356. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py +0 -0
  357. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_consistency_models/__init__.py +0 -0
  358. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_diffusion/__init__.py +0 -0
  359. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py +0 -0
  360. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/musicldm/__init__.py +0 -0
  361. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/paint_by_example/__init__.py +0 -0
  362. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pia/__init__.py +0 -0
  363. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/pixart_alpha/__init__.py +0 -0
  364. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/semantic_stable_diffusion/__init__.py +0 -0
  365. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_output.py +0 -0
  366. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/shap_e/__init__.py +0 -0
  367. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/__init__.py +0 -0
  368. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion/pipeline_output.py +0 -0
  369. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_attend_and_excite/__init__.py +0 -0
  370. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_diffedit/__init__.py +0 -0
  371. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_gligen/__init__.py +0 -0
  372. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py +0 -0
  373. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_ldm3d/__init__.py +0 -0
  374. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_panorama/__init__.py +0 -0
  375. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_safe/__init__.py +0 -0
  376. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_safe/pipeline_output.py +0 -0
  377. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_sag/__init__.py +0 -0
  378. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/__init__.py +0 -0
  379. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py +0 -0
  380. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_diffusion_xl/watermark.py +0 -0
  381. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/stable_video_diffusion/__init__.py +0 -0
  382. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/t2i_adapter/__init__.py +0 -0
  383. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/text_to_video_synthesis/__init__.py +0 -0
  384. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unclip/__init__.py +0 -0
  385. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unidiffuser/__init__.py +0 -0
  386. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unidiffuser/modeling_text_decoder.py +0 -0
  387. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/unidiffuser/modeling_uvit.py +0 -0
  388. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/pipelines/wuerstchen/__init__.py +0 -0
  389. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/py.typed +0 -0
  390. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/deprecated/__init__.py +0 -0
  391. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_amused.py +0 -0
  392. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/schedulers/scheduling_consistency_decoder.py +0 -0
  393. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/deprecation_utils.py +0 -0
  394. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_flax_and_transformers_objects.py +0 -0
  395. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_flax_objects.py +0 -0
  396. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_note_seq_objects.py +0 -0
  397. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_onnx_objects.py +0 -0
  398. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_librosa_objects.py +0 -0
  399. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_scipy_objects.py +0 -0
  400. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_torchsde_objects.py +0 -0
  401. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_transformers_and_k_diffusion_objects.py +0 -0
  402. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_torch_and_transformers_and_onnx_objects.py +0 -0
  403. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/dummy_transformers_and_torch_and_note_seq_objects.py +0 -0
  404. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/pil_utils.py +0 -0
  405. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers/utils/versions.py +0 -0
  406. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers.egg-info/dependency_links.txt +0 -0
  407. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers.egg-info/entry_points.txt +0 -0
  408. {diffusers-0.26.2 → diffusers-0.27.0}/src/diffusers.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffusers
3
- Version: 0.26.2
3
+ Version: 0.27.0
4
4
  Summary: State-of-the-art diffusion in PyTorch and JAX.
5
5
  Home-page: https://github.com/huggingface/diffusers
6
6
  Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -126,8 +126,8 @@ _deps = [
126
126
  "regex!=2019.12.17",
127
127
  "requests",
128
128
  "tensorboard",
129
- "torch>=1.4,<2.2.0",
130
- "torchvision<0.17",
129
+ "torch>=1.4",
130
+ "torchvision",
131
131
  "transformers>=4.25.1",
132
132
  "urllib3<=2.0.0",
133
133
  ]
@@ -249,7 +249,7 @@ version_range_max = max(sys.version_info[1], 10) + 1
249
249
 
250
250
  setup(
251
251
  name="diffusers",
252
- version="0.26.2", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
252
+ version="0.27.0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
253
253
  description="State-of-the-art diffusion in PyTorch and JAX.",
254
254
  long_description=open("README.md", "r", encoding="utf-8").read(),
255
255
  long_description_content_type="text/markdown",
@@ -1,4 +1,4 @@
1
- __version__ = "0.26.2"
1
+ __version__ = "0.27.0"
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -86,6 +86,7 @@ else:
86
86
  "MotionAdapter",
87
87
  "MultiAdapter",
88
88
  "PriorTransformer",
89
+ "StableCascadeUNet",
89
90
  "T2IAdapter",
90
91
  "T5FilmDecoder",
91
92
  "Transformer2DModel",
@@ -128,6 +129,7 @@ else:
128
129
  "PNDMPipeline",
129
130
  "RePaintPipeline",
130
131
  "ScoreSdeVePipeline",
132
+ "StableDiffusionMixin",
131
133
  ]
132
134
  )
133
135
  _import_structure["schedulers"].extend(
@@ -144,6 +146,8 @@ else:
144
146
  "DPMSolverMultistepInverseScheduler",
145
147
  "DPMSolverMultistepScheduler",
146
148
  "DPMSolverSinglestepScheduler",
149
+ "EDMDPMSolverMultistepScheduler",
150
+ "EDMEulerScheduler",
147
151
  "EulerAncestralDiscreteScheduler",
148
152
  "EulerDiscreteScheduler",
149
153
  "HeunDiscreteScheduler",
@@ -157,6 +161,7 @@ else:
157
161
  "SASolverScheduler",
158
162
  "SchedulerMixin",
159
163
  "ScoreSdeVeScheduler",
164
+ "TCDScheduler",
160
165
  "UnCLIPScheduler",
161
166
  "UniPCMultistepScheduler",
162
167
  "VQDiffusionScheduler",
@@ -248,6 +253,8 @@ else:
248
253
  "LatentConsistencyModelImg2ImgPipeline",
249
254
  "LatentConsistencyModelPipeline",
250
255
  "LDMTextToImagePipeline",
256
+ "LEditsPPPipelineStableDiffusion",
257
+ "LEditsPPPipelineStableDiffusionXL",
251
258
  "MusicLDMPipeline",
252
259
  "PaintByExamplePipeline",
253
260
  "PIAPipeline",
@@ -255,6 +262,9 @@ else:
255
262
  "SemanticStableDiffusionPipeline",
256
263
  "ShapEImg2ImgPipeline",
257
264
  "ShapEPipeline",
265
+ "StableCascadeCombinedPipeline",
266
+ "StableCascadeDecoderPipeline",
267
+ "StableCascadePriorPipeline",
258
268
  "StableDiffusionAdapterPipeline",
259
269
  "StableDiffusionAttendAndExcitePipeline",
260
270
  "StableDiffusionControlNetImg2ImgPipeline",
@@ -512,6 +522,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
512
522
  PNDMPipeline,
513
523
  RePaintPipeline,
514
524
  ScoreSdeVePipeline,
525
+ StableDiffusionMixin,
515
526
  )
516
527
  from .schedulers import (
517
528
  AmusedScheduler,
@@ -526,6 +537,8 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
526
537
  DPMSolverMultistepInverseScheduler,
527
538
  DPMSolverMultistepScheduler,
528
539
  DPMSolverSinglestepScheduler,
540
+ EDMDPMSolverMultistepScheduler,
541
+ EDMEulerScheduler,
529
542
  EulerAncestralDiscreteScheduler,
530
543
  EulerDiscreteScheduler,
531
544
  HeunDiscreteScheduler,
@@ -539,6 +552,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
539
552
  SASolverScheduler,
540
553
  SchedulerMixin,
541
554
  ScoreSdeVeScheduler,
555
+ TCDScheduler,
542
556
  UnCLIPScheduler,
543
557
  UniPCMultistepScheduler,
544
558
  VQDiffusionScheduler,
@@ -611,6 +625,8 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
611
625
  LatentConsistencyModelImg2ImgPipeline,
612
626
  LatentConsistencyModelPipeline,
613
627
  LDMTextToImagePipeline,
628
+ LEditsPPPipelineStableDiffusion,
629
+ LEditsPPPipelineStableDiffusionXL,
614
630
  MusicLDMPipeline,
615
631
  PaintByExamplePipeline,
616
632
  PIAPipeline,
@@ -618,6 +634,9 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
618
634
  SemanticStableDiffusionPipeline,
619
635
  ShapEImg2ImgPipeline,
620
636
  ShapEPipeline,
637
+ StableCascadeCombinedPipeline,
638
+ StableCascadeDecoderPipeline,
639
+ StableCascadePriorPipeline,
621
640
  StableDiffusionAdapterPipeline,
622
641
  StableDiffusionAttendAndExcitePipeline,
623
642
  StableDiffusionControlNetImg2ImgPipeline,
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python
2
- # Copyright 2023 The HuggingFace Team. All rights reserved.
2
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  # coding=utf-8
2
- # Copyright 2023 The HuggingFace Inc. team.
2
+ # Copyright 2024 The HuggingFace Inc. team.
3
3
  # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -127,7 +127,7 @@ class ConfigMixin:
127
127
  """The only reason we overwrite `getattr` here is to gracefully deprecate accessing
128
128
  config attributes directly. See https://github.com/huggingface/diffusers/pull/3129
129
129
 
130
- Tihs funtion is mostly copied from PyTorch's __getattr__ overwrite:
130
+ This function is mostly copied from PyTorch's __getattr__ overwrite:
131
131
  https://pytorch.org/docs/stable/_modules/torch/nn/modules/module.html#Module
132
132
  """
133
133
 
@@ -259,6 +259,10 @@ class ConfigMixin:
259
259
  model = cls(**init_dict)
260
260
 
261
261
  # make sure to also save config parameters that might be used for compatible classes
262
+ # update _class_name
263
+ if "_class_name" in hidden_dict:
264
+ hidden_dict["_class_name"] = cls.__name__
265
+
262
266
  model.register_to_config(**hidden_dict)
263
267
 
264
268
  # add hidden kwargs of compatible classes to unused_kwargs
@@ -529,7 +533,7 @@ class ConfigMixin:
529
533
  f"{cls.config_name} configuration file."
530
534
  )
531
535
 
532
- # 5. Give nice info if config attributes are initiliazed to default because they have not been passed
536
+ # 5. Give nice info if config attributes are initialized to default because they have not been passed
533
537
  passed_keys = set(init_dict.keys())
534
538
  if len(expected_keys - passed_keys) > 0:
535
539
  logger.info(
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -38,8 +38,8 @@ deps = {
38
38
  "regex": "regex!=2019.12.17",
39
39
  "requests": "requests",
40
40
  "tensorboard": "tensorboard",
41
- "torch": "torch>=1.4,<2.2.0",
42
- "torchvision": "torchvision<0.17",
41
+ "torch": "torch>=1.4",
42
+ "torchvision": "torchvision",
43
43
  "transformers": "transformers>=4.25.1",
44
44
  "urllib3": "urllib3<=2.0.0",
45
45
  }
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -12,12 +12,14 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import math
15
16
  import warnings
16
17
  from typing import List, Optional, Tuple, Union
17
18
 
18
19
  import numpy as np
19
20
  import PIL.Image
20
21
  import torch
22
+ import torch.nn.functional as F
21
23
  from PIL import Image, ImageFilter, ImageOps
22
24
 
23
25
  from .configuration_utils import ConfigMixin, register_to_config
@@ -330,7 +332,7 @@ class VaeImageProcessor(ConfigMixin):
330
332
  image: Union[PIL.Image.Image, np.ndarray, torch.Tensor],
331
333
  height: int,
332
334
  width: int,
333
- resize_mode: str = "default", # "defalt", "fill", "crop"
335
+ resize_mode: str = "default", # "default", "fill", "crop"
334
336
  ) -> Union[PIL.Image.Image, np.ndarray, torch.Tensor]:
335
337
  """
336
338
  Resize image.
@@ -446,7 +448,7 @@ class VaeImageProcessor(ConfigMixin):
446
448
  image: PipelineImageInput,
447
449
  height: Optional[int] = None,
448
450
  width: Optional[int] = None,
449
- resize_mode: str = "default", # "defalt", "fill", "crop"
451
+ resize_mode: str = "default", # "default", "fill", "crop"
450
452
  crops_coords: Optional[Tuple[int, int, int, int]] = None,
451
453
  ) -> torch.Tensor:
452
454
  """
@@ -477,7 +479,7 @@ class VaeImageProcessor(ConfigMixin):
477
479
  if isinstance(image, torch.Tensor):
478
480
  # if image is a pytorch tensor could have 2 possible shapes:
479
481
  # 1. batch x height x width: we should insert the channel dimension at position 1
480
- # 2. channnel x height x width: we should insert batch dimension at position 0,
482
+ # 2. channel x height x width: we should insert batch dimension at position 0,
481
483
  # however, since both channel and batch dimension has same size 1, it is same to insert at position 1
482
484
  # for simplicity, we insert a dimension of size 1 at position 1 for both cases
483
485
  image = image.unsqueeze(1)
@@ -882,3 +884,107 @@ class VaeImageProcessorLDM3D(VaeImageProcessor):
882
884
  depth = self.binarize(depth)
883
885
 
884
886
  return rgb, depth
887
+
888
+
889
+ class IPAdapterMaskProcessor(VaeImageProcessor):
890
+ """
891
+ Image processor for IP Adapter image masks.
892
+
893
+ Args:
894
+ do_resize (`bool`, *optional*, defaults to `True`):
895
+ Whether to downscale the image's (height, width) dimensions to multiples of `vae_scale_factor`.
896
+ vae_scale_factor (`int`, *optional*, defaults to `8`):
897
+ VAE scale factor. If `do_resize` is `True`, the image is automatically resized to multiples of this factor.
898
+ resample (`str`, *optional*, defaults to `lanczos`):
899
+ Resampling filter to use when resizing the image.
900
+ do_normalize (`bool`, *optional*, defaults to `False`):
901
+ Whether to normalize the image to [-1,1].
902
+ do_binarize (`bool`, *optional*, defaults to `True`):
903
+ Whether to binarize the image to 0/1.
904
+ do_convert_grayscale (`bool`, *optional*, defaults to be `True`):
905
+ Whether to convert the images to grayscale format.
906
+
907
+ """
908
+
909
+ config_name = CONFIG_NAME
910
+
911
+ @register_to_config
912
+ def __init__(
913
+ self,
914
+ do_resize: bool = True,
915
+ vae_scale_factor: int = 8,
916
+ resample: str = "lanczos",
917
+ do_normalize: bool = False,
918
+ do_binarize: bool = True,
919
+ do_convert_grayscale: bool = True,
920
+ ):
921
+ super().__init__(
922
+ do_resize=do_resize,
923
+ vae_scale_factor=vae_scale_factor,
924
+ resample=resample,
925
+ do_normalize=do_normalize,
926
+ do_binarize=do_binarize,
927
+ do_convert_grayscale=do_convert_grayscale,
928
+ )
929
+
930
+ @staticmethod
931
+ def downsample(mask: torch.FloatTensor, batch_size: int, num_queries: int, value_embed_dim: int):
932
+ """
933
+ Downsamples the provided mask tensor to match the expected dimensions for scaled dot-product attention.
934
+ If the aspect ratio of the mask does not match the aspect ratio of the output image, a warning is issued.
935
+
936
+ Args:
937
+ mask (`torch.FloatTensor`):
938
+ The input mask tensor generated with `IPAdapterMaskProcessor.preprocess()`.
939
+ batch_size (`int`):
940
+ The batch size.
941
+ num_queries (`int`):
942
+ The number of queries.
943
+ value_embed_dim (`int`):
944
+ The dimensionality of the value embeddings.
945
+
946
+ Returns:
947
+ `torch.FloatTensor`:
948
+ The downsampled mask tensor.
949
+
950
+ """
951
+ o_h = mask.shape[1]
952
+ o_w = mask.shape[2]
953
+ ratio = o_w / o_h
954
+ mask_h = int(math.sqrt(num_queries / ratio))
955
+ mask_h = int(mask_h) + int((num_queries % int(mask_h)) != 0)
956
+ mask_w = num_queries // mask_h
957
+
958
+ mask_downsample = F.interpolate(mask.unsqueeze(0), size=(mask_h, mask_w), mode="bicubic").squeeze(0)
959
+
960
+ # Repeat batch_size times
961
+ if mask_downsample.shape[0] < batch_size:
962
+ mask_downsample = mask_downsample.repeat(batch_size, 1, 1)
963
+
964
+ mask_downsample = mask_downsample.view(mask_downsample.shape[0], -1)
965
+
966
+ downsampled_area = mask_h * mask_w
967
+ # If the output image and the mask do not have the same aspect ratio, tensor shapes will not match
968
+ # Pad tensor if downsampled_mask.shape[1] is smaller than num_queries
969
+ if downsampled_area < num_queries:
970
+ warnings.warn(
971
+ "The aspect ratio of the mask does not match the aspect ratio of the output image. "
972
+ "Please update your masks or adjust the output size for optimal performance.",
973
+ UserWarning,
974
+ )
975
+ mask_downsample = F.pad(mask_downsample, (0, num_queries - mask_downsample.shape[1]), value=0.0)
976
+ # Discard last embeddings if downsampled_mask.shape[1] is bigger than num_queries
977
+ if downsampled_area > num_queries:
978
+ warnings.warn(
979
+ "The aspect ratio of the mask does not match the aspect ratio of the output image. "
980
+ "Please update your masks or adjust the output size for optimal performance.",
981
+ UserWarning,
982
+ )
983
+ mask_downsample = mask_downsample[:, :num_queries]
984
+
985
+ # Repeat last dimension to match SDPA output shape
986
+ mask_downsample = mask_downsample.view(mask_downsample.shape[0], mask_downsample.shape[1], 1).repeat(
987
+ 1, 1, value_embed_dim
988
+ )
989
+
990
+ return mask_downsample
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -38,6 +38,9 @@ class FromOriginalVAEMixin:
38
38
  - A link to the `.ckpt` file (for example
39
39
  `"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"`) on the Hub.
40
40
  - A path to a *file* containing all pipeline weights.
41
+ config_file (`str`, *optional*):
42
+ Filepath to the configuration YAML file associated with the model. If not provided it will default to:
43
+ https://raw.githubusercontent.com/CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml
41
44
  torch_dtype (`str` or `torch.dtype`, *optional*):
42
45
  Override the default `torch.dtype` and load the model with another dtype. If `"auto"` is passed, the
43
46
  dtype is automatically derived from the model's weights.
@@ -65,10 +68,13 @@ class FromOriginalVAEMixin:
65
68
  image_size (`int`, *optional*, defaults to 512):
66
69
  The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
67
70
  Diffusion v2 base model. Use 768 for Stable Diffusion v2.
68
- use_safetensors (`bool`, *optional*, defaults to `None`):
69
- If set to `None`, the safetensors weights are downloaded if they're available **and** if the
70
- safetensors library is installed. If set to `True`, the model is forcibly loaded from safetensors
71
- weights. If set to `False`, safetensors weights are not loaded.
71
+ scaling_factor (`float`, *optional*, defaults to 0.18215):
72
+ The component-wise standard deviation of the trained latent space computed using the first batch of the
73
+ training set. This is used to scale the latent space to have unit variance when training the diffusion
74
+ model. The latents are scaled with the formula `z = z * scaling_factor` before being passed to the
75
+ diffusion model. When decoding, the latents are scaled back to the original scale with the formula: `z
76
+ = 1 / scaling_factor * z`. For more details, refer to sections 4.3.2 and D.1 of the [High-Resolution
77
+ Image Synthesis with Latent Diffusion Models](https://arxiv.org/abs/2112.10752) paper.
72
78
  kwargs (remaining dictionary of keyword arguments, *optional*):
73
79
  Can be used to overwrite load and saveable variables (for example the pipeline components of the
74
80
  specific pipeline class). The overwritten components are directly passed to the pipelines `__init__`
@@ -92,6 +98,7 @@ class FromOriginalVAEMixin:
92
98
  """
93
99
 
94
100
  original_config_file = kwargs.pop("original_config_file", None)
101
+ config_file = kwargs.pop("config_file", None)
95
102
  resume_download = kwargs.pop("resume_download", False)
96
103
  force_download = kwargs.pop("force_download", False)
97
104
  proxies = kwargs.pop("proxies", None)
@@ -100,9 +107,15 @@ class FromOriginalVAEMixin:
100
107
  local_files_only = kwargs.pop("local_files_only", None)
101
108
  revision = kwargs.pop("revision", None)
102
109
  torch_dtype = kwargs.pop("torch_dtype", None)
103
- use_safetensors = kwargs.pop("use_safetensors", True)
104
110
 
105
111
  class_name = cls.__name__
112
+
113
+ if (config_file is not None) and (original_config_file is not None):
114
+ raise ValueError(
115
+ "You cannot pass both `config_file` and `original_config_file` to `from_single_file`. Please use only one of these arguments."
116
+ )
117
+
118
+ original_config_file = original_config_file or config_file
106
119
  original_config, checkpoint = fetch_ldm_config_and_checkpoint(
107
120
  pretrained_model_link_or_path=pretrained_model_link_or_path,
108
121
  class_name=class_name,
@@ -113,12 +126,19 @@ class FromOriginalVAEMixin:
113
126
  token=token,
114
127
  revision=revision,
115
128
  local_files_only=local_files_only,
116
- use_safetensors=use_safetensors,
117
129
  cache_dir=cache_dir,
118
130
  )
119
131
 
120
132
  image_size = kwargs.pop("image_size", None)
121
- component = create_diffusers_vae_model_from_ldm(class_name, original_config, checkpoint, image_size=image_size)
133
+ scaling_factor = kwargs.pop("scaling_factor", None)
134
+ component = create_diffusers_vae_model_from_ldm(
135
+ class_name,
136
+ original_config,
137
+ checkpoint,
138
+ image_size=image_size,
139
+ scaling_factor=scaling_factor,
140
+ torch_dtype=torch_dtype,
141
+ )
122
142
  vae = component["vae"]
123
143
  if torch_dtype is not None:
124
144
  vae = vae.to(torch_dtype)
@@ -1,4 +1,4 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
1
+ # Copyright 2024 The HuggingFace Team. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -38,6 +38,9 @@ class FromOriginalControlNetMixin:
38
38
  - A link to the `.ckpt` file (for example
39
39
  `"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"`) on the Hub.
40
40
  - A path to a *file* containing all pipeline weights.
41
+ config_file (`str`, *optional*):
42
+ Filepath to the configuration YAML file associated with the model. If not provided it will default to:
43
+ https://raw.githubusercontent.com/lllyasviel/ControlNet/main/models/cldm_v15.yaml
41
44
  torch_dtype (`str` or `torch.dtype`, *optional*):
42
45
  Override the default `torch.dtype` and load the model with another dtype. If `"auto"` is passed, the
43
46
  dtype is automatically derived from the model's weights.
@@ -62,10 +65,6 @@ class FromOriginalControlNetMixin:
62
65
  revision (`str`, *optional*, defaults to `"main"`):
63
66
  The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
64
67
  allowed by Git.
65
- use_safetensors (`bool`, *optional*, defaults to `None`):
66
- If set to `None`, the safetensors weights are downloaded if they're available **and** if the
67
- safetensors library is installed. If set to `True`, the model is forcibly loaded from safetensors
68
- weights. If set to `False`, safetensors weights are not loaded.
69
68
  image_size (`int`, *optional*, defaults to 512):
70
69
  The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
71
70
  Diffusion v2 base model. Use 768 for Stable Diffusion v2.
@@ -89,6 +88,7 @@ class FromOriginalControlNetMixin:
89
88
  ```
90
89
  """
91
90
  original_config_file = kwargs.pop("original_config_file", None)
91
+ config_file = kwargs.pop("config_file", None)
92
92
  resume_download = kwargs.pop("resume_download", False)
93
93
  force_download = kwargs.pop("force_download", False)
94
94
  proxies = kwargs.pop("proxies", None)
@@ -97,9 +97,14 @@ class FromOriginalControlNetMixin:
97
97
  local_files_only = kwargs.pop("local_files_only", None)
98
98
  revision = kwargs.pop("revision", None)
99
99
  torch_dtype = kwargs.pop("torch_dtype", None)
100
- use_safetensors = kwargs.pop("use_safetensors", True)
101
100
 
102
101
  class_name = cls.__name__
102
+ if (config_file is not None) and (original_config_file is not None):
103
+ raise ValueError(
104
+ "You cannot pass both `config_file` and `original_config_file` to `from_single_file`. Please use only one of these arguments."
105
+ )
106
+
107
+ original_config_file = config_file or original_config_file
103
108
  original_config, checkpoint = fetch_ldm_config_and_checkpoint(
104
109
  pretrained_model_link_or_path=pretrained_model_link_or_path,
105
110
  class_name=class_name,
@@ -110,7 +115,6 @@ class FromOriginalControlNetMixin:
110
115
  token=token,
111
116
  revision=revision,
112
117
  local_files_only=local_files_only,
113
- use_safetensors=use_safetensors,
114
118
  cache_dir=cache_dir,
115
119
  )
116
120
 
@@ -118,7 +122,12 @@ class FromOriginalControlNetMixin:
118
122
  image_size = kwargs.pop("image_size", None)
119
123
 
120
124
  component = create_diffusers_controlnet_model_from_ldm(
121
- class_name, original_config, checkpoint, upcast_attention=upcast_attention, image_size=image_size
125
+ class_name,
126
+ original_config,
127
+ checkpoint,
128
+ upcast_attention=upcast_attention,
129
+ image_size=image_size,
130
+ torch_dtype=torch_dtype,
122
131
  )
123
132
  controlnet = component["controlnet"]
124
133
  if torch_dtype is not None: