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/utils/torch_utils.py
CHANGED
@@ -82,14 +82,14 @@ def randn_tensor(
|
|
82
82
|
return latents
|
83
83
|
|
84
84
|
|
85
|
-
def is_compiled_module(module):
|
85
|
+
def is_compiled_module(module) -> bool:
|
86
86
|
"""Check whether the module was compiled with torch.compile()"""
|
87
87
|
if is_torch_version("<", "2.0.0") or not hasattr(torch, "_dynamo"):
|
88
88
|
return False
|
89
89
|
return isinstance(module, torch._dynamo.eval_frame.OptimizedModule)
|
90
90
|
|
91
91
|
|
92
|
-
def fourier_filter(x_in, threshold, scale):
|
92
|
+
def fourier_filter(x_in: "torch.Tensor", threshold: int, scale: int) -> "torch.Tensor":
|
93
93
|
"""Fourier filter as introduced in FreeU (https://arxiv.org/abs/2309.11497).
|
94
94
|
|
95
95
|
This version of the method comes from here:
|
@@ -121,8 +121,8 @@ def fourier_filter(x_in, threshold, scale):
|
|
121
121
|
|
122
122
|
|
123
123
|
def apply_freeu(
|
124
|
-
resolution_idx: int, hidden_states: torch.Tensor, res_hidden_states: torch.Tensor, **freeu_kwargs
|
125
|
-
) -> Tuple[torch.Tensor, torch.Tensor]:
|
124
|
+
resolution_idx: int, hidden_states: "torch.Tensor", res_hidden_states: "torch.Tensor", **freeu_kwargs
|
125
|
+
) -> Tuple["torch.Tensor", "torch.Tensor"]:
|
126
126
|
"""Applies the FreeU mechanism as introduced in https:
|
127
127
|
//arxiv.org/abs/2309.11497. Adapted from the official code repository: https://github.com/ChenyangSi/FreeU.
|
128
128
|
|
@@ -1,103 +1,121 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: diffusers
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.25.0
|
4
4
|
Summary: State-of-the-art diffusion in PyTorch and JAX.
|
5
5
|
Home-page: https://github.com/huggingface/diffusers
|
6
|
-
Author: The
|
6
|
+
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
|
7
7
|
Author-email: patrick@huggingface.co
|
8
|
-
License: Apache
|
8
|
+
License: Apache 2.0 License
|
9
9
|
Keywords: deep learning diffusion jax pytorch stable diffusion audioldm
|
10
|
-
Platform: UNKNOWN
|
11
10
|
Classifier: Development Status :: 5 - Production/Stable
|
12
11
|
Classifier: Intended Audience :: Developers
|
13
12
|
Classifier: Intended Audience :: Education
|
14
13
|
Classifier: Intended Audience :: Science/Research
|
15
14
|
Classifier: License :: OSI Approved :: Apache Software License
|
16
15
|
Classifier: Operating System :: OS Independent
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
18
18
|
Classifier: Programming Language :: Python :: 3.8
|
19
19
|
Classifier: Programming Language :: Python :: 3.9
|
20
|
-
Classifier:
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
21
21
|
Requires-Python: >=3.8.0
|
22
22
|
Description-Content-Type: text/markdown
|
23
23
|
License-File: LICENSE
|
24
|
-
Requires-Dist: Pillow
|
25
|
-
Requires-Dist: filelock
|
26
|
-
Requires-Dist: huggingface-hub (>=0.13.2)
|
27
24
|
Requires-Dist: importlib-metadata
|
25
|
+
Requires-Dist: filelock
|
26
|
+
Requires-Dist: huggingface-hub >=0.19.4
|
28
27
|
Requires-Dist: numpy
|
29
|
-
Requires-Dist: regex
|
28
|
+
Requires-Dist: regex !=2019.12.17
|
30
29
|
Requires-Dist: requests
|
31
|
-
Requires-Dist: safetensors
|
30
|
+
Requires-Dist: safetensors >=0.3.1
|
31
|
+
Requires-Dist: Pillow
|
32
32
|
Provides-Extra: dev
|
33
|
-
Requires-Dist:
|
34
|
-
Requires-Dist:
|
35
|
-
Requires-Dist:
|
36
|
-
Requires-Dist:
|
33
|
+
Requires-Dist: urllib3 <=2.0.0 ; extra == 'dev'
|
34
|
+
Requires-Dist: isort >=5.5.4 ; extra == 'dev'
|
35
|
+
Requires-Dist: ruff ==0.1.5 ; extra == 'dev'
|
36
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'dev'
|
37
|
+
Requires-Dist: compel ==0.1.8 ; extra == 'dev'
|
38
|
+
Requires-Dist: GitPython <3.1.19 ; extra == 'dev'
|
37
39
|
Requires-Dist: datasets ; extra == 'dev'
|
38
|
-
Requires-Dist:
|
39
|
-
Requires-Dist:
|
40
|
-
Requires-Dist:
|
41
|
-
Requires-Dist: isort (>=5.5.4) ; extra == 'dev'
|
42
|
-
Requires-Dist: jax (>=0.4.1) ; extra == 'dev'
|
43
|
-
Requires-Dist: jaxlib (>=0.4.1) ; extra == 'dev'
|
44
|
-
Requires-Dist: k-diffusion (>=0.0.12) ; extra == 'dev'
|
40
|
+
Requires-Dist: Jinja2 ; extra == 'dev'
|
41
|
+
Requires-Dist: invisible-watermark >=0.2.0 ; extra == 'dev'
|
42
|
+
Requires-Dist: k-diffusion >=0.0.12 ; extra == 'dev'
|
45
43
|
Requires-Dist: librosa ; extra == 'dev'
|
46
44
|
Requires-Dist: omegaconf ; extra == 'dev'
|
47
45
|
Requires-Dist: parameterized ; extra == 'dev'
|
48
|
-
Requires-Dist: protobuf (<4,>=3.20.3) ; extra == 'dev'
|
49
46
|
Requires-Dist: pytest ; extra == 'dev'
|
50
47
|
Requires-Dist: pytest-timeout ; extra == 'dev'
|
51
48
|
Requires-Dist: pytest-xdist ; extra == 'dev'
|
52
|
-
Requires-Dist: requests-mock
|
53
|
-
Requires-Dist:
|
54
|
-
Requires-Dist:
|
49
|
+
Requires-Dist: requests-mock ==1.10.0 ; extra == 'dev'
|
50
|
+
Requires-Dist: safetensors >=0.3.1 ; extra == 'dev'
|
51
|
+
Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'dev'
|
55
52
|
Requires-Dist: scipy ; extra == 'dev'
|
56
|
-
Requires-Dist: sentencepiece (!=0.1.92,>=0.1.91) ; extra == 'dev'
|
57
|
-
Requires-Dist: tensorboard ; extra == 'dev'
|
58
|
-
Requires-Dist: torch (>=1.4) ; extra == 'dev'
|
59
53
|
Requires-Dist: torchvision ; extra == 'dev'
|
60
|
-
Requires-Dist: transformers
|
61
|
-
Requires-Dist:
|
54
|
+
Requires-Dist: transformers >=4.25.1 ; extra == 'dev'
|
55
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'dev'
|
56
|
+
Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'dev'
|
57
|
+
Requires-Dist: tensorboard ; extra == 'dev'
|
58
|
+
Requires-Dist: peft >=0.6.0 ; extra == 'dev'
|
59
|
+
Requires-Dist: torch >=1.4 ; extra == 'dev'
|
60
|
+
Requires-Dist: jax >=0.4.1 ; extra == 'dev'
|
61
|
+
Requires-Dist: jaxlib >=0.4.1 ; extra == 'dev'
|
62
|
+
Requires-Dist: flax >=0.4.1 ; extra == 'dev'
|
62
63
|
Provides-Extra: docs
|
63
|
-
Requires-Dist: hf-doc-builder
|
64
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'docs'
|
64
65
|
Provides-Extra: flax
|
65
|
-
Requires-Dist:
|
66
|
-
Requires-Dist:
|
67
|
-
Requires-Dist:
|
66
|
+
Requires-Dist: jax >=0.4.1 ; extra == 'flax'
|
67
|
+
Requires-Dist: jaxlib >=0.4.1 ; extra == 'flax'
|
68
|
+
Requires-Dist: flax >=0.4.1 ; extra == 'flax'
|
68
69
|
Provides-Extra: quality
|
69
|
-
Requires-Dist:
|
70
|
-
Requires-Dist:
|
71
|
-
Requires-Dist:
|
72
|
-
Requires-Dist:
|
73
|
-
Requires-Dist: urllib3 (<=2.0.0) ; extra == 'quality'
|
70
|
+
Requires-Dist: urllib3 <=2.0.0 ; extra == 'quality'
|
71
|
+
Requires-Dist: isort >=5.5.4 ; extra == 'quality'
|
72
|
+
Requires-Dist: ruff ==0.1.5 ; extra == 'quality'
|
73
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'quality'
|
74
74
|
Provides-Extra: test
|
75
|
-
Requires-Dist:
|
76
|
-
Requires-Dist:
|
75
|
+
Requires-Dist: compel ==0.1.8 ; extra == 'test'
|
76
|
+
Requires-Dist: GitPython <3.1.19 ; extra == 'test'
|
77
77
|
Requires-Dist: datasets ; extra == 'test'
|
78
|
-
Requires-Dist:
|
79
|
-
Requires-Dist:
|
78
|
+
Requires-Dist: Jinja2 ; extra == 'test'
|
79
|
+
Requires-Dist: invisible-watermark >=0.2.0 ; extra == 'test'
|
80
|
+
Requires-Dist: k-diffusion >=0.0.12 ; extra == 'test'
|
80
81
|
Requires-Dist: librosa ; extra == 'test'
|
81
82
|
Requires-Dist: omegaconf ; extra == 'test'
|
82
83
|
Requires-Dist: parameterized ; extra == 'test'
|
83
84
|
Requires-Dist: pytest ; extra == 'test'
|
84
85
|
Requires-Dist: pytest-timeout ; extra == 'test'
|
85
86
|
Requires-Dist: pytest-xdist ; extra == 'test'
|
86
|
-
Requires-Dist: requests-mock
|
87
|
-
Requires-Dist: safetensors
|
87
|
+
Requires-Dist: requests-mock ==1.10.0 ; extra == 'test'
|
88
|
+
Requires-Dist: safetensors >=0.3.1 ; extra == 'test'
|
89
|
+
Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'test'
|
88
90
|
Requires-Dist: scipy ; extra == 'test'
|
89
|
-
Requires-Dist: sentencepiece (!=0.1.92,>=0.1.91) ; extra == 'test'
|
90
91
|
Requires-Dist: torchvision ; extra == 'test'
|
91
|
-
Requires-Dist: transformers
|
92
|
+
Requires-Dist: transformers >=4.25.1 ; extra == 'test'
|
92
93
|
Provides-Extra: torch
|
93
|
-
Requires-Dist:
|
94
|
-
Requires-Dist:
|
94
|
+
Requires-Dist: torch >=1.4 ; extra == 'torch'
|
95
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'torch'
|
95
96
|
Provides-Extra: training
|
96
|
-
Requires-Dist:
|
97
|
-
Requires-Dist: accelerate (>=0.11.0) ; extra == 'training'
|
97
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'training'
|
98
98
|
Requires-Dist: datasets ; extra == 'training'
|
99
|
-
Requires-Dist: protobuf
|
99
|
+
Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'training'
|
100
100
|
Requires-Dist: tensorboard ; extra == 'training'
|
101
|
+
Requires-Dist: Jinja2 ; extra == 'training'
|
102
|
+
Requires-Dist: peft >=0.6.0 ; extra == 'training'
|
103
|
+
|
104
|
+
<!---
|
105
|
+
Copyright 2022 - The HuggingFace Team. All rights reserved.
|
106
|
+
|
107
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
108
|
+
you may not use this file except in compliance with the License.
|
109
|
+
You may obtain a copy of the License at
|
110
|
+
|
111
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
112
|
+
|
113
|
+
Unless required by applicable law or agreed to in writing, software
|
114
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
115
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
116
|
+
See the License for the specific language governing permissions and
|
117
|
+
limitations under the License.
|
118
|
+
-->
|
101
119
|
|
102
120
|
<p align="center">
|
103
121
|
<br>
|
@@ -115,7 +133,10 @@ Requires-Dist: tensorboard ; extra == 'training'
|
|
115
133
|
<img alt="GitHub release" src="https://static.pepy.tech/badge/diffusers/month">
|
116
134
|
</a>
|
117
135
|
<a href="CODE_OF_CONDUCT.md">
|
118
|
-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.
|
136
|
+
<img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg">
|
137
|
+
</a>
|
138
|
+
<a href="https://twitter.com/diffuserslib">
|
139
|
+
<img alt="X account" src="https://img.shields.io/twitter/url/https/twitter.com/diffuserslib.svg?style=social&label=Follow%20%40diffuserslib">
|
119
140
|
</a>
|
120
141
|
</p>
|
121
142
|
|
@@ -125,11 +146,11 @@ Requires-Dist: tensorboard ; extra == 'training'
|
|
125
146
|
|
126
147
|
- State-of-the-art [diffusion pipelines](https://huggingface.co/docs/diffusers/api/pipelines/overview) that can be run in inference with just a few lines of code.
|
127
148
|
- Interchangeable noise [schedulers](https://huggingface.co/docs/diffusers/api/schedulers/overview) for different diffusion speeds and output quality.
|
128
|
-
- Pretrained [models](https://huggingface.co/docs/diffusers/api/models) that can be used as building blocks, and combined with schedulers, for creating your own end-to-end diffusion systems.
|
149
|
+
- Pretrained [models](https://huggingface.co/docs/diffusers/api/models/overview) that can be used as building blocks, and combined with schedulers, for creating your own end-to-end diffusion systems.
|
129
150
|
|
130
151
|
## Installation
|
131
152
|
|
132
|
-
We recommend installing 🤗 Diffusers in a virtual environment from
|
153
|
+
We recommend installing 🤗 Diffusers in a virtual environment from PyPI or Conda. For more details about installing [PyTorch](https://pytorch.org/get-started/locally/) and [Flax](https://flax.readthedocs.io/en/latest/#installation), please refer to their official documentation.
|
133
154
|
|
134
155
|
### PyTorch
|
135
156
|
|
@@ -159,7 +180,7 @@ Please refer to the [How to use Stable Diffusion in Apple Silicon](https://huggi
|
|
159
180
|
|
160
181
|
## Quickstart
|
161
182
|
|
162
|
-
Generating outputs is super easy with 🤗 Diffusers. To generate an image from text, use the `from_pretrained` method to load any pretrained diffusion model (browse the [Hub](https://huggingface.co/models?library=diffusers&sort=downloads) for
|
183
|
+
Generating outputs is super easy with 🤗 Diffusers. To generate an image from text, use the `from_pretrained` method to load any pretrained diffusion model (browse the [Hub](https://huggingface.co/models?library=diffusers&sort=downloads) for 16000+ checkpoints):
|
163
184
|
|
164
185
|
```python
|
165
186
|
from diffusers import DiffusionPipeline
|
@@ -176,14 +197,13 @@ You can also dig into the models and schedulers toolbox to build your own diffus
|
|
176
197
|
from diffusers import DDPMScheduler, UNet2DModel
|
177
198
|
from PIL import Image
|
178
199
|
import torch
|
179
|
-
import numpy as np
|
180
200
|
|
181
201
|
scheduler = DDPMScheduler.from_pretrained("google/ddpm-cat-256")
|
182
202
|
model = UNet2DModel.from_pretrained("google/ddpm-cat-256").to("cuda")
|
183
203
|
scheduler.set_timesteps(50)
|
184
204
|
|
185
205
|
sample_size = model.config.sample_size
|
186
|
-
noise = torch.randn((1, 3, sample_size, sample_size)
|
206
|
+
noise = torch.randn((1, 3, sample_size, sample_size), device="cuda")
|
187
207
|
input = noise
|
188
208
|
|
189
209
|
for t in scheduler.timesteps:
|
@@ -218,8 +238,7 @@ You can look out for [issues](https://github.com/huggingface/diffusers/issues) y
|
|
218
238
|
- See [New model/pipeline](https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+pipeline%2Fmodel%22) to contribute exciting new diffusion models / diffusion pipelines
|
219
239
|
- See [New scheduler](https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+scheduler%22)
|
220
240
|
|
221
|
-
Also, say 👋 in our public Discord channel <a href="https://discord.gg/G7tWnz98XR"><img alt="Join us on Discord" src="https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white"></a>. We discuss the hottest trends about diffusion models, help each other with contributions, personal projects or
|
222
|
-
just hang out ☕.
|
241
|
+
Also, say 👋 in our public Discord channel <a href="https://discord.gg/G7tWnz98XR"><img alt="Join us on Discord" src="https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white"></a>. We discuss the hottest trends about diffusion models, help each other with contributions, personal projects or just hang out ☕.
|
223
242
|
|
224
243
|
|
225
244
|
## Popular Tasks & Pipelines
|
@@ -242,12 +261,12 @@ just hang out ☕.
|
|
242
261
|
</tr>
|
243
262
|
<tr>
|
244
263
|
<td>Text-to-Image</td>
|
245
|
-
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/unclip">
|
264
|
+
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/unclip">unCLIP</a></td>
|
246
265
|
<td><a href="https://huggingface.co/kakaobrain/karlo-v1-alpha"> kakaobrain/karlo-v1-alpha </a></td>
|
247
266
|
</tr>
|
248
267
|
<tr>
|
249
268
|
<td>Text-to-Image</td>
|
250
|
-
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/
|
269
|
+
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/deepfloyd_if">DeepFloyd IF</a></td>
|
251
270
|
<td><a href="https://huggingface.co/DeepFloyd/IF-I-XL-v1.0"> DeepFloyd/IF-I-XL-v1.0 </a></td>
|
252
271
|
</tr>
|
253
272
|
<tr>
|
@@ -257,12 +276,12 @@ just hang out ☕.
|
|
257
276
|
</tr>
|
258
277
|
<tr style="border-top: 2px solid black">
|
259
278
|
<td>Text-guided Image-to-Image</td>
|
260
|
-
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/
|
279
|
+
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/controlnet">ControlNet</a></td>
|
261
280
|
<td><a href="https://huggingface.co/lllyasviel/sd-controlnet-canny"> lllyasviel/sd-controlnet-canny </a></td>
|
262
281
|
</tr>
|
263
282
|
<tr>
|
264
283
|
<td>Text-guided Image-to-Image</td>
|
265
|
-
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/pix2pix">
|
284
|
+
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/pix2pix">InstructPix2Pix</a></td>
|
266
285
|
<td><a href="https://huggingface.co/timbrooks/instruct-pix2pix"> timbrooks/instruct-pix2pix </a></td>
|
267
286
|
</tr>
|
268
287
|
<tr>
|
@@ -272,7 +291,7 @@ just hang out ☕.
|
|
272
291
|
</tr>
|
273
292
|
<tr style="border-top: 2px solid black">
|
274
293
|
<td>Text-guided Image Inpainting</td>
|
275
|
-
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/inpaint">Stable Diffusion
|
294
|
+
<td><a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/inpaint">Stable Diffusion Inpainting</a></td>
|
276
295
|
<td><a href="https://huggingface.co/runwayml/stable-diffusion-inpainting"> runwayml/stable-diffusion-inpainting </a></td>
|
277
296
|
</tr>
|
278
297
|
<tr style="border-top: 2px solid black">
|
@@ -303,9 +322,9 @@ just hang out ☕.
|
|
303
322
|
- https://github.com/deep-floyd/IF
|
304
323
|
- https://github.com/bentoml/BentoML
|
305
324
|
- https://github.com/bmaltais/kohya_ss
|
306
|
-
- +
|
325
|
+
- +7000 other amazing GitHub repositories 💪
|
307
326
|
|
308
|
-
Thank you for using us
|
327
|
+
Thank you for using us ❤️.
|
309
328
|
|
310
329
|
## Credits
|
311
330
|
|
@@ -330,5 +349,3 @@ We also want to thank @heejkoo for the very helpful overview of papers, code and
|
|
330
349
|
howpublished = {\url{https://github.com/huggingface/diffusers}}
|
331
350
|
}
|
332
351
|
```
|
333
|
-
|
334
|
-
|