diffusers 0.23.1__py3-none-any.whl → 0.25.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- diffusers/__init__.py +26 -2
- diffusers/commands/fp16_safetensors.py +10 -11
- diffusers/configuration_utils.py +13 -8
- diffusers/dependency_versions_check.py +0 -1
- diffusers/dependency_versions_table.py +5 -5
- diffusers/experimental/rl/value_guided_sampling.py +1 -1
- diffusers/image_processor.py +463 -51
- diffusers/loaders/__init__.py +82 -0
- diffusers/loaders/ip_adapter.py +159 -0
- diffusers/loaders/lora.py +1553 -0
- diffusers/loaders/lora_conversion_utils.py +284 -0
- diffusers/loaders/single_file.py +637 -0
- diffusers/loaders/textual_inversion.py +455 -0
- diffusers/loaders/unet.py +828 -0
- diffusers/loaders/utils.py +59 -0
- diffusers/models/__init__.py +26 -9
- diffusers/models/activations.py +9 -6
- diffusers/models/attention.py +301 -29
- diffusers/models/attention_flax.py +9 -1
- diffusers/models/attention_processor.py +378 -6
- diffusers/models/autoencoders/__init__.py +5 -0
- diffusers/models/{autoencoder_asym_kl.py → autoencoders/autoencoder_asym_kl.py} +17 -12
- diffusers/models/{autoencoder_kl.py → autoencoders/autoencoder_kl.py} +47 -23
- diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py +402 -0
- diffusers/models/{autoencoder_tiny.py → autoencoders/autoencoder_tiny.py} +24 -28
- diffusers/models/{consistency_decoder_vae.py → autoencoders/consistency_decoder_vae.py} +51 -44
- diffusers/models/{vae.py → autoencoders/vae.py} +71 -17
- diffusers/models/controlnet.py +59 -39
- diffusers/models/controlnet_flax.py +19 -18
- diffusers/models/downsampling.py +338 -0
- diffusers/models/embeddings.py +112 -29
- diffusers/models/embeddings_flax.py +2 -0
- diffusers/models/lora.py +131 -1
- diffusers/models/modeling_flax_utils.py +14 -8
- diffusers/models/modeling_outputs.py +17 -0
- diffusers/models/modeling_utils.py +37 -29
- diffusers/models/normalization.py +110 -4
- diffusers/models/resnet.py +299 -652
- diffusers/models/transformer_2d.py +22 -5
- diffusers/models/transformer_temporal.py +183 -1
- diffusers/models/unet_2d_blocks_flax.py +5 -0
- diffusers/models/unet_2d_condition.py +46 -0
- diffusers/models/unet_2d_condition_flax.py +13 -13
- diffusers/models/unet_3d_blocks.py +957 -173
- diffusers/models/unet_3d_condition.py +16 -8
- diffusers/models/unet_kandinsky3.py +535 -0
- diffusers/models/unet_motion_model.py +48 -33
- diffusers/models/unet_spatio_temporal_condition.py +489 -0
- diffusers/models/upsampling.py +454 -0
- diffusers/models/uvit_2d.py +471 -0
- diffusers/models/vae_flax.py +7 -0
- diffusers/models/vq_model.py +12 -3
- diffusers/optimization.py +16 -9
- diffusers/pipelines/__init__.py +137 -76
- diffusers/pipelines/amused/__init__.py +62 -0
- diffusers/pipelines/amused/pipeline_amused.py +328 -0
- diffusers/pipelines/amused/pipeline_amused_img2img.py +347 -0
- diffusers/pipelines/amused/pipeline_amused_inpaint.py +378 -0
- diffusers/pipelines/animatediff/pipeline_animatediff.py +66 -8
- diffusers/pipelines/audioldm/pipeline_audioldm.py +1 -0
- diffusers/pipelines/auto_pipeline.py +23 -13
- diffusers/pipelines/consistency_models/pipeline_consistency_models.py +1 -0
- diffusers/pipelines/controlnet/pipeline_controlnet.py +238 -35
- diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +148 -37
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +155 -41
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +123 -43
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +216 -39
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +106 -34
- diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py +1 -0
- diffusers/pipelines/ddim/pipeline_ddim.py +1 -0
- diffusers/pipelines/ddpm/pipeline_ddpm.py +1 -0
- diffusers/pipelines/deepfloyd_if/pipeline_if.py +13 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +13 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +13 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +13 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +13 -1
- diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +13 -1
- diffusers/pipelines/deprecated/__init__.py +153 -0
- diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/__init__.py +3 -3
- diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_alt_diffusion.py +177 -34
- diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_alt_diffusion_img2img.py +182 -37
- diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_output.py +1 -1
- diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/__init__.py +1 -1
- diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/mel.py +2 -2
- diffusers/pipelines/{audio_diffusion → deprecated/audio_diffusion}/pipeline_audio_diffusion.py +4 -4
- diffusers/pipelines/{latent_diffusion_uncond → deprecated/latent_diffusion_uncond}/__init__.py +1 -1
- diffusers/pipelines/{latent_diffusion_uncond → deprecated/latent_diffusion_uncond}/pipeline_latent_diffusion_uncond.py +4 -4
- diffusers/pipelines/{pndm → deprecated/pndm}/__init__.py +1 -1
- diffusers/pipelines/{pndm → deprecated/pndm}/pipeline_pndm.py +4 -4
- diffusers/pipelines/{repaint → deprecated/repaint}/__init__.py +1 -1
- diffusers/pipelines/{repaint → deprecated/repaint}/pipeline_repaint.py +5 -5
- diffusers/pipelines/{score_sde_ve → deprecated/score_sde_ve}/__init__.py +1 -1
- diffusers/pipelines/{score_sde_ve → deprecated/score_sde_ve}/pipeline_score_sde_ve.py +5 -4
- diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/__init__.py +6 -6
- diffusers/pipelines/{spectrogram_diffusion/continous_encoder.py → deprecated/spectrogram_diffusion/continuous_encoder.py} +2 -2
- diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/midi_utils.py +1 -1
- diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/notes_encoder.py +2 -2
- diffusers/pipelines/{spectrogram_diffusion → deprecated/spectrogram_diffusion}/pipeline_spectrogram_diffusion.py +8 -7
- diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py +55 -0
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_cycle_diffusion.py +34 -13
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_onnx_stable_diffusion_inpaint_legacy.py +7 -6
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_inpaint_legacy.py +12 -11
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_model_editing.py +17 -11
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_paradigms.py +11 -10
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_pix2pix_zero.py +14 -13
- diffusers/pipelines/{stochastic_karras_ve → deprecated/stochastic_karras_ve}/__init__.py +1 -1
- diffusers/pipelines/{stochastic_karras_ve → deprecated/stochastic_karras_ve}/pipeline_stochastic_karras_ve.py +4 -4
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/__init__.py +3 -3
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/modeling_text_unet.py +83 -51
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion.py +4 -4
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_dual_guided.py +7 -6
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_image_variation.py +7 -6
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_text_to_image.py +7 -6
- diffusers/pipelines/{vq_diffusion → deprecated/vq_diffusion}/__init__.py +3 -3
- diffusers/pipelines/{vq_diffusion → deprecated/vq_diffusion}/pipeline_vq_diffusion.py +5 -5
- diffusers/pipelines/dit/pipeline_dit.py +1 -0
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py +1 -1
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py +3 -3
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py +1 -1
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py +1 -1
- diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py +1 -1
- diffusers/pipelines/kandinsky3/__init__.py +49 -0
- diffusers/pipelines/kandinsky3/convert_kandinsky3_unet.py +98 -0
- diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py +589 -0
- diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py +654 -0
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +111 -11
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +102 -9
- diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py +1 -0
- diffusers/pipelines/musicldm/pipeline_musicldm.py +1 -1
- diffusers/pipelines/onnx_utils.py +8 -5
- diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py +7 -2
- diffusers/pipelines/pipeline_flax_utils.py +11 -8
- diffusers/pipelines/pipeline_utils.py +63 -42
- diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py +247 -38
- diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +3 -3
- diffusers/pipelines/stable_diffusion/__init__.py +37 -65
- diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +75 -78
- diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py +2 -2
- diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py +2 -4
- diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py +1 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +174 -11
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +8 -3
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py +1 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +178 -11
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +224 -13
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +74 -20
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py +4 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +7 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +5 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +5 -0
- diffusers/pipelines/stable_diffusion_attend_and_excite/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_attend_and_excite}/pipeline_stable_diffusion_attend_and_excite.py +6 -2
- diffusers/pipelines/stable_diffusion_diffedit/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_diffedit}/pipeline_stable_diffusion_diffedit.py +3 -3
- diffusers/pipelines/stable_diffusion_gligen/__init__.py +50 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen.py +3 -2
- diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen_text_image.py +4 -3
- diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py +60 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_k_diffusion}/pipeline_stable_diffusion_k_diffusion.py +7 -1
- diffusers/pipelines/stable_diffusion_ldm3d/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_ldm3d}/pipeline_stable_diffusion_ldm3d.py +51 -7
- diffusers/pipelines/stable_diffusion_panorama/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_panorama}/pipeline_stable_diffusion_panorama.py +57 -8
- diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py +58 -6
- diffusers/pipelines/stable_diffusion_sag/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_sag}/pipeline_stable_diffusion_sag.py +68 -10
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +194 -17
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +205 -16
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +206 -17
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +23 -17
- diffusers/pipelines/stable_video_diffusion/__init__.py +58 -0
- diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py +652 -0
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +108 -12
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +115 -14
- diffusers/pipelines/text_to_video_synthesis/__init__.py +2 -0
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +6 -0
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +23 -3
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +334 -10
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +1331 -0
- diffusers/pipelines/unclip/pipeline_unclip.py +2 -1
- diffusers/pipelines/unclip/pipeline_unclip_image_variation.py +1 -0
- diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py +1 -1
- diffusers/pipelines/wuerstchen/modeling_wuerstchen_common.py +14 -4
- diffusers/pipelines/wuerstchen/modeling_wuerstchen_prior.py +9 -5
- diffusers/pipelines/wuerstchen/pipeline_wuerstchen.py +1 -1
- diffusers/pipelines/wuerstchen/pipeline_wuerstchen_combined.py +2 -2
- diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py +5 -1
- diffusers/schedulers/__init__.py +4 -4
- diffusers/schedulers/deprecated/__init__.py +50 -0
- diffusers/schedulers/{scheduling_karras_ve.py → deprecated/scheduling_karras_ve.py} +4 -4
- diffusers/schedulers/{scheduling_sde_vp.py → deprecated/scheduling_sde_vp.py} +4 -6
- diffusers/schedulers/scheduling_amused.py +162 -0
- diffusers/schedulers/scheduling_consistency_models.py +2 -0
- diffusers/schedulers/scheduling_ddim.py +1 -3
- diffusers/schedulers/scheduling_ddim_inverse.py +2 -7
- diffusers/schedulers/scheduling_ddim_parallel.py +1 -3
- diffusers/schedulers/scheduling_ddpm.py +47 -3
- diffusers/schedulers/scheduling_ddpm_parallel.py +47 -3
- diffusers/schedulers/scheduling_deis_multistep.py +28 -6
- diffusers/schedulers/scheduling_dpmsolver_multistep.py +28 -6
- diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +28 -6
- diffusers/schedulers/scheduling_dpmsolver_sde.py +3 -3
- diffusers/schedulers/scheduling_dpmsolver_singlestep.py +28 -6
- diffusers/schedulers/scheduling_euler_ancestral_discrete.py +59 -3
- diffusers/schedulers/scheduling_euler_discrete.py +102 -16
- diffusers/schedulers/scheduling_heun_discrete.py +17 -5
- diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +17 -5
- diffusers/schedulers/scheduling_k_dpm_2_discrete.py +17 -5
- diffusers/schedulers/scheduling_lcm.py +123 -29
- diffusers/schedulers/scheduling_lms_discrete.py +3 -3
- diffusers/schedulers/scheduling_pndm.py +1 -3
- diffusers/schedulers/scheduling_repaint.py +1 -3
- diffusers/schedulers/scheduling_unipc_multistep.py +28 -6
- diffusers/schedulers/scheduling_utils.py +3 -1
- diffusers/schedulers/scheduling_utils_flax.py +3 -1
- diffusers/training_utils.py +1 -1
- diffusers/utils/__init__.py +1 -2
- diffusers/utils/constants.py +10 -12
- diffusers/utils/dummy_pt_objects.py +75 -0
- diffusers/utils/dummy_torch_and_transformers_objects.py +105 -0
- diffusers/utils/dynamic_modules_utils.py +18 -22
- diffusers/utils/export_utils.py +8 -3
- diffusers/utils/hub_utils.py +24 -36
- diffusers/utils/logging.py +11 -11
- diffusers/utils/outputs.py +5 -5
- diffusers/utils/peft_utils.py +88 -44
- diffusers/utils/state_dict_utils.py +8 -0
- diffusers/utils/testing_utils.py +199 -1
- diffusers/utils/torch_utils.py +4 -4
- {diffusers-0.23.1.dist-info → diffusers-0.25.0.dist-info}/METADATA +86 -69
- diffusers-0.25.0.dist-info/RECORD +360 -0
- {diffusers-0.23.1.dist-info → diffusers-0.25.0.dist-info}/WHEEL +1 -1
- {diffusers-0.23.1.dist-info → diffusers-0.25.0.dist-info}/entry_points.txt +0 -1
- diffusers/loaders.py +0 -3336
- diffusers-0.23.1.dist-info/RECORD +0 -323
- /diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/modeling_roberta_series.py +0 -0
- {diffusers-0.23.1.dist-info → diffusers-0.25.0.dist-info}/LICENSE +0 -0
- {diffusers-0.23.1.dist-info → diffusers-0.25.0.dist-info}/top_level.txt +0 -0
diffusers/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "0.
|
1
|
+
__version__ = "0.25.0"
|
2
2
|
|
3
3
|
from typing import TYPE_CHECKING
|
4
4
|
|
@@ -76,9 +76,11 @@ else:
|
|
76
76
|
[
|
77
77
|
"AsymmetricAutoencoderKL",
|
78
78
|
"AutoencoderKL",
|
79
|
+
"AutoencoderKLTemporalDecoder",
|
79
80
|
"AutoencoderTiny",
|
80
81
|
"ConsistencyDecoderVAE",
|
81
82
|
"ControlNetModel",
|
83
|
+
"Kandinsky3UNet",
|
82
84
|
"ModelMixin",
|
83
85
|
"MotionAdapter",
|
84
86
|
"MultiAdapter",
|
@@ -91,9 +93,12 @@ else:
|
|
91
93
|
"UNet2DModel",
|
92
94
|
"UNet3DConditionModel",
|
93
95
|
"UNetMotionModel",
|
96
|
+
"UNetSpatioTemporalConditionModel",
|
97
|
+
"UVit2DModel",
|
94
98
|
"VQModel",
|
95
99
|
]
|
96
100
|
)
|
101
|
+
|
97
102
|
_import_structure["optimization"] = [
|
98
103
|
"get_constant_schedule",
|
99
104
|
"get_constant_schedule_with_warmup",
|
@@ -103,7 +108,6 @@ else:
|
|
103
108
|
"get_polynomial_decay_schedule_with_warmup",
|
104
109
|
"get_scheduler",
|
105
110
|
]
|
106
|
-
|
107
111
|
_import_structure["pipelines"].extend(
|
108
112
|
[
|
109
113
|
"AudioPipelineOutput",
|
@@ -127,6 +131,7 @@ else:
|
|
127
131
|
)
|
128
132
|
_import_structure["schedulers"].extend(
|
129
133
|
[
|
134
|
+
"AmusedScheduler",
|
130
135
|
"CMStochasticIterativeScheduler",
|
131
136
|
"DDIMInverseScheduler",
|
132
137
|
"DDIMParallelScheduler",
|
@@ -198,6 +203,9 @@ else:
|
|
198
203
|
[
|
199
204
|
"AltDiffusionImg2ImgPipeline",
|
200
205
|
"AltDiffusionPipeline",
|
206
|
+
"AmusedImg2ImgPipeline",
|
207
|
+
"AmusedInpaintPipeline",
|
208
|
+
"AmusedPipeline",
|
201
209
|
"AnimateDiffPipeline",
|
202
210
|
"AudioLDM2Pipeline",
|
203
211
|
"AudioLDM2ProjectionModel",
|
@@ -214,6 +222,8 @@ else:
|
|
214
222
|
"IFPipeline",
|
215
223
|
"IFSuperResolutionPipeline",
|
216
224
|
"ImageTextPipelineOutput",
|
225
|
+
"Kandinsky3Img2ImgPipeline",
|
226
|
+
"Kandinsky3Pipeline",
|
217
227
|
"KandinskyCombinedPipeline",
|
218
228
|
"KandinskyImg2ImgCombinedPipeline",
|
219
229
|
"KandinskyImg2ImgPipeline",
|
@@ -274,8 +284,10 @@ else:
|
|
274
284
|
"StableDiffusionXLPipeline",
|
275
285
|
"StableUnCLIPImg2ImgPipeline",
|
276
286
|
"StableUnCLIPPipeline",
|
287
|
+
"StableVideoDiffusionPipeline",
|
277
288
|
"TextToVideoSDPipeline",
|
278
289
|
"TextToVideoZeroPipeline",
|
290
|
+
"TextToVideoZeroSDXLPipeline",
|
279
291
|
"UnCLIPImageVariationPipeline",
|
280
292
|
"UnCLIPPipeline",
|
281
293
|
"UniDiffuserModel",
|
@@ -443,9 +455,11 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
443
455
|
from .models import (
|
444
456
|
AsymmetricAutoencoderKL,
|
445
457
|
AutoencoderKL,
|
458
|
+
AutoencoderKLTemporalDecoder,
|
446
459
|
AutoencoderTiny,
|
447
460
|
ConsistencyDecoderVAE,
|
448
461
|
ControlNetModel,
|
462
|
+
Kandinsky3UNet,
|
449
463
|
ModelMixin,
|
450
464
|
MotionAdapter,
|
451
465
|
MultiAdapter,
|
@@ -458,6 +472,8 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
458
472
|
UNet2DModel,
|
459
473
|
UNet3DConditionModel,
|
460
474
|
UNetMotionModel,
|
475
|
+
UNetSpatioTemporalConditionModel,
|
476
|
+
UVit2DModel,
|
461
477
|
VQModel,
|
462
478
|
)
|
463
479
|
from .optimization import (
|
@@ -492,6 +508,7 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
492
508
|
ScoreSdeVePipeline,
|
493
509
|
)
|
494
510
|
from .schedulers import (
|
511
|
+
AmusedScheduler,
|
495
512
|
CMStochasticIterativeScheduler,
|
496
513
|
DDIMInverseScheduler,
|
497
514
|
DDIMParallelScheduler,
|
@@ -546,6 +563,9 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
546
563
|
from .pipelines import (
|
547
564
|
AltDiffusionImg2ImgPipeline,
|
548
565
|
AltDiffusionPipeline,
|
566
|
+
AmusedImg2ImgPipeline,
|
567
|
+
AmusedInpaintPipeline,
|
568
|
+
AmusedPipeline,
|
549
569
|
AnimateDiffPipeline,
|
550
570
|
AudioLDM2Pipeline,
|
551
571
|
AudioLDM2ProjectionModel,
|
@@ -560,6 +580,8 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
560
580
|
IFPipeline,
|
561
581
|
IFSuperResolutionPipeline,
|
562
582
|
ImageTextPipelineOutput,
|
583
|
+
Kandinsky3Img2ImgPipeline,
|
584
|
+
Kandinsky3Pipeline,
|
563
585
|
KandinskyCombinedPipeline,
|
564
586
|
KandinskyImg2ImgCombinedPipeline,
|
565
587
|
KandinskyImg2ImgPipeline,
|
@@ -620,8 +642,10 @@ if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
|
|
620
642
|
StableDiffusionXLPipeline,
|
621
643
|
StableUnCLIPImg2ImgPipeline,
|
622
644
|
StableUnCLIPPipeline,
|
645
|
+
StableVideoDiffusionPipeline,
|
623
646
|
TextToVideoSDPipeline,
|
624
647
|
TextToVideoZeroPipeline,
|
648
|
+
TextToVideoZeroSDXLPipeline,
|
625
649
|
UnCLIPImageVariationPipeline,
|
626
650
|
UnCLIPPipeline,
|
627
651
|
UniDiffuserModel,
|
@@ -19,6 +19,7 @@ Usage example:
|
|
19
19
|
|
20
20
|
import glob
|
21
21
|
import json
|
22
|
+
import warnings
|
22
23
|
from argparse import ArgumentParser, Namespace
|
23
24
|
from importlib import import_module
|
24
25
|
|
@@ -32,12 +33,12 @@ from . import BaseDiffusersCLICommand
|
|
32
33
|
|
33
34
|
|
34
35
|
def conversion_command_factory(args: Namespace):
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
)
|
36
|
+
if args.use_auth_token:
|
37
|
+
warnings.warn(
|
38
|
+
"The `--use_auth_token` flag is deprecated and will be removed in a future version. Authentication is now"
|
39
|
+
" handled automatically if user is logged in."
|
40
|
+
)
|
41
|
+
return FP16SafetensorsCommand(args.ckpt_id, args.fp16, args.use_safetensors)
|
41
42
|
|
42
43
|
|
43
44
|
class FP16SafetensorsCommand(BaseDiffusersCLICommand):
|
@@ -62,7 +63,7 @@ class FP16SafetensorsCommand(BaseDiffusersCLICommand):
|
|
62
63
|
)
|
63
64
|
conversion_parser.set_defaults(func=conversion_command_factory)
|
64
65
|
|
65
|
-
def __init__(self, ckpt_id: str, fp16: bool, use_safetensors: bool
|
66
|
+
def __init__(self, ckpt_id: str, fp16: bool, use_safetensors: bool):
|
66
67
|
self.logger = logging.get_logger("diffusers-cli/fp16_safetensors")
|
67
68
|
self.ckpt_id = ckpt_id
|
68
69
|
self.local_ckpt_dir = f"/tmp/{ckpt_id}"
|
@@ -75,8 +76,6 @@ class FP16SafetensorsCommand(BaseDiffusersCLICommand):
|
|
75
76
|
"When `use_safetensors` and `fp16` both are False, then this command is of no use."
|
76
77
|
)
|
77
78
|
|
78
|
-
self.use_auth_token = use_auth_token
|
79
|
-
|
80
79
|
def run(self):
|
81
80
|
if version.parse(huggingface_hub.__version__) < version.parse("0.9.0"):
|
82
81
|
raise ImportError(
|
@@ -87,7 +86,7 @@ class FP16SafetensorsCommand(BaseDiffusersCLICommand):
|
|
87
86
|
from huggingface_hub import create_commit
|
88
87
|
from huggingface_hub._commit_api import CommitOperationAdd
|
89
88
|
|
90
|
-
model_index = hf_hub_download(repo_id=self.ckpt_id, filename="model_index.json"
|
89
|
+
model_index = hf_hub_download(repo_id=self.ckpt_id, filename="model_index.json")
|
91
90
|
with open(model_index, "r") as f:
|
92
91
|
pipeline_class_name = json.load(f)["_class_name"]
|
93
92
|
pipeline_class = getattr(import_module("diffusers"), pipeline_class_name)
|
@@ -96,7 +95,7 @@ class FP16SafetensorsCommand(BaseDiffusersCLICommand):
|
|
96
95
|
# Load the appropriate pipeline. We could have use `DiffusionPipeline`
|
97
96
|
# here, but just to avoid any rough edge cases.
|
98
97
|
pipeline = pipeline_class.from_pretrained(
|
99
|
-
self.ckpt_id, torch_dtype=torch.float16 if self.fp16 else torch.float32
|
98
|
+
self.ckpt_id, torch_dtype=torch.float16 if self.fp16 else torch.float32
|
100
99
|
)
|
101
100
|
pipeline.save_pretrained(
|
102
101
|
self.local_ckpt_dir,
|
diffusers/configuration_utils.py
CHANGED
@@ -27,12 +27,16 @@ from typing import Any, Dict, Tuple, Union
|
|
27
27
|
|
28
28
|
import numpy as np
|
29
29
|
from huggingface_hub import create_repo, hf_hub_download
|
30
|
-
from huggingface_hub.utils import
|
30
|
+
from huggingface_hub.utils import (
|
31
|
+
EntryNotFoundError,
|
32
|
+
RepositoryNotFoundError,
|
33
|
+
RevisionNotFoundError,
|
34
|
+
validate_hf_hub_args,
|
35
|
+
)
|
31
36
|
from requests import HTTPError
|
32
37
|
|
33
38
|
from . import __version__
|
34
39
|
from .utils import (
|
35
|
-
DIFFUSERS_CACHE,
|
36
40
|
HUGGINGFACE_CO_RESOLVE_ENDPOINT,
|
37
41
|
DummyObject,
|
38
42
|
deprecate,
|
@@ -95,6 +99,7 @@ class ConfigMixin:
|
|
95
99
|
should only have a `kwargs` argument if at least one argument is deprecated (should be overridden by
|
96
100
|
subclass).
|
97
101
|
"""
|
102
|
+
|
98
103
|
config_name = None
|
99
104
|
ignore_for_config = []
|
100
105
|
has_compatibles = False
|
@@ -274,6 +279,7 @@ class ConfigMixin:
|
|
274
279
|
return cls.load_config(*args, **kwargs)
|
275
280
|
|
276
281
|
@classmethod
|
282
|
+
@validate_hf_hub_args
|
277
283
|
def load_config(
|
278
284
|
cls,
|
279
285
|
pretrained_model_name_or_path: Union[str, os.PathLike],
|
@@ -310,7 +316,7 @@ class ConfigMixin:
|
|
310
316
|
local_files_only (`bool`, *optional*, defaults to `False`):
|
311
317
|
Whether to only load local model weights and configuration files or not. If set to `True`, the model
|
312
318
|
won't be downloaded from the Hub.
|
313
|
-
|
319
|
+
token (`str` or *bool*, *optional*):
|
314
320
|
The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from
|
315
321
|
`diffusers-cli login` (stored in `~/.huggingface`) is used.
|
316
322
|
revision (`str`, *optional*, defaults to `"main"`):
|
@@ -328,11 +334,11 @@ class ConfigMixin:
|
|
328
334
|
A dictionary of all the parameters stored in a JSON configuration file.
|
329
335
|
|
330
336
|
"""
|
331
|
-
cache_dir = kwargs.pop("cache_dir",
|
337
|
+
cache_dir = kwargs.pop("cache_dir", None)
|
332
338
|
force_download = kwargs.pop("force_download", False)
|
333
339
|
resume_download = kwargs.pop("resume_download", False)
|
334
340
|
proxies = kwargs.pop("proxies", None)
|
335
|
-
|
341
|
+
token = kwargs.pop("token", None)
|
336
342
|
local_files_only = kwargs.pop("local_files_only", False)
|
337
343
|
revision = kwargs.pop("revision", None)
|
338
344
|
_ = kwargs.pop("mirror", None)
|
@@ -375,7 +381,7 @@ class ConfigMixin:
|
|
375
381
|
proxies=proxies,
|
376
382
|
resume_download=resume_download,
|
377
383
|
local_files_only=local_files_only,
|
378
|
-
|
384
|
+
token=token,
|
379
385
|
user_agent=user_agent,
|
380
386
|
subfolder=subfolder,
|
381
387
|
revision=revision,
|
@@ -384,8 +390,7 @@ class ConfigMixin:
|
|
384
390
|
raise EnvironmentError(
|
385
391
|
f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier"
|
386
392
|
" listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a"
|
387
|
-
" token having permission to this repo with `
|
388
|
-
" login`."
|
393
|
+
" token having permission to this repo with `token` or log in with `huggingface-cli login`."
|
389
394
|
)
|
390
395
|
except RevisionNotFoundError:
|
391
396
|
raise EnvironmentError(
|
@@ -11,7 +11,6 @@
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
|
-
import sys
|
15
14
|
|
16
15
|
from .dependency_versions_table import deps
|
17
16
|
from .utils.versions import require_version, require_version_core
|
@@ -1,16 +1,15 @@
|
|
1
1
|
# THIS FILE HAS BEEN AUTOGENERATED. To update:
|
2
2
|
# 1. modify the `_deps` dict in setup.py
|
3
|
-
# 2. run `make deps_table_update
|
3
|
+
# 2. run `make deps_table_update`
|
4
4
|
deps = {
|
5
5
|
"Pillow": "Pillow",
|
6
6
|
"accelerate": "accelerate>=0.11.0",
|
7
7
|
"compel": "compel==0.1.8",
|
8
|
-
"black": "black~=23.1",
|
9
8
|
"datasets": "datasets",
|
10
9
|
"filelock": "filelock",
|
11
10
|
"flax": "flax>=0.4.1",
|
12
11
|
"hf-doc-builder": "hf-doc-builder>=0.3.0",
|
13
|
-
"huggingface-hub": "huggingface-hub>=0.
|
12
|
+
"huggingface-hub": "huggingface-hub>=0.19.4",
|
14
13
|
"requests-mock": "requests-mock==1.10.0",
|
15
14
|
"importlib_metadata": "importlib_metadata",
|
16
15
|
"invisible-watermark": "invisible-watermark>=0.2.0",
|
@@ -25,15 +24,16 @@ deps = {
|
|
25
24
|
"numpy": "numpy",
|
26
25
|
"omegaconf": "omegaconf",
|
27
26
|
"parameterized": "parameterized",
|
28
|
-
"peft": "peft
|
27
|
+
"peft": "peft>=0.6.0",
|
29
28
|
"protobuf": "protobuf>=3.20.3,<4",
|
30
29
|
"pytest": "pytest",
|
31
30
|
"pytest-timeout": "pytest-timeout",
|
32
31
|
"pytest-xdist": "pytest-xdist",
|
33
32
|
"python": "python>=3.8.0",
|
34
|
-
"ruff": "ruff==0.
|
33
|
+
"ruff": "ruff==0.1.5",
|
35
34
|
"safetensors": "safetensors>=0.3.1",
|
36
35
|
"sentencepiece": "sentencepiece>=0.1.91,!=0.1.92",
|
36
|
+
"GitPython": "GitPython<3.1.19",
|
37
37
|
"scipy": "scipy",
|
38
38
|
"onnx": "onnx",
|
39
39
|
"regex": "regex!=2019.12.17",
|
@@ -113,7 +113,7 @@ class ValueGuidedRLPipeline(DiffusionPipeline):
|
|
113
113
|
prev_x = self.unet(x.permute(0, 2, 1), timesteps).sample.permute(0, 2, 1)
|
114
114
|
|
115
115
|
# TODO: verify deprecation of this kwarg
|
116
|
-
x = self.scheduler.step(prev_x, i, x
|
116
|
+
x = self.scheduler.step(prev_x, i, x)["prev_sample"]
|
117
117
|
|
118
118
|
# apply conditions to the trajectory (set the initial state)
|
119
119
|
x = self.reset_x0(x, conditions, self.action_dim)
|