diffusers 0.24.0__py3-none-any.whl → 0.25.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. diffusers/__init__.py +11 -1
  2. diffusers/commands/fp16_safetensors.py +10 -11
  3. diffusers/configuration_utils.py +12 -8
  4. diffusers/dependency_versions_table.py +3 -2
  5. diffusers/experimental/rl/value_guided_sampling.py +1 -1
  6. diffusers/image_processor.py +286 -46
  7. diffusers/loaders/ip_adapter.py +11 -9
  8. diffusers/loaders/lora.py +198 -60
  9. diffusers/loaders/single_file.py +24 -18
  10. diffusers/loaders/textual_inversion.py +10 -14
  11. diffusers/loaders/unet.py +130 -37
  12. diffusers/models/__init__.py +18 -12
  13. diffusers/models/activations.py +9 -6
  14. diffusers/models/attention.py +137 -16
  15. diffusers/models/attention_processor.py +133 -46
  16. diffusers/models/autoencoders/__init__.py +5 -0
  17. diffusers/models/{autoencoder_asym_kl.py → autoencoders/autoencoder_asym_kl.py} +4 -4
  18. diffusers/models/{autoencoder_kl.py → autoencoders/autoencoder_kl.py} +45 -6
  19. diffusers/models/{autoencoder_kl_temporal_decoder.py → autoencoders/autoencoder_kl_temporal_decoder.py} +8 -8
  20. diffusers/models/{autoencoder_tiny.py → autoencoders/autoencoder_tiny.py} +4 -4
  21. diffusers/models/{consistency_decoder_vae.py → autoencoders/consistency_decoder_vae.py} +14 -14
  22. diffusers/models/{vae.py → autoencoders/vae.py} +9 -5
  23. diffusers/models/downsampling.py +338 -0
  24. diffusers/models/embeddings.py +112 -29
  25. diffusers/models/modeling_flax_utils.py +12 -7
  26. diffusers/models/modeling_utils.py +10 -10
  27. diffusers/models/normalization.py +108 -2
  28. diffusers/models/resnet.py +15 -699
  29. diffusers/models/transformer_2d.py +2 -2
  30. diffusers/models/unet_2d_condition.py +37 -0
  31. diffusers/models/{unet_kandi3.py → unet_kandinsky3.py} +105 -159
  32. diffusers/models/upsampling.py +454 -0
  33. diffusers/models/uvit_2d.py +471 -0
  34. diffusers/models/vq_model.py +9 -2
  35. diffusers/pipelines/__init__.py +81 -73
  36. diffusers/pipelines/amused/__init__.py +62 -0
  37. diffusers/pipelines/amused/pipeline_amused.py +328 -0
  38. diffusers/pipelines/amused/pipeline_amused_img2img.py +347 -0
  39. diffusers/pipelines/amused/pipeline_amused_inpaint.py +378 -0
  40. diffusers/pipelines/animatediff/pipeline_animatediff.py +38 -10
  41. diffusers/pipelines/auto_pipeline.py +17 -13
  42. diffusers/pipelines/controlnet/pipeline_controlnet.py +27 -10
  43. diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +47 -5
  44. diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +25 -8
  45. diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +4 -6
  46. diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +26 -10
  47. diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +4 -3
  48. diffusers/pipelines/deprecated/__init__.py +153 -0
  49. diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/__init__.py +3 -3
  50. diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_alt_diffusion.py +91 -18
  51. diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_alt_diffusion_img2img.py +91 -18
  52. diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_output.py +1 -1
  53. diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/__init__.py +1 -1
  54. diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/mel.py +2 -2
  55. diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/pipeline_audio_diffusion.py +4 -4
  56. diffusers/pipelines/{latent_diffusion_uncond → deprecated/latent_diffusion_uncond}/__init__.py +1 -1
  57. diffusers/pipelines/{latent_diffusion_uncond → deprecated/latent_diffusion_uncond}/pipeline_latent_diffusion_uncond.py +4 -4
  58. diffusers/pipelines/{pndm → deprecated/pndm}/__init__.py +1 -1
  59. diffusers/pipelines/{pndm → deprecated/pndm}/pipeline_pndm.py +4 -4
  60. diffusers/pipelines/{repaint → deprecated/repaint}/__init__.py +1 -1
  61. diffusers/pipelines/{repaint → deprecated/repaint}/pipeline_repaint.py +5 -5
  62. diffusers/pipelines/{score_sde_ve → deprecated/score_sde_ve}/__init__.py +1 -1
  63. diffusers/pipelines/{score_sde_ve → deprecated/score_sde_ve}/pipeline_score_sde_ve.py +4 -4
  64. diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/__init__.py +6 -6
  65. diffusers/pipelines/{spectrogram_diffusion/continous_encoder.py → deprecated/spectrogram_diffusion/continuous_encoder.py} +2 -2
  66. diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/midi_utils.py +1 -1
  67. diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/notes_encoder.py +2 -2
  68. diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/pipeline_spectrogram_diffusion.py +7 -7
  69. diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py +55 -0
  70. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_cycle_diffusion.py +16 -11
  71. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_onnx_stable_diffusion_inpaint_legacy.py +6 -6
  72. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_inpaint_legacy.py +11 -11
  73. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_model_editing.py +16 -11
  74. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_paradigms.py +10 -10
  75. diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_pix2pix_zero.py +13 -13
  76. diffusers/pipelines/{stochastic_karras_ve → deprecated/stochastic_karras_ve}/__init__.py +1 -1
  77. diffusers/pipelines/{stochastic_karras_ve → deprecated/stochastic_karras_ve}/pipeline_stochastic_karras_ve.py +4 -4
  78. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/__init__.py +3 -3
  79. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/modeling_text_unet.py +54 -11
  80. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion.py +4 -4
  81. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_dual_guided.py +6 -6
  82. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_image_variation.py +6 -6
  83. diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_text_to_image.py +6 -6
  84. diffusers/pipelines/{vq_diffusion → deprecated/vq_diffusion}/__init__.py +3 -3
  85. diffusers/pipelines/{vq_diffusion → deprecated/vq_diffusion}/pipeline_vq_diffusion.py +5 -5
  86. diffusers/pipelines/kandinsky3/__init__.py +4 -4
  87. diffusers/pipelines/kandinsky3/convert_kandinsky3_unet.py +98 -0
  88. diffusers/pipelines/kandinsky3/{kandinsky3_pipeline.py → pipeline_kandinsky3.py} +172 -35
  89. diffusers/pipelines/kandinsky3/{kandinsky3img2img_pipeline.py → pipeline_kandinsky3_img2img.py} +228 -34
  90. diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +46 -5
  91. diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +47 -6
  92. diffusers/pipelines/onnx_utils.py +8 -5
  93. diffusers/pipelines/pipeline_flax_utils.py +7 -6
  94. diffusers/pipelines/pipeline_utils.py +32 -31
  95. diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py +51 -2
  96. diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +3 -3
  97. diffusers/pipelines/stable_diffusion/__init__.py +1 -72
  98. diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +67 -75
  99. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +92 -8
  100. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +92 -8
  101. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +138 -10
  102. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +57 -7
  103. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py +3 -0
  104. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +6 -0
  105. diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +5 -0
  106. diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +5 -0
  107. diffusers/pipelines/stable_diffusion_attend_and_excite/__init__.py +48 -0
  108. diffusers/pipelines/{stable_diffusion → stable_diffusion_attend_and_excite}/pipeline_stable_diffusion_attend_and_excite.py +5 -2
  109. diffusers/pipelines/stable_diffusion_diffedit/__init__.py +48 -0
  110. diffusers/pipelines/{stable_diffusion → stable_diffusion_diffedit}/pipeline_stable_diffusion_diffedit.py +2 -3
  111. diffusers/pipelines/stable_diffusion_gligen/__init__.py +50 -0
  112. diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen.py +2 -2
  113. diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen_text_image.py +3 -3
  114. diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py +60 -0
  115. diffusers/pipelines/{stable_diffusion → stable_diffusion_k_diffusion}/pipeline_stable_diffusion_k_diffusion.py +6 -1
  116. diffusers/pipelines/stable_diffusion_ldm3d/__init__.py +48 -0
  117. diffusers/pipelines/{stable_diffusion → stable_diffusion_ldm3d}/pipeline_stable_diffusion_ldm3d.py +50 -7
  118. diffusers/pipelines/stable_diffusion_panorama/__init__.py +48 -0
  119. diffusers/pipelines/{stable_diffusion → stable_diffusion_panorama}/pipeline_stable_diffusion_panorama.py +56 -8
  120. diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py +58 -6
  121. diffusers/pipelines/stable_diffusion_sag/__init__.py +48 -0
  122. diffusers/pipelines/{stable_diffusion → stable_diffusion_sag}/pipeline_stable_diffusion_sag.py +67 -10
  123. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +97 -15
  124. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +98 -14
  125. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +97 -14
  126. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +7 -5
  127. diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py +12 -9
  128. diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +6 -0
  129. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +5 -0
  130. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +5 -0
  131. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +331 -9
  132. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +468 -9
  133. diffusers/pipelines/unclip/pipeline_unclip.py +2 -1
  134. diffusers/pipelines/unclip/pipeline_unclip_image_variation.py +1 -0
  135. diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py +1 -1
  136. diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py +4 -0
  137. diffusers/schedulers/__init__.py +2 -0
  138. diffusers/schedulers/scheduling_amused.py +162 -0
  139. diffusers/schedulers/scheduling_consistency_models.py +2 -0
  140. diffusers/schedulers/scheduling_ddim_inverse.py +1 -4
  141. diffusers/schedulers/scheduling_ddpm.py +46 -0
  142. diffusers/schedulers/scheduling_ddpm_parallel.py +46 -0
  143. diffusers/schedulers/scheduling_deis_multistep.py +13 -1
  144. diffusers/schedulers/scheduling_dpmsolver_multistep.py +13 -1
  145. diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +13 -1
  146. diffusers/schedulers/scheduling_dpmsolver_sde.py +2 -0
  147. diffusers/schedulers/scheduling_dpmsolver_singlestep.py +13 -1
  148. diffusers/schedulers/scheduling_euler_ancestral_discrete.py +58 -0
  149. diffusers/schedulers/scheduling_euler_discrete.py +62 -3
  150. diffusers/schedulers/scheduling_heun_discrete.py +2 -0
  151. diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +2 -0
  152. diffusers/schedulers/scheduling_k_dpm_2_discrete.py +2 -0
  153. diffusers/schedulers/scheduling_lms_discrete.py +2 -0
  154. diffusers/schedulers/scheduling_unipc_multistep.py +13 -1
  155. diffusers/schedulers/scheduling_utils.py +3 -1
  156. diffusers/schedulers/scheduling_utils_flax.py +3 -1
  157. diffusers/training_utils.py +1 -1
  158. diffusers/utils/__init__.py +0 -2
  159. diffusers/utils/constants.py +2 -5
  160. diffusers/utils/dummy_pt_objects.py +30 -0
  161. diffusers/utils/dummy_torch_and_transformers_objects.py +45 -0
  162. diffusers/utils/dynamic_modules_utils.py +14 -18
  163. diffusers/utils/hub_utils.py +24 -36
  164. diffusers/utils/logging.py +1 -1
  165. diffusers/utils/state_dict_utils.py +8 -0
  166. diffusers/utils/testing_utils.py +199 -1
  167. diffusers/utils/torch_utils.py +3 -3
  168. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/METADATA +55 -53
  169. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/RECORD +174 -155
  170. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/WHEEL +1 -1
  171. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/entry_points.txt +0 -1
  172. /diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/modeling_roberta_series.py +0 -0
  173. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/LICENSE +0 -0
  174. {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/top_level.txt +0 -0
@@ -19,6 +19,8 @@ from ..utils import (
19
19
  _dummy_objects = {}
20
20
  _import_structure = {
21
21
  "controlnet": [],
22
+ "controlnet_xs": [],
23
+ "deprecated": [],
22
24
  "latent_diffusion": [],
23
25
  "stable_diffusion": [],
24
26
  "stable_diffusion_xl": [],
@@ -43,16 +45,20 @@ else:
43
45
  _import_structure["ddpm"] = ["DDPMPipeline"]
44
46
  _import_structure["dit"] = ["DiTPipeline"]
45
47
  _import_structure["latent_diffusion"].extend(["LDMSuperResolutionPipeline"])
46
- _import_structure["latent_diffusion_uncond"] = ["LDMPipeline"]
47
48
  _import_structure["pipeline_utils"] = [
48
49
  "AudioPipelineOutput",
49
50
  "DiffusionPipeline",
50
51
  "ImagePipelineOutput",
51
52
  ]
52
- _import_structure["pndm"] = ["PNDMPipeline"]
53
- _import_structure["repaint"] = ["RePaintPipeline"]
54
- _import_structure["score_sde_ve"] = ["ScoreSdeVePipeline"]
55
- _import_structure["stochastic_karras_ve"] = ["KarrasVePipeline"]
53
+ _import_structure["deprecated"].extend(
54
+ [
55
+ "PNDMPipeline",
56
+ "LDMPipeline",
57
+ "RePaintPipeline",
58
+ "ScoreSdeVePipeline",
59
+ "KarrasVePipeline",
60
+ ]
61
+ )
56
62
  try:
57
63
  if not (is_torch_available() and is_librosa_available()):
58
64
  raise OptionalDependencyNotAvailable()
@@ -61,7 +67,23 @@ except OptionalDependencyNotAvailable:
61
67
 
62
68
  _dummy_objects.update(get_objects_from_module(dummy_torch_and_librosa_objects))
63
69
  else:
64
- _import_structure["audio_diffusion"] = ["AudioDiffusionPipeline", "Mel"]
70
+ _import_structure["deprecated"].extend(["AudioDiffusionPipeline", "Mel"])
71
+
72
+ try:
73
+ if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
74
+ raise OptionalDependencyNotAvailable()
75
+ except OptionalDependencyNotAvailable:
76
+ from ..utils import dummy_transformers_and_torch_and_note_seq_objects # noqa F403
77
+
78
+ _dummy_objects.update(get_objects_from_module(dummy_transformers_and_torch_and_note_seq_objects))
79
+ else:
80
+ _import_structure["deprecated"].extend(
81
+ [
82
+ "MidiProcessor",
83
+ "SpectrogramDiffusionPipeline",
84
+ ]
85
+ )
86
+
65
87
  try:
66
88
  if not (is_torch_available() and is_transformers_available()):
67
89
  raise OptionalDependencyNotAvailable()
@@ -70,10 +92,23 @@ except OptionalDependencyNotAvailable:
70
92
 
71
93
  _dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_objects))
72
94
  else:
73
- _import_structure["alt_diffusion"] = [
74
- "AltDiffusionImg2ImgPipeline",
75
- "AltDiffusionPipeline",
76
- ]
95
+ _import_structure["deprecated"].extend(
96
+ [
97
+ "VQDiffusionPipeline",
98
+ "AltDiffusionPipeline",
99
+ "AltDiffusionImg2ImgPipeline",
100
+ "CycleDiffusionPipeline",
101
+ "StableDiffusionInpaintPipelineLegacy",
102
+ "StableDiffusionPix2PixZeroPipeline",
103
+ "StableDiffusionParadigmsPipeline",
104
+ "StableDiffusionModelEditingPipeline",
105
+ "VersatileDiffusionDualGuidedPipeline",
106
+ "VersatileDiffusionImageVariationPipeline",
107
+ "VersatileDiffusionPipeline",
108
+ "VersatileDiffusionTextToImagePipeline",
109
+ ]
110
+ )
111
+ _import_structure["amused"] = ["AmusedImg2ImgPipeline", "AmusedInpaintPipeline", "AmusedPipeline"]
77
112
  _import_structure["animatediff"] = ["AnimateDiffPipeline"]
78
113
  _import_structure["audioldm"] = ["AudioLDMPipeline"]
79
114
  _import_structure["audioldm2"] = [
@@ -139,32 +174,26 @@ else:
139
174
  _import_structure["stable_diffusion"].extend(
140
175
  [
141
176
  "CLIPImageProjection",
142
- "CycleDiffusionPipeline",
143
- "StableDiffusionAttendAndExcitePipeline",
144
177
  "StableDiffusionDepth2ImgPipeline",
145
- "StableDiffusionDiffEditPipeline",
146
- "StableDiffusionGLIGENPipeline",
147
- "StableDiffusionGLIGENPipeline",
148
- "StableDiffusionGLIGENTextImagePipeline",
149
178
  "StableDiffusionImageVariationPipeline",
150
179
  "StableDiffusionImg2ImgPipeline",
151
180
  "StableDiffusionInpaintPipeline",
152
- "StableDiffusionInpaintPipelineLegacy",
153
181
  "StableDiffusionInstructPix2PixPipeline",
154
182
  "StableDiffusionLatentUpscalePipeline",
155
- "StableDiffusionLDM3DPipeline",
156
- "StableDiffusionModelEditingPipeline",
157
- "StableDiffusionPanoramaPipeline",
158
- "StableDiffusionParadigmsPipeline",
159
183
  "StableDiffusionPipeline",
160
- "StableDiffusionPix2PixZeroPipeline",
161
- "StableDiffusionSAGPipeline",
162
184
  "StableDiffusionUpscalePipeline",
163
185
  "StableUnCLIPImg2ImgPipeline",
164
186
  "StableUnCLIPPipeline",
187
+ "StableDiffusionLDM3DPipeline",
165
188
  ]
166
189
  )
190
+ _import_structure["stable_diffusion_attend_and_excite"] = ["StableDiffusionAttendAndExcitePipeline"]
167
191
  _import_structure["stable_diffusion_safe"] = ["StableDiffusionPipelineSafe"]
192
+ _import_structure["stable_diffusion_sag"] = ["StableDiffusionSAGPipeline"]
193
+ _import_structure["stable_diffusion_gligen"] = [
194
+ "StableDiffusionGLIGENPipeline",
195
+ "StableDiffusionGLIGENTextImagePipeline",
196
+ ]
168
197
  _import_structure["stable_video_diffusion"] = ["StableVideoDiffusionPipeline"]
169
198
  _import_structure["stable_diffusion_xl"].extend(
170
199
  [
@@ -174,6 +203,9 @@ else:
174
203
  "StableDiffusionXLPipeline",
175
204
  ]
176
205
  )
206
+ _import_structure["stable_diffusion_diffedit"] = ["StableDiffusionDiffEditPipeline"]
207
+ _import_structure["stable_diffusion_ldm3d"] = ["StableDiffusionLDM3DPipeline"]
208
+ _import_structure["stable_diffusion_panorama"] = ["StableDiffusionPanoramaPipeline"]
177
209
  _import_structure["t2i_adapter"] = [
178
210
  "StableDiffusionAdapterPipeline",
179
211
  "StableDiffusionXLAdapterPipeline",
@@ -191,13 +223,6 @@ else:
191
223
  "UniDiffuserPipeline",
192
224
  "UniDiffuserTextDecoder",
193
225
  ]
194
- _import_structure["versatile_diffusion"] = [
195
- "VersatileDiffusionDualGuidedPipeline",
196
- "VersatileDiffusionImageVariationPipeline",
197
- "VersatileDiffusionPipeline",
198
- "VersatileDiffusionTextToImagePipeline",
199
- ]
200
- _import_structure["vq_diffusion"] = ["VQDiffusionPipeline"]
201
226
  _import_structure["wuerstchen"] = [
202
227
  "WuerstchenCombinedPipeline",
203
228
  "WuerstchenDecoderPipeline",
@@ -224,7 +249,6 @@ else:
224
249
  [
225
250
  "OnnxStableDiffusionImg2ImgPipeline",
226
251
  "OnnxStableDiffusionInpaintPipeline",
227
- "OnnxStableDiffusionInpaintPipelineLegacy",
228
252
  "OnnxStableDiffusionPipeline",
229
253
  "OnnxStableDiffusionUpscalePipeline",
230
254
  "StableDiffusionOnnxPipeline",
@@ -241,7 +265,7 @@ except OptionalDependencyNotAvailable:
241
265
 
242
266
  _dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_and_k_diffusion_objects))
243
267
  else:
244
- _import_structure["stable_diffusion"].extend(["StableDiffusionKDiffusionPipeline"])
268
+ _import_structure["stable_diffusion_k_diffusion"] = ["StableDiffusionKDiffusionPipeline"]
245
269
  try:
246
270
  if not is_flax_available():
247
271
  raise OptionalDependencyNotAvailable()
@@ -272,18 +296,6 @@ else:
272
296
  "FlaxStableDiffusionXLPipeline",
273
297
  ]
274
298
  )
275
- try:
276
- if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
277
- raise OptionalDependencyNotAvailable()
278
- except OptionalDependencyNotAvailable:
279
- from ..utils import dummy_transformers_and_torch_and_note_seq_objects # noqa F403
280
-
281
- _dummy_objects.update(get_objects_from_module(dummy_transformers_and_torch_and_note_seq_objects))
282
- else:
283
- _import_structure["spectrogram_diffusion"] = [
284
- "MidiProcessor",
285
- "SpectrogramDiffusionPipeline",
286
- ]
287
299
 
288
300
  if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
289
301
  try:
@@ -302,18 +314,14 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
302
314
  from .dance_diffusion import DanceDiffusionPipeline
303
315
  from .ddim import DDIMPipeline
304
316
  from .ddpm import DDPMPipeline
317
+ from .deprecated import KarrasVePipeline, LDMPipeline, PNDMPipeline, RePaintPipeline, ScoreSdeVePipeline
305
318
  from .dit import DiTPipeline
306
319
  from .latent_diffusion import LDMSuperResolutionPipeline
307
- from .latent_diffusion_uncond import LDMPipeline
308
320
  from .pipeline_utils import (
309
321
  AudioPipelineOutput,
310
322
  DiffusionPipeline,
311
323
  ImagePipelineOutput,
312
324
  )
313
- from .pndm import PNDMPipeline
314
- from .repaint import RePaintPipeline
315
- from .score_sde_ve import ScoreSdeVePipeline
316
- from .stochastic_karras_ve import KarrasVePipeline
317
325
 
318
326
  try:
319
327
  if not (is_torch_available() and is_librosa_available()):
@@ -321,7 +329,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
321
329
  except OptionalDependencyNotAvailable:
322
330
  from ..utils.dummy_torch_and_librosa_objects import *
323
331
  else:
324
- from .audio_diffusion import AudioDiffusionPipeline, Mel
332
+ from .deprecated import AudioDiffusionPipeline, Mel
325
333
 
326
334
  try:
327
335
  if not (is_torch_available() and is_transformers_available()):
@@ -329,7 +337,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
329
337
  except OptionalDependencyNotAvailable:
330
338
  from ..utils.dummy_torch_and_transformers_objects import *
331
339
  else:
332
- from .alt_diffusion import AltDiffusionImg2ImgPipeline, AltDiffusionPipeline
340
+ from .amused import AmusedImg2ImgPipeline, AmusedInpaintPipeline, AmusedPipeline
333
341
  from .animatediff import AnimateDiffPipeline
334
342
  from .audioldm import AudioLDMPipeline
335
343
  from .audioldm2 import (
@@ -355,6 +363,20 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
355
363
  IFPipeline,
356
364
  IFSuperResolutionPipeline,
357
365
  )
366
+ from .deprecated import (
367
+ AltDiffusionImg2ImgPipeline,
368
+ AltDiffusionPipeline,
369
+ CycleDiffusionPipeline,
370
+ StableDiffusionInpaintPipelineLegacy,
371
+ StableDiffusionModelEditingPipeline,
372
+ StableDiffusionParadigmsPipeline,
373
+ StableDiffusionPix2PixZeroPipeline,
374
+ VersatileDiffusionDualGuidedPipeline,
375
+ VersatileDiffusionImageVariationPipeline,
376
+ VersatileDiffusionPipeline,
377
+ VersatileDiffusionTextToImagePipeline,
378
+ VQDiffusionPipeline,
379
+ )
358
380
  from .kandinsky import (
359
381
  KandinskyCombinedPipeline,
360
382
  KandinskyImg2ImgCombinedPipeline,
@@ -392,30 +414,24 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
392
414
  from .shap_e import ShapEImg2ImgPipeline, ShapEPipeline
393
415
  from .stable_diffusion import (
394
416
  CLIPImageProjection,
395
- CycleDiffusionPipeline,
396
- StableDiffusionAttendAndExcitePipeline,
397
417
  StableDiffusionDepth2ImgPipeline,
398
- StableDiffusionDiffEditPipeline,
399
- StableDiffusionGLIGENPipeline,
400
- StableDiffusionGLIGENTextImagePipeline,
401
418
  StableDiffusionImageVariationPipeline,
402
419
  StableDiffusionImg2ImgPipeline,
403
420
  StableDiffusionInpaintPipeline,
404
- StableDiffusionInpaintPipelineLegacy,
405
421
  StableDiffusionInstructPix2PixPipeline,
406
422
  StableDiffusionLatentUpscalePipeline,
407
- StableDiffusionLDM3DPipeline,
408
- StableDiffusionModelEditingPipeline,
409
- StableDiffusionPanoramaPipeline,
410
- StableDiffusionParadigmsPipeline,
411
423
  StableDiffusionPipeline,
412
- StableDiffusionPix2PixZeroPipeline,
413
- StableDiffusionSAGPipeline,
414
424
  StableDiffusionUpscalePipeline,
415
425
  StableUnCLIPImg2ImgPipeline,
416
426
  StableUnCLIPPipeline,
417
427
  )
428
+ from .stable_diffusion_attend_and_excite import StableDiffusionAttendAndExcitePipeline
429
+ from .stable_diffusion_diffedit import StableDiffusionDiffEditPipeline
430
+ from .stable_diffusion_gligen import StableDiffusionGLIGENPipeline, StableDiffusionGLIGENTextImagePipeline
431
+ from .stable_diffusion_ldm3d import StableDiffusionLDM3DPipeline
432
+ from .stable_diffusion_panorama import StableDiffusionPanoramaPipeline
418
433
  from .stable_diffusion_safe import StableDiffusionPipelineSafe
434
+ from .stable_diffusion_sag import StableDiffusionSAGPipeline
419
435
  from .stable_diffusion_xl import (
420
436
  StableDiffusionXLImg2ImgPipeline,
421
437
  StableDiffusionXLInpaintPipeline,
@@ -440,13 +456,6 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
440
456
  UniDiffuserPipeline,
441
457
  UniDiffuserTextDecoder,
442
458
  )
443
- from .versatile_diffusion import (
444
- VersatileDiffusionDualGuidedPipeline,
445
- VersatileDiffusionImageVariationPipeline,
446
- VersatileDiffusionPipeline,
447
- VersatileDiffusionTextToImagePipeline,
448
- )
449
- from .vq_diffusion import VQDiffusionPipeline
450
459
  from .wuerstchen import (
451
460
  WuerstchenCombinedPipeline,
452
461
  WuerstchenDecoderPipeline,
@@ -471,7 +480,6 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
471
480
  from .stable_diffusion import (
472
481
  OnnxStableDiffusionImg2ImgPipeline,
473
482
  OnnxStableDiffusionInpaintPipeline,
474
- OnnxStableDiffusionInpaintPipelineLegacy,
475
483
  OnnxStableDiffusionPipeline,
476
484
  OnnxStableDiffusionUpscalePipeline,
477
485
  StableDiffusionOnnxPipeline,
@@ -483,7 +491,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
483
491
  except OptionalDependencyNotAvailable:
484
492
  from ..utils.dummy_torch_and_transformers_and_k_diffusion_objects import *
485
493
  else:
486
- from .stable_diffusion import StableDiffusionKDiffusionPipeline
494
+ from .stable_diffusion_k_diffusion import StableDiffusionKDiffusionPipeline
487
495
 
488
496
  try:
489
497
  if not is_flax_available():
@@ -516,7 +524,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
516
524
  from ..utils.dummy_transformers_and_torch_and_note_seq_objects import * # noqa F403
517
525
 
518
526
  else:
519
- from .spectrogram_diffusion import (
527
+ from .deprecated import (
520
528
  MidiProcessor,
521
529
  SpectrogramDiffusionPipeline,
522
530
  )
@@ -0,0 +1,62 @@
1
+ from typing import TYPE_CHECKING
2
+
3
+ from ...utils import (
4
+ DIFFUSERS_SLOW_IMPORT,
5
+ OptionalDependencyNotAvailable,
6
+ _LazyModule,
7
+ is_torch_available,
8
+ is_transformers_available,
9
+ )
10
+
11
+
12
+ _dummy_objects = {}
13
+ _import_structure = {}
14
+
15
+ try:
16
+ if not (is_transformers_available() and is_torch_available()):
17
+ raise OptionalDependencyNotAvailable()
18
+ except OptionalDependencyNotAvailable:
19
+ from ...utils.dummy_torch_and_transformers_objects import (
20
+ AmusedImg2ImgPipeline,
21
+ AmusedInpaintPipeline,
22
+ AmusedPipeline,
23
+ )
24
+
25
+ _dummy_objects.update(
26
+ {
27
+ "AmusedPipeline": AmusedPipeline,
28
+ "AmusedImg2ImgPipeline": AmusedImg2ImgPipeline,
29
+ "AmusedInpaintPipeline": AmusedInpaintPipeline,
30
+ }
31
+ )
32
+ else:
33
+ _import_structure["pipeline_amused"] = ["AmusedPipeline"]
34
+ _import_structure["pipeline_amused_img2img"] = ["AmusedImg2ImgPipeline"]
35
+ _import_structure["pipeline_amused_inpaint"] = ["AmusedInpaintPipeline"]
36
+
37
+
38
+ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
39
+ try:
40
+ if not (is_transformers_available() and is_torch_available()):
41
+ raise OptionalDependencyNotAvailable()
42
+ except OptionalDependencyNotAvailable:
43
+ from ...utils.dummy_torch_and_transformers_objects import (
44
+ AmusedPipeline,
45
+ )
46
+ else:
47
+ from .pipeline_amused import AmusedPipeline
48
+ from .pipeline_amused_img2img import AmusedImg2ImgPipeline
49
+ from .pipeline_amused_inpaint import AmusedInpaintPipeline
50
+
51
+ else:
52
+ import sys
53
+
54
+ sys.modules[__name__] = _LazyModule(
55
+ __name__,
56
+ globals()["__file__"],
57
+ _import_structure,
58
+ module_spec=__spec__,
59
+ )
60
+
61
+ for name, value in _dummy_objects.items():
62
+ setattr(sys.modules[__name__], name, value)