diffusers 0.29.2__py3-none-any.whl → 0.30.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffusers/__init__.py +94 -3
- diffusers/commands/env.py +1 -5
- diffusers/configuration_utils.py +4 -9
- diffusers/dependency_versions_table.py +2 -2
- diffusers/image_processor.py +1 -2
- diffusers/loaders/__init__.py +17 -2
- diffusers/loaders/ip_adapter.py +10 -7
- diffusers/loaders/lora_base.py +752 -0
- diffusers/loaders/lora_pipeline.py +2252 -0
- diffusers/loaders/peft.py +213 -5
- diffusers/loaders/single_file.py +3 -14
- diffusers/loaders/single_file_model.py +31 -10
- diffusers/loaders/single_file_utils.py +293 -8
- diffusers/loaders/textual_inversion.py +1 -6
- diffusers/loaders/unet.py +23 -208
- diffusers/models/__init__.py +20 -0
- diffusers/models/activations.py +22 -0
- diffusers/models/attention.py +386 -7
- diffusers/models/attention_processor.py +1937 -629
- diffusers/models/autoencoders/__init__.py +2 -0
- diffusers/models/autoencoders/autoencoder_kl.py +14 -3
- diffusers/models/autoencoders/autoencoder_kl_cogvideox.py +1271 -0
- diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py +1 -1
- diffusers/models/autoencoders/autoencoder_oobleck.py +464 -0
- diffusers/models/autoencoders/autoencoder_tiny.py +1 -0
- diffusers/models/autoencoders/consistency_decoder_vae.py +1 -1
- diffusers/models/autoencoders/vq_model.py +4 -4
- diffusers/models/controlnet.py +2 -3
- diffusers/models/controlnet_hunyuan.py +401 -0
- diffusers/models/controlnet_sd3.py +11 -11
- diffusers/models/controlnet_sparsectrl.py +789 -0
- diffusers/models/controlnet_xs.py +40 -10
- diffusers/models/downsampling.py +68 -0
- diffusers/models/embeddings.py +403 -36
- diffusers/models/model_loading_utils.py +1 -3
- diffusers/models/modeling_flax_utils.py +1 -6
- diffusers/models/modeling_utils.py +4 -16
- diffusers/models/normalization.py +203 -12
- diffusers/models/transformers/__init__.py +6 -0
- diffusers/models/transformers/auraflow_transformer_2d.py +543 -0
- diffusers/models/transformers/cogvideox_transformer_3d.py +485 -0
- diffusers/models/transformers/hunyuan_transformer_2d.py +19 -15
- diffusers/models/transformers/latte_transformer_3d.py +327 -0
- diffusers/models/transformers/lumina_nextdit2d.py +340 -0
- diffusers/models/transformers/pixart_transformer_2d.py +102 -1
- diffusers/models/transformers/prior_transformer.py +1 -1
- diffusers/models/transformers/stable_audio_transformer.py +458 -0
- diffusers/models/transformers/transformer_flux.py +455 -0
- diffusers/models/transformers/transformer_sd3.py +18 -4
- diffusers/models/unets/unet_1d_blocks.py +1 -1
- diffusers/models/unets/unet_2d_condition.py +8 -1
- diffusers/models/unets/unet_3d_blocks.py +51 -920
- diffusers/models/unets/unet_3d_condition.py +4 -1
- diffusers/models/unets/unet_i2vgen_xl.py +4 -1
- diffusers/models/unets/unet_kandinsky3.py +1 -1
- diffusers/models/unets/unet_motion_model.py +1330 -84
- diffusers/models/unets/unet_spatio_temporal_condition.py +1 -1
- diffusers/models/unets/unet_stable_cascade.py +1 -3
- diffusers/models/unets/uvit_2d.py +1 -1
- diffusers/models/upsampling.py +64 -0
- diffusers/models/vq_model.py +8 -4
- diffusers/optimization.py +1 -1
- diffusers/pipelines/__init__.py +100 -3
- diffusers/pipelines/animatediff/__init__.py +4 -0
- diffusers/pipelines/animatediff/pipeline_animatediff.py +50 -40
- diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py +1076 -0
- diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py +17 -27
- diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py +1008 -0
- diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py +51 -38
- diffusers/pipelines/audioldm2/modeling_audioldm2.py +1 -1
- diffusers/pipelines/audioldm2/pipeline_audioldm2.py +1 -0
- diffusers/pipelines/aura_flow/__init__.py +48 -0
- diffusers/pipelines/aura_flow/pipeline_aura_flow.py +591 -0
- diffusers/pipelines/auto_pipeline.py +97 -19
- diffusers/pipelines/cogvideo/__init__.py +48 -0
- diffusers/pipelines/cogvideo/pipeline_cogvideox.py +746 -0
- diffusers/pipelines/consistency_models/pipeline_consistency_models.py +1 -1
- diffusers/pipelines/controlnet/pipeline_controlnet.py +24 -30
- diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +31 -30
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +24 -153
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +19 -28
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +18 -28
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +29 -32
- diffusers/pipelines/controlnet/pipeline_flax_controlnet.py +2 -2
- diffusers/pipelines/controlnet_hunyuandit/__init__.py +48 -0
- diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py +1042 -0
- diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py +35 -0
- diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs.py +10 -6
- diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs_sd_xl.py +0 -4
- diffusers/pipelines/deepfloyd_if/pipeline_if.py +2 -2
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +2 -2
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +2 -2
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +2 -2
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +2 -2
- diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +2 -2
- diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py +11 -6
- diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py +11 -6
- diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_cycle_diffusion.py +6 -6
- diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py +6 -6
- diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_model_editing.py +10 -10
- diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py +10 -6
- diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py +3 -3
- diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py +1 -1
- diffusers/pipelines/flux/__init__.py +47 -0
- diffusers/pipelines/flux/pipeline_flux.py +749 -0
- diffusers/pipelines/flux/pipeline_output.py +21 -0
- diffusers/pipelines/free_init_utils.py +2 -0
- diffusers/pipelines/free_noise_utils.py +236 -0
- diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py +2 -2
- diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py +2 -2
- diffusers/pipelines/kolors/__init__.py +54 -0
- diffusers/pipelines/kolors/pipeline_kolors.py +1070 -0
- diffusers/pipelines/kolors/pipeline_kolors_img2img.py +1247 -0
- diffusers/pipelines/kolors/pipeline_output.py +21 -0
- diffusers/pipelines/kolors/text_encoder.py +889 -0
- diffusers/pipelines/kolors/tokenizer.py +334 -0
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +30 -29
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +23 -29
- diffusers/pipelines/latte/__init__.py +48 -0
- diffusers/pipelines/latte/pipeline_latte.py +881 -0
- diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py +4 -4
- diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py +0 -4
- diffusers/pipelines/lumina/__init__.py +48 -0
- diffusers/pipelines/lumina/pipeline_lumina.py +897 -0
- diffusers/pipelines/pag/__init__.py +67 -0
- diffusers/pipelines/pag/pag_utils.py +237 -0
- diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py +1329 -0
- diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py +1612 -0
- diffusers/pipelines/pag/pipeline_pag_hunyuandit.py +953 -0
- diffusers/pipelines/pag/pipeline_pag_kolors.py +1136 -0
- diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py +872 -0
- diffusers/pipelines/pag/pipeline_pag_sd.py +1050 -0
- diffusers/pipelines/pag/pipeline_pag_sd_3.py +985 -0
- diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py +862 -0
- diffusers/pipelines/pag/pipeline_pag_sd_xl.py +1333 -0
- diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py +1529 -0
- diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py +1753 -0
- diffusers/pipelines/pia/pipeline_pia.py +30 -37
- diffusers/pipelines/pipeline_flax_utils.py +4 -9
- diffusers/pipelines/pipeline_loading_utils.py +0 -3
- diffusers/pipelines/pipeline_utils.py +2 -14
- diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py +0 -1
- diffusers/pipelines/stable_audio/__init__.py +50 -0
- diffusers/pipelines/stable_audio/modeling_stable_audio.py +158 -0
- diffusers/pipelines/stable_audio/pipeline_stable_audio.py +745 -0
- diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +2 -0
- diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py +1 -1
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +23 -29
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +15 -8
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +30 -29
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +23 -152
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +8 -4
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +11 -11
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +8 -6
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +6 -6
- diffusers/pipelines/stable_diffusion_3/__init__.py +2 -0
- diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py +34 -3
- diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py +33 -7
- diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py +1201 -0
- diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py +3 -3
- diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py +6 -6
- diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py +5 -5
- diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py +5 -5
- diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py +6 -6
- diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py +0 -4
- diffusers/pipelines/stable_diffusion_ldm3d/pipeline_stable_diffusion_ldm3d.py +23 -29
- diffusers/pipelines/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py +27 -29
- diffusers/pipelines/stable_diffusion_sag/pipeline_stable_diffusion_sag.py +3 -3
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +17 -27
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +26 -29
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +17 -145
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +0 -4
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +6 -6
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +18 -28
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +8 -6
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +8 -6
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +6 -4
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +0 -4
- diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py +3 -3
- diffusers/pipelines/wuerstchen/modeling_wuerstchen_prior.py +1 -1
- diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py +5 -4
- diffusers/schedulers/__init__.py +8 -0
- diffusers/schedulers/scheduling_cosine_dpmsolver_multistep.py +572 -0
- diffusers/schedulers/scheduling_ddim.py +1 -1
- diffusers/schedulers/scheduling_ddim_cogvideox.py +449 -0
- diffusers/schedulers/scheduling_ddpm.py +1 -1
- diffusers/schedulers/scheduling_ddpm_parallel.py +1 -1
- diffusers/schedulers/scheduling_deis_multistep.py +2 -2
- diffusers/schedulers/scheduling_dpm_cogvideox.py +489 -0
- diffusers/schedulers/scheduling_dpmsolver_multistep.py +1 -1
- diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +1 -1
- diffusers/schedulers/scheduling_dpmsolver_singlestep.py +64 -19
- diffusers/schedulers/scheduling_edm_dpmsolver_multistep.py +2 -2
- diffusers/schedulers/scheduling_flow_match_euler_discrete.py +63 -39
- diffusers/schedulers/scheduling_flow_match_heun_discrete.py +321 -0
- diffusers/schedulers/scheduling_ipndm.py +1 -1
- diffusers/schedulers/scheduling_unipc_multistep.py +1 -1
- diffusers/schedulers/scheduling_utils.py +1 -3
- diffusers/schedulers/scheduling_utils_flax.py +1 -3
- diffusers/training_utils.py +99 -14
- diffusers/utils/__init__.py +2 -2
- diffusers/utils/dummy_pt_objects.py +210 -0
- diffusers/utils/dummy_torch_and_torchsde_objects.py +15 -0
- diffusers/utils/dummy_torch_and_transformers_and_sentencepiece_objects.py +47 -0
- diffusers/utils/dummy_torch_and_transformers_objects.py +315 -0
- diffusers/utils/dynamic_modules_utils.py +1 -11
- diffusers/utils/export_utils.py +50 -6
- diffusers/utils/hub_utils.py +45 -42
- diffusers/utils/import_utils.py +37 -15
- diffusers/utils/loading_utils.py +80 -3
- diffusers/utils/testing_utils.py +11 -8
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/METADATA +73 -83
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/RECORD +217 -164
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/WHEEL +1 -1
- diffusers/loaders/autoencoder.py +0 -146
- diffusers/loaders/controlnet.py +0 -136
- diffusers/loaders/lora.py +0 -1728
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/LICENSE +0 -0
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/entry_points.txt +0 -0
- {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/top_level.txt +0 -0
@@ -77,6 +77,36 @@ class AmusedPipeline(metaclass=DummyObject):
|
|
77
77
|
requires_backends(cls, ["torch", "transformers"])
|
78
78
|
|
79
79
|
|
80
|
+
class AnimateDiffControlNetPipeline(metaclass=DummyObject):
|
81
|
+
_backends = ["torch", "transformers"]
|
82
|
+
|
83
|
+
def __init__(self, *args, **kwargs):
|
84
|
+
requires_backends(self, ["torch", "transformers"])
|
85
|
+
|
86
|
+
@classmethod
|
87
|
+
def from_config(cls, *args, **kwargs):
|
88
|
+
requires_backends(cls, ["torch", "transformers"])
|
89
|
+
|
90
|
+
@classmethod
|
91
|
+
def from_pretrained(cls, *args, **kwargs):
|
92
|
+
requires_backends(cls, ["torch", "transformers"])
|
93
|
+
|
94
|
+
|
95
|
+
class AnimateDiffPAGPipeline(metaclass=DummyObject):
|
96
|
+
_backends = ["torch", "transformers"]
|
97
|
+
|
98
|
+
def __init__(self, *args, **kwargs):
|
99
|
+
requires_backends(self, ["torch", "transformers"])
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def from_config(cls, *args, **kwargs):
|
103
|
+
requires_backends(cls, ["torch", "transformers"])
|
104
|
+
|
105
|
+
@classmethod
|
106
|
+
def from_pretrained(cls, *args, **kwargs):
|
107
|
+
requires_backends(cls, ["torch", "transformers"])
|
108
|
+
|
109
|
+
|
80
110
|
class AnimateDiffPipeline(metaclass=DummyObject):
|
81
111
|
_backends = ["torch", "transformers"]
|
82
112
|
|
@@ -107,6 +137,21 @@ class AnimateDiffSDXLPipeline(metaclass=DummyObject):
|
|
107
137
|
requires_backends(cls, ["torch", "transformers"])
|
108
138
|
|
109
139
|
|
140
|
+
class AnimateDiffSparseControlNetPipeline(metaclass=DummyObject):
|
141
|
+
_backends = ["torch", "transformers"]
|
142
|
+
|
143
|
+
def __init__(self, *args, **kwargs):
|
144
|
+
requires_backends(self, ["torch", "transformers"])
|
145
|
+
|
146
|
+
@classmethod
|
147
|
+
def from_config(cls, *args, **kwargs):
|
148
|
+
requires_backends(cls, ["torch", "transformers"])
|
149
|
+
|
150
|
+
@classmethod
|
151
|
+
def from_pretrained(cls, *args, **kwargs):
|
152
|
+
requires_backends(cls, ["torch", "transformers"])
|
153
|
+
|
154
|
+
|
110
155
|
class AnimateDiffVideoToVideoPipeline(metaclass=DummyObject):
|
111
156
|
_backends = ["torch", "transformers"]
|
112
157
|
|
@@ -182,6 +227,21 @@ class AudioLDMPipeline(metaclass=DummyObject):
|
|
182
227
|
requires_backends(cls, ["torch", "transformers"])
|
183
228
|
|
184
229
|
|
230
|
+
class AuraFlowPipeline(metaclass=DummyObject):
|
231
|
+
_backends = ["torch", "transformers"]
|
232
|
+
|
233
|
+
def __init__(self, *args, **kwargs):
|
234
|
+
requires_backends(self, ["torch", "transformers"])
|
235
|
+
|
236
|
+
@classmethod
|
237
|
+
def from_config(cls, *args, **kwargs):
|
238
|
+
requires_backends(cls, ["torch", "transformers"])
|
239
|
+
|
240
|
+
@classmethod
|
241
|
+
def from_pretrained(cls, *args, **kwargs):
|
242
|
+
requires_backends(cls, ["torch", "transformers"])
|
243
|
+
|
244
|
+
|
185
245
|
class CLIPImageProjection(metaclass=DummyObject):
|
186
246
|
_backends = ["torch", "transformers"]
|
187
247
|
|
@@ -197,6 +257,21 @@ class CLIPImageProjection(metaclass=DummyObject):
|
|
197
257
|
requires_backends(cls, ["torch", "transformers"])
|
198
258
|
|
199
259
|
|
260
|
+
class CogVideoXPipeline(metaclass=DummyObject):
|
261
|
+
_backends = ["torch", "transformers"]
|
262
|
+
|
263
|
+
def __init__(self, *args, **kwargs):
|
264
|
+
requires_backends(self, ["torch", "transformers"])
|
265
|
+
|
266
|
+
@classmethod
|
267
|
+
def from_config(cls, *args, **kwargs):
|
268
|
+
requires_backends(cls, ["torch", "transformers"])
|
269
|
+
|
270
|
+
@classmethod
|
271
|
+
def from_pretrained(cls, *args, **kwargs):
|
272
|
+
requires_backends(cls, ["torch", "transformers"])
|
273
|
+
|
274
|
+
|
200
275
|
class CycleDiffusionPipeline(metaclass=DummyObject):
|
201
276
|
_backends = ["torch", "transformers"]
|
202
277
|
|
@@ -212,6 +287,51 @@ class CycleDiffusionPipeline(metaclass=DummyObject):
|
|
212
287
|
requires_backends(cls, ["torch", "transformers"])
|
213
288
|
|
214
289
|
|
290
|
+
class FluxPipeline(metaclass=DummyObject):
|
291
|
+
_backends = ["torch", "transformers"]
|
292
|
+
|
293
|
+
def __init__(self, *args, **kwargs):
|
294
|
+
requires_backends(self, ["torch", "transformers"])
|
295
|
+
|
296
|
+
@classmethod
|
297
|
+
def from_config(cls, *args, **kwargs):
|
298
|
+
requires_backends(cls, ["torch", "transformers"])
|
299
|
+
|
300
|
+
@classmethod
|
301
|
+
def from_pretrained(cls, *args, **kwargs):
|
302
|
+
requires_backends(cls, ["torch", "transformers"])
|
303
|
+
|
304
|
+
|
305
|
+
class HunyuanDiTControlNetPipeline(metaclass=DummyObject):
|
306
|
+
_backends = ["torch", "transformers"]
|
307
|
+
|
308
|
+
def __init__(self, *args, **kwargs):
|
309
|
+
requires_backends(self, ["torch", "transformers"])
|
310
|
+
|
311
|
+
@classmethod
|
312
|
+
def from_config(cls, *args, **kwargs):
|
313
|
+
requires_backends(cls, ["torch", "transformers"])
|
314
|
+
|
315
|
+
@classmethod
|
316
|
+
def from_pretrained(cls, *args, **kwargs):
|
317
|
+
requires_backends(cls, ["torch", "transformers"])
|
318
|
+
|
319
|
+
|
320
|
+
class HunyuanDiTPAGPipeline(metaclass=DummyObject):
|
321
|
+
_backends = ["torch", "transformers"]
|
322
|
+
|
323
|
+
def __init__(self, *args, **kwargs):
|
324
|
+
requires_backends(self, ["torch", "transformers"])
|
325
|
+
|
326
|
+
@classmethod
|
327
|
+
def from_config(cls, *args, **kwargs):
|
328
|
+
requires_backends(cls, ["torch", "transformers"])
|
329
|
+
|
330
|
+
@classmethod
|
331
|
+
def from_pretrained(cls, *args, **kwargs):
|
332
|
+
requires_backends(cls, ["torch", "transformers"])
|
333
|
+
|
334
|
+
|
215
335
|
class HunyuanDiTPipeline(metaclass=DummyObject):
|
216
336
|
_backends = ["torch", "transformers"]
|
217
337
|
|
@@ -662,6 +782,21 @@ class LatentConsistencyModelPipeline(metaclass=DummyObject):
|
|
662
782
|
requires_backends(cls, ["torch", "transformers"])
|
663
783
|
|
664
784
|
|
785
|
+
class LattePipeline(metaclass=DummyObject):
|
786
|
+
_backends = ["torch", "transformers"]
|
787
|
+
|
788
|
+
def __init__(self, *args, **kwargs):
|
789
|
+
requires_backends(self, ["torch", "transformers"])
|
790
|
+
|
791
|
+
@classmethod
|
792
|
+
def from_config(cls, *args, **kwargs):
|
793
|
+
requires_backends(cls, ["torch", "transformers"])
|
794
|
+
|
795
|
+
@classmethod
|
796
|
+
def from_pretrained(cls, *args, **kwargs):
|
797
|
+
requires_backends(cls, ["torch", "transformers"])
|
798
|
+
|
799
|
+
|
665
800
|
class LDMTextToImagePipeline(metaclass=DummyObject):
|
666
801
|
_backends = ["torch", "transformers"]
|
667
802
|
|
@@ -707,6 +842,21 @@ class LEditsPPPipelineStableDiffusionXL(metaclass=DummyObject):
|
|
707
842
|
requires_backends(cls, ["torch", "transformers"])
|
708
843
|
|
709
844
|
|
845
|
+
class LuminaText2ImgPipeline(metaclass=DummyObject):
|
846
|
+
_backends = ["torch", "transformers"]
|
847
|
+
|
848
|
+
def __init__(self, *args, **kwargs):
|
849
|
+
requires_backends(self, ["torch", "transformers"])
|
850
|
+
|
851
|
+
@classmethod
|
852
|
+
def from_config(cls, *args, **kwargs):
|
853
|
+
requires_backends(cls, ["torch", "transformers"])
|
854
|
+
|
855
|
+
@classmethod
|
856
|
+
def from_pretrained(cls, *args, **kwargs):
|
857
|
+
requires_backends(cls, ["torch", "transformers"])
|
858
|
+
|
859
|
+
|
710
860
|
class MarigoldDepthPipeline(metaclass=DummyObject):
|
711
861
|
_backends = ["torch", "transformers"]
|
712
862
|
|
@@ -797,6 +947,21 @@ class PixArtAlphaPipeline(metaclass=DummyObject):
|
|
797
947
|
requires_backends(cls, ["torch", "transformers"])
|
798
948
|
|
799
949
|
|
950
|
+
class PixArtSigmaPAGPipeline(metaclass=DummyObject):
|
951
|
+
_backends = ["torch", "transformers"]
|
952
|
+
|
953
|
+
def __init__(self, *args, **kwargs):
|
954
|
+
requires_backends(self, ["torch", "transformers"])
|
955
|
+
|
956
|
+
@classmethod
|
957
|
+
def from_config(cls, *args, **kwargs):
|
958
|
+
requires_backends(cls, ["torch", "transformers"])
|
959
|
+
|
960
|
+
@classmethod
|
961
|
+
def from_pretrained(cls, *args, **kwargs):
|
962
|
+
requires_backends(cls, ["torch", "transformers"])
|
963
|
+
|
964
|
+
|
800
965
|
class PixArtSigmaPipeline(metaclass=DummyObject):
|
801
966
|
_backends = ["torch", "transformers"]
|
802
967
|
|
@@ -857,6 +1022,36 @@ class ShapEPipeline(metaclass=DummyObject):
|
|
857
1022
|
requires_backends(cls, ["torch", "transformers"])
|
858
1023
|
|
859
1024
|
|
1025
|
+
class StableAudioPipeline(metaclass=DummyObject):
|
1026
|
+
_backends = ["torch", "transformers"]
|
1027
|
+
|
1028
|
+
def __init__(self, *args, **kwargs):
|
1029
|
+
requires_backends(self, ["torch", "transformers"])
|
1030
|
+
|
1031
|
+
@classmethod
|
1032
|
+
def from_config(cls, *args, **kwargs):
|
1033
|
+
requires_backends(cls, ["torch", "transformers"])
|
1034
|
+
|
1035
|
+
@classmethod
|
1036
|
+
def from_pretrained(cls, *args, **kwargs):
|
1037
|
+
requires_backends(cls, ["torch", "transformers"])
|
1038
|
+
|
1039
|
+
|
1040
|
+
class StableAudioProjectionModel(metaclass=DummyObject):
|
1041
|
+
_backends = ["torch", "transformers"]
|
1042
|
+
|
1043
|
+
def __init__(self, *args, **kwargs):
|
1044
|
+
requires_backends(self, ["torch", "transformers"])
|
1045
|
+
|
1046
|
+
@classmethod
|
1047
|
+
def from_config(cls, *args, **kwargs):
|
1048
|
+
requires_backends(cls, ["torch", "transformers"])
|
1049
|
+
|
1050
|
+
@classmethod
|
1051
|
+
def from_pretrained(cls, *args, **kwargs):
|
1052
|
+
requires_backends(cls, ["torch", "transformers"])
|
1053
|
+
|
1054
|
+
|
860
1055
|
class StableCascadeCombinedPipeline(metaclass=DummyObject):
|
861
1056
|
_backends = ["torch", "transformers"]
|
862
1057
|
|
@@ -932,6 +1127,36 @@ class StableDiffusion3Img2ImgPipeline(metaclass=DummyObject):
|
|
932
1127
|
requires_backends(cls, ["torch", "transformers"])
|
933
1128
|
|
934
1129
|
|
1130
|
+
class StableDiffusion3InpaintPipeline(metaclass=DummyObject):
|
1131
|
+
_backends = ["torch", "transformers"]
|
1132
|
+
|
1133
|
+
def __init__(self, *args, **kwargs):
|
1134
|
+
requires_backends(self, ["torch", "transformers"])
|
1135
|
+
|
1136
|
+
@classmethod
|
1137
|
+
def from_config(cls, *args, **kwargs):
|
1138
|
+
requires_backends(cls, ["torch", "transformers"])
|
1139
|
+
|
1140
|
+
@classmethod
|
1141
|
+
def from_pretrained(cls, *args, **kwargs):
|
1142
|
+
requires_backends(cls, ["torch", "transformers"])
|
1143
|
+
|
1144
|
+
|
1145
|
+
class StableDiffusion3PAGPipeline(metaclass=DummyObject):
|
1146
|
+
_backends = ["torch", "transformers"]
|
1147
|
+
|
1148
|
+
def __init__(self, *args, **kwargs):
|
1149
|
+
requires_backends(self, ["torch", "transformers"])
|
1150
|
+
|
1151
|
+
@classmethod
|
1152
|
+
def from_config(cls, *args, **kwargs):
|
1153
|
+
requires_backends(cls, ["torch", "transformers"])
|
1154
|
+
|
1155
|
+
@classmethod
|
1156
|
+
def from_pretrained(cls, *args, **kwargs):
|
1157
|
+
requires_backends(cls, ["torch", "transformers"])
|
1158
|
+
|
1159
|
+
|
935
1160
|
class StableDiffusion3Pipeline(metaclass=DummyObject):
|
936
1161
|
_backends = ["torch", "transformers"]
|
937
1162
|
|
@@ -1007,6 +1232,21 @@ class StableDiffusionControlNetInpaintPipeline(metaclass=DummyObject):
|
|
1007
1232
|
requires_backends(cls, ["torch", "transformers"])
|
1008
1233
|
|
1009
1234
|
|
1235
|
+
class StableDiffusionControlNetPAGPipeline(metaclass=DummyObject):
|
1236
|
+
_backends = ["torch", "transformers"]
|
1237
|
+
|
1238
|
+
def __init__(self, *args, **kwargs):
|
1239
|
+
requires_backends(self, ["torch", "transformers"])
|
1240
|
+
|
1241
|
+
@classmethod
|
1242
|
+
def from_config(cls, *args, **kwargs):
|
1243
|
+
requires_backends(cls, ["torch", "transformers"])
|
1244
|
+
|
1245
|
+
@classmethod
|
1246
|
+
def from_pretrained(cls, *args, **kwargs):
|
1247
|
+
requires_backends(cls, ["torch", "transformers"])
|
1248
|
+
|
1249
|
+
|
1010
1250
|
class StableDiffusionControlNetPipeline(metaclass=DummyObject):
|
1011
1251
|
_backends = ["torch", "transformers"]
|
1012
1252
|
|
@@ -1217,6 +1457,21 @@ class StableDiffusionModelEditingPipeline(metaclass=DummyObject):
|
|
1217
1457
|
requires_backends(cls, ["torch", "transformers"])
|
1218
1458
|
|
1219
1459
|
|
1460
|
+
class StableDiffusionPAGPipeline(metaclass=DummyObject):
|
1461
|
+
_backends = ["torch", "transformers"]
|
1462
|
+
|
1463
|
+
def __init__(self, *args, **kwargs):
|
1464
|
+
requires_backends(self, ["torch", "transformers"])
|
1465
|
+
|
1466
|
+
@classmethod
|
1467
|
+
def from_config(cls, *args, **kwargs):
|
1468
|
+
requires_backends(cls, ["torch", "transformers"])
|
1469
|
+
|
1470
|
+
@classmethod
|
1471
|
+
def from_pretrained(cls, *args, **kwargs):
|
1472
|
+
requires_backends(cls, ["torch", "transformers"])
|
1473
|
+
|
1474
|
+
|
1220
1475
|
class StableDiffusionPanoramaPipeline(metaclass=DummyObject):
|
1221
1476
|
_backends = ["torch", "transformers"]
|
1222
1477
|
|
@@ -1367,6 +1622,21 @@ class StableDiffusionXLControlNetInpaintPipeline(metaclass=DummyObject):
|
|
1367
1622
|
requires_backends(cls, ["torch", "transformers"])
|
1368
1623
|
|
1369
1624
|
|
1625
|
+
class StableDiffusionXLControlNetPAGPipeline(metaclass=DummyObject):
|
1626
|
+
_backends = ["torch", "transformers"]
|
1627
|
+
|
1628
|
+
def __init__(self, *args, **kwargs):
|
1629
|
+
requires_backends(self, ["torch", "transformers"])
|
1630
|
+
|
1631
|
+
@classmethod
|
1632
|
+
def from_config(cls, *args, **kwargs):
|
1633
|
+
requires_backends(cls, ["torch", "transformers"])
|
1634
|
+
|
1635
|
+
@classmethod
|
1636
|
+
def from_pretrained(cls, *args, **kwargs):
|
1637
|
+
requires_backends(cls, ["torch", "transformers"])
|
1638
|
+
|
1639
|
+
|
1370
1640
|
class StableDiffusionXLControlNetPipeline(metaclass=DummyObject):
|
1371
1641
|
_backends = ["torch", "transformers"]
|
1372
1642
|
|
@@ -1442,6 +1712,51 @@ class StableDiffusionXLInstructPix2PixPipeline(metaclass=DummyObject):
|
|
1442
1712
|
requires_backends(cls, ["torch", "transformers"])
|
1443
1713
|
|
1444
1714
|
|
1715
|
+
class StableDiffusionXLPAGImg2ImgPipeline(metaclass=DummyObject):
|
1716
|
+
_backends = ["torch", "transformers"]
|
1717
|
+
|
1718
|
+
def __init__(self, *args, **kwargs):
|
1719
|
+
requires_backends(self, ["torch", "transformers"])
|
1720
|
+
|
1721
|
+
@classmethod
|
1722
|
+
def from_config(cls, *args, **kwargs):
|
1723
|
+
requires_backends(cls, ["torch", "transformers"])
|
1724
|
+
|
1725
|
+
@classmethod
|
1726
|
+
def from_pretrained(cls, *args, **kwargs):
|
1727
|
+
requires_backends(cls, ["torch", "transformers"])
|
1728
|
+
|
1729
|
+
|
1730
|
+
class StableDiffusionXLPAGInpaintPipeline(metaclass=DummyObject):
|
1731
|
+
_backends = ["torch", "transformers"]
|
1732
|
+
|
1733
|
+
def __init__(self, *args, **kwargs):
|
1734
|
+
requires_backends(self, ["torch", "transformers"])
|
1735
|
+
|
1736
|
+
@classmethod
|
1737
|
+
def from_config(cls, *args, **kwargs):
|
1738
|
+
requires_backends(cls, ["torch", "transformers"])
|
1739
|
+
|
1740
|
+
@classmethod
|
1741
|
+
def from_pretrained(cls, *args, **kwargs):
|
1742
|
+
requires_backends(cls, ["torch", "transformers"])
|
1743
|
+
|
1744
|
+
|
1745
|
+
class StableDiffusionXLPAGPipeline(metaclass=DummyObject):
|
1746
|
+
_backends = ["torch", "transformers"]
|
1747
|
+
|
1748
|
+
def __init__(self, *args, **kwargs):
|
1749
|
+
requires_backends(self, ["torch", "transformers"])
|
1750
|
+
|
1751
|
+
@classmethod
|
1752
|
+
def from_config(cls, *args, **kwargs):
|
1753
|
+
requires_backends(cls, ["torch", "transformers"])
|
1754
|
+
|
1755
|
+
@classmethod
|
1756
|
+
def from_pretrained(cls, *args, **kwargs):
|
1757
|
+
requires_backends(cls, ["torch", "transformers"])
|
1758
|
+
|
1759
|
+
|
1445
1760
|
class StableDiffusionXLPipeline(metaclass=DummyObject):
|
1446
1761
|
_backends = ["torch", "transformers"]
|
1447
1762
|
|
@@ -199,7 +199,6 @@ def get_cached_module_file(
|
|
199
199
|
module_file: str,
|
200
200
|
cache_dir: Optional[Union[str, os.PathLike]] = None,
|
201
201
|
force_download: bool = False,
|
202
|
-
resume_download: Optional[bool] = None,
|
203
202
|
proxies: Optional[Dict[str, str]] = None,
|
204
203
|
token: Optional[Union[bool, str]] = None,
|
205
204
|
revision: Optional[str] = None,
|
@@ -226,9 +225,7 @@ def get_cached_module_file(
|
|
226
225
|
cache should not be used.
|
227
226
|
force_download (`bool`, *optional*, defaults to `False`):
|
228
227
|
Whether or not to force to (re-)download the configuration files and override the cached versions if they
|
229
|
-
exist.
|
230
|
-
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
|
231
|
-
of Diffusers.
|
228
|
+
exist.
|
232
229
|
proxies (`Dict[str, str]`, *optional*):
|
233
230
|
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
|
234
231
|
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
|
@@ -309,7 +306,6 @@ def get_cached_module_file(
|
|
309
306
|
cache_dir=cache_dir,
|
310
307
|
force_download=force_download,
|
311
308
|
proxies=proxies,
|
312
|
-
resume_download=resume_download,
|
313
309
|
local_files_only=local_files_only,
|
314
310
|
token=token,
|
315
311
|
)
|
@@ -366,7 +362,6 @@ def get_cached_module_file(
|
|
366
362
|
f"{module_needed}.py",
|
367
363
|
cache_dir=cache_dir,
|
368
364
|
force_download=force_download,
|
369
|
-
resume_download=resume_download,
|
370
365
|
proxies=proxies,
|
371
366
|
token=token,
|
372
367
|
revision=revision,
|
@@ -382,7 +377,6 @@ def get_class_from_dynamic_module(
|
|
382
377
|
class_name: Optional[str] = None,
|
383
378
|
cache_dir: Optional[Union[str, os.PathLike]] = None,
|
384
379
|
force_download: bool = False,
|
385
|
-
resume_download: Optional[bool] = None,
|
386
380
|
proxies: Optional[Dict[str, str]] = None,
|
387
381
|
token: Optional[Union[bool, str]] = None,
|
388
382
|
revision: Optional[str] = None,
|
@@ -419,9 +413,6 @@ def get_class_from_dynamic_module(
|
|
419
413
|
force_download (`bool`, *optional*, defaults to `False`):
|
420
414
|
Whether or not to force to (re-)download the configuration files and override the cached versions if they
|
421
415
|
exist.
|
422
|
-
resume_download:
|
423
|
-
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1 of
|
424
|
-
Diffusers.
|
425
416
|
proxies (`Dict[str, str]`, *optional*):
|
426
417
|
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
|
427
418
|
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
|
@@ -458,7 +449,6 @@ def get_class_from_dynamic_module(
|
|
458
449
|
module_file,
|
459
450
|
cache_dir=cache_dir,
|
460
451
|
force_download=force_download,
|
461
|
-
resume_download=resume_download,
|
462
452
|
proxies=proxies,
|
463
453
|
token=token,
|
464
454
|
revision=revision,
|
diffusers/utils/export_utils.py
CHANGED
@@ -9,10 +9,7 @@ import numpy as np
|
|
9
9
|
import PIL.Image
|
10
10
|
import PIL.ImageOps
|
11
11
|
|
12
|
-
from .import_utils import
|
13
|
-
BACKENDS_MAPPING,
|
14
|
-
is_opencv_available,
|
15
|
-
)
|
12
|
+
from .import_utils import BACKENDS_MAPPING, is_imageio_available, is_opencv_available
|
16
13
|
from .logging import get_logger
|
17
14
|
|
18
15
|
|
@@ -115,9 +112,9 @@ def export_to_obj(mesh, output_obj_path: str = None):
|
|
115
112
|
f.writelines("\n".join(combined_data))
|
116
113
|
|
117
114
|
|
118
|
-
def
|
115
|
+
def _legacy_export_to_video(
|
119
116
|
video_frames: Union[List[np.ndarray], List[PIL.Image.Image]], output_video_path: str = None, fps: int = 10
|
120
|
-
)
|
117
|
+
):
|
121
118
|
if is_opencv_available():
|
122
119
|
import cv2
|
123
120
|
else:
|
@@ -137,4 +134,51 @@ def export_to_video(
|
|
137
134
|
for i in range(len(video_frames)):
|
138
135
|
img = cv2.cvtColor(video_frames[i], cv2.COLOR_RGB2BGR)
|
139
136
|
video_writer.write(img)
|
137
|
+
|
138
|
+
return output_video_path
|
139
|
+
|
140
|
+
|
141
|
+
def export_to_video(
|
142
|
+
video_frames: Union[List[np.ndarray], List[PIL.Image.Image]], output_video_path: str = None, fps: int = 10
|
143
|
+
) -> str:
|
144
|
+
# TODO: Dhruv. Remove by Diffusers release 0.33.0
|
145
|
+
# Added to prevent breaking existing code
|
146
|
+
if not is_imageio_available():
|
147
|
+
logger.warning(
|
148
|
+
(
|
149
|
+
"It is recommended to use `export_to_video` with `imageio` and `imageio-ffmpeg` as a backend. \n"
|
150
|
+
"These libraries are not present in your environment. Attempting to use legacy OpenCV backend to export video. \n"
|
151
|
+
"Support for the OpenCV backend will be deprecated in a future Diffusers version"
|
152
|
+
)
|
153
|
+
)
|
154
|
+
return _legacy_export_to_video(video_frames, output_video_path, fps)
|
155
|
+
|
156
|
+
if is_imageio_available():
|
157
|
+
import imageio
|
158
|
+
else:
|
159
|
+
raise ImportError(BACKENDS_MAPPING["imageio"][1].format("export_to_video"))
|
160
|
+
|
161
|
+
try:
|
162
|
+
imageio.plugins.ffmpeg.get_exe()
|
163
|
+
except AttributeError:
|
164
|
+
raise AttributeError(
|
165
|
+
(
|
166
|
+
"Found an existing imageio backend in your environment. Attempting to export video with imageio. \n"
|
167
|
+
"Unable to find a compatible ffmpeg installation in your environment to use with imageio. Please install via `pip install imageio-ffmpeg"
|
168
|
+
)
|
169
|
+
)
|
170
|
+
|
171
|
+
if output_video_path is None:
|
172
|
+
output_video_path = tempfile.NamedTemporaryFile(suffix=".mp4").name
|
173
|
+
|
174
|
+
if isinstance(video_frames[0], np.ndarray):
|
175
|
+
video_frames = [(frame * 255).astype(np.uint8) for frame in video_frames]
|
176
|
+
|
177
|
+
elif isinstance(video_frames[0], PIL.Image.Image):
|
178
|
+
video_frames = [np.array(frame) for frame in video_frames]
|
179
|
+
|
180
|
+
with imageio.get_writer(output_video_path, fps=fps) as writer:
|
181
|
+
for frame in video_frames:
|
182
|
+
writer.append_data(frame)
|
183
|
+
|
140
184
|
return output_video_path
|