diffusers 0.24.0__py3-none-any.whl → 0.25.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- diffusers/__init__.py +11 -1
- diffusers/commands/fp16_safetensors.py +10 -11
- diffusers/configuration_utils.py +12 -8
- diffusers/dependency_versions_table.py +3 -2
- diffusers/experimental/rl/value_guided_sampling.py +1 -1
- diffusers/image_processor.py +286 -46
- diffusers/loaders/ip_adapter.py +11 -9
- diffusers/loaders/lora.py +198 -60
- diffusers/loaders/single_file.py +24 -18
- diffusers/loaders/textual_inversion.py +10 -14
- diffusers/loaders/unet.py +130 -37
- diffusers/models/__init__.py +18 -12
- diffusers/models/activations.py +9 -6
- diffusers/models/attention.py +137 -16
- diffusers/models/attention_processor.py +133 -46
- diffusers/models/autoencoders/__init__.py +5 -0
- diffusers/models/{autoencoder_asym_kl.py → autoencoders/autoencoder_asym_kl.py} +4 -4
- diffusers/models/{autoencoder_kl.py → autoencoders/autoencoder_kl.py} +45 -6
- diffusers/models/{autoencoder_kl_temporal_decoder.py → autoencoders/autoencoder_kl_temporal_decoder.py} +8 -8
- diffusers/models/{autoencoder_tiny.py → autoencoders/autoencoder_tiny.py} +4 -4
- diffusers/models/{consistency_decoder_vae.py → autoencoders/consistency_decoder_vae.py} +14 -14
- diffusers/models/{vae.py → autoencoders/vae.py} +9 -5
- diffusers/models/downsampling.py +338 -0
- diffusers/models/embeddings.py +112 -29
- diffusers/models/modeling_flax_utils.py +12 -7
- diffusers/models/modeling_utils.py +10 -10
- diffusers/models/normalization.py +108 -2
- diffusers/models/resnet.py +15 -699
- diffusers/models/transformer_2d.py +2 -2
- diffusers/models/unet_2d_condition.py +37 -0
- diffusers/models/{unet_kandi3.py → unet_kandinsky3.py} +105 -159
- diffusers/models/upsampling.py +454 -0
- diffusers/models/uvit_2d.py +471 -0
- diffusers/models/vq_model.py +9 -2
- diffusers/pipelines/__init__.py +81 -73
- 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 +38 -10
- diffusers/pipelines/auto_pipeline.py +17 -13
- diffusers/pipelines/controlnet/pipeline_controlnet.py +27 -10
- diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +47 -5
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +25 -8
- diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +4 -6
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +26 -10
- diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +4 -3
- 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 +91 -18
- diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/pipeline_alt_diffusion_img2img.py +91 -18
- 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 +4 -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 +7 -7
- diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py +55 -0
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_cycle_diffusion.py +16 -11
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_onnx_stable_diffusion_inpaint_legacy.py +6 -6
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_inpaint_legacy.py +11 -11
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_model_editing.py +16 -11
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_paradigms.py +10 -10
- diffusers/pipelines/{stable_diffusion → deprecated/stable_diffusion_variants}/pipeline_stable_diffusion_pix2pix_zero.py +13 -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 +54 -11
- 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 +6 -6
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_image_variation.py +6 -6
- diffusers/pipelines/{versatile_diffusion → deprecated/versatile_diffusion}/pipeline_versatile_diffusion_text_to_image.py +6 -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/kandinsky3/__init__.py +4 -4
- diffusers/pipelines/kandinsky3/convert_kandinsky3_unet.py +98 -0
- diffusers/pipelines/kandinsky3/{kandinsky3_pipeline.py → pipeline_kandinsky3.py} +172 -35
- diffusers/pipelines/kandinsky3/{kandinsky3img2img_pipeline.py → pipeline_kandinsky3_img2img.py} +228 -34
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +46 -5
- diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +47 -6
- diffusers/pipelines/onnx_utils.py +8 -5
- diffusers/pipelines/pipeline_flax_utils.py +7 -6
- diffusers/pipelines/pipeline_utils.py +32 -31
- diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py +51 -2
- diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +3 -3
- diffusers/pipelines/stable_diffusion/__init__.py +1 -72
- diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +67 -75
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +92 -8
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +92 -8
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +138 -10
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +57 -7
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py +3 -0
- diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +6 -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 +5 -2
- diffusers/pipelines/stable_diffusion_diffedit/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_diffedit}/pipeline_stable_diffusion_diffedit.py +2 -3
- diffusers/pipelines/stable_diffusion_gligen/__init__.py +50 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen.py +2 -2
- diffusers/pipelines/{stable_diffusion → stable_diffusion_gligen}/pipeline_stable_diffusion_gligen_text_image.py +3 -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 +6 -1
- diffusers/pipelines/stable_diffusion_ldm3d/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_ldm3d}/pipeline_stable_diffusion_ldm3d.py +50 -7
- diffusers/pipelines/stable_diffusion_panorama/__init__.py +48 -0
- diffusers/pipelines/{stable_diffusion → stable_diffusion_panorama}/pipeline_stable_diffusion_panorama.py +56 -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 +67 -10
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +97 -15
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +98 -14
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +97 -14
- diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +7 -5
- diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py +12 -9
- diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +6 -0
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +5 -0
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +5 -0
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +331 -9
- diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +468 -9
- 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/pipeline_wuerstchen_prior.py +4 -0
- diffusers/schedulers/__init__.py +2 -0
- diffusers/schedulers/scheduling_amused.py +162 -0
- diffusers/schedulers/scheduling_consistency_models.py +2 -0
- diffusers/schedulers/scheduling_ddim_inverse.py +1 -4
- diffusers/schedulers/scheduling_ddpm.py +46 -0
- diffusers/schedulers/scheduling_ddpm_parallel.py +46 -0
- diffusers/schedulers/scheduling_deis_multistep.py +13 -1
- diffusers/schedulers/scheduling_dpmsolver_multistep.py +13 -1
- diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +13 -1
- diffusers/schedulers/scheduling_dpmsolver_sde.py +2 -0
- diffusers/schedulers/scheduling_dpmsolver_singlestep.py +13 -1
- diffusers/schedulers/scheduling_euler_ancestral_discrete.py +58 -0
- diffusers/schedulers/scheduling_euler_discrete.py +62 -3
- diffusers/schedulers/scheduling_heun_discrete.py +2 -0
- diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +2 -0
- diffusers/schedulers/scheduling_k_dpm_2_discrete.py +2 -0
- diffusers/schedulers/scheduling_lms_discrete.py +2 -0
- diffusers/schedulers/scheduling_unipc_multistep.py +13 -1
- 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 +0 -2
- diffusers/utils/constants.py +2 -5
- diffusers/utils/dummy_pt_objects.py +30 -0
- diffusers/utils/dummy_torch_and_transformers_objects.py +45 -0
- diffusers/utils/dynamic_modules_utils.py +14 -18
- diffusers/utils/hub_utils.py +24 -36
- diffusers/utils/logging.py +1 -1
- diffusers/utils/state_dict_utils.py +8 -0
- diffusers/utils/testing_utils.py +199 -1
- diffusers/utils/torch_utils.py +3 -3
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/METADATA +55 -53
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/RECORD +174 -155
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/WHEEL +1 -1
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/entry_points.txt +0 -1
- /diffusers/pipelines/{alt_diffusion → deprecated/alt_diffusion}/modeling_roberta_series.py +0 -0
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/LICENSE +0 -0
- {diffusers-0.24.0.dist-info → diffusers-0.25.1.dist-info}/top_level.txt +0 -0
diffusers/utils/hub_utils.py
CHANGED
@@ -25,20 +25,21 @@ from typing import Dict, Optional, Union
|
|
25
25
|
from uuid import uuid4
|
26
26
|
|
27
27
|
from huggingface_hub import (
|
28
|
-
HfFolder,
|
29
28
|
ModelCard,
|
30
29
|
ModelCardData,
|
31
30
|
create_repo,
|
31
|
+
get_full_repo_name,
|
32
32
|
hf_hub_download,
|
33
33
|
upload_folder,
|
34
|
-
whoami,
|
35
34
|
)
|
35
|
+
from huggingface_hub.constants import HF_HUB_CACHE, HF_HUB_DISABLE_TELEMETRY, HF_HUB_OFFLINE
|
36
36
|
from huggingface_hub.file_download import REGEX_COMMIT_HASH
|
37
37
|
from huggingface_hub.utils import (
|
38
38
|
EntryNotFoundError,
|
39
39
|
RepositoryNotFoundError,
|
40
40
|
RevisionNotFoundError,
|
41
41
|
is_jinja_available,
|
42
|
+
validate_hf_hub_args,
|
42
43
|
)
|
43
44
|
from packaging import version
|
44
45
|
from requests import HTTPError
|
@@ -46,7 +47,6 @@ from requests import HTTPError
|
|
46
47
|
from .. import __version__
|
47
48
|
from .constants import (
|
48
49
|
DEPRECATED_REVISION_ARGS,
|
49
|
-
DIFFUSERS_CACHE,
|
50
50
|
HUGGINGFACE_CO_RESOLVE_ENDPOINT,
|
51
51
|
SAFETENSORS_WEIGHTS_NAME,
|
52
52
|
WEIGHTS_NAME,
|
@@ -69,9 +69,6 @@ logger = get_logger(__name__)
|
|
69
69
|
|
70
70
|
MODEL_CARD_TEMPLATE_PATH = Path(__file__).parent / "model_card_template.md"
|
71
71
|
SESSION_ID = uuid4().hex
|
72
|
-
HF_HUB_OFFLINE = os.getenv("HF_HUB_OFFLINE", "").upper() in ENV_VARS_TRUE_VALUES
|
73
|
-
DISABLE_TELEMETRY = os.getenv("DISABLE_TELEMETRY", "").upper() in ENV_VARS_TRUE_VALUES
|
74
|
-
HUGGINGFACE_CO_TELEMETRY = HUGGINGFACE_CO_RESOLVE_ENDPOINT + "/api/telemetry/"
|
75
72
|
|
76
73
|
|
77
74
|
def http_user_agent(user_agent: Union[Dict, str, None] = None) -> str:
|
@@ -79,7 +76,7 @@ def http_user_agent(user_agent: Union[Dict, str, None] = None) -> str:
|
|
79
76
|
Formats a user-agent string with basic info about a request.
|
80
77
|
"""
|
81
78
|
ua = f"diffusers/{__version__}; python/{sys.version.split()[0]}; session_id/{SESSION_ID}"
|
82
|
-
if
|
79
|
+
if HF_HUB_DISABLE_TELEMETRY or HF_HUB_OFFLINE:
|
83
80
|
return ua + "; telemetry/off"
|
84
81
|
if is_torch_available():
|
85
82
|
ua += f"; torch/{_torch_version}"
|
@@ -98,16 +95,6 @@ def http_user_agent(user_agent: Union[Dict, str, None] = None) -> str:
|
|
98
95
|
return ua
|
99
96
|
|
100
97
|
|
101
|
-
def get_full_repo_name(model_id: str, organization: Optional[str] = None, token: Optional[str] = None):
|
102
|
-
if token is None:
|
103
|
-
token = HfFolder.get_token()
|
104
|
-
if organization is None:
|
105
|
-
username = whoami(token)["name"]
|
106
|
-
return f"{username}/{model_id}"
|
107
|
-
else:
|
108
|
-
return f"{organization}/{model_id}"
|
109
|
-
|
110
|
-
|
111
98
|
def create_model_card(args, model_name):
|
112
99
|
if not is_jinja_available():
|
113
100
|
raise ValueError(
|
@@ -183,7 +170,7 @@ old_diffusers_cache = os.path.join(hf_cache_home, "diffusers")
|
|
183
170
|
|
184
171
|
def move_cache(old_cache_dir: Optional[str] = None, new_cache_dir: Optional[str] = None) -> None:
|
185
172
|
if new_cache_dir is None:
|
186
|
-
new_cache_dir =
|
173
|
+
new_cache_dir = HF_HUB_CACHE
|
187
174
|
if old_cache_dir is None:
|
188
175
|
old_cache_dir = old_diffusers_cache
|
189
176
|
|
@@ -203,7 +190,7 @@ def move_cache(old_cache_dir: Optional[str] = None, new_cache_dir: Optional[str]
|
|
203
190
|
# At this point, old_cache_dir contains symlinks to the new cache (it can still be used).
|
204
191
|
|
205
192
|
|
206
|
-
cache_version_file = os.path.join(
|
193
|
+
cache_version_file = os.path.join(HF_HUB_CACHE, "version_diffusers_cache.txt")
|
207
194
|
if not os.path.isfile(cache_version_file):
|
208
195
|
cache_version = 0
|
209
196
|
else:
|
@@ -233,12 +220,12 @@ if cache_version < 1:
|
|
233
220
|
|
234
221
|
if cache_version < 1:
|
235
222
|
try:
|
236
|
-
os.makedirs(
|
223
|
+
os.makedirs(HF_HUB_CACHE, exist_ok=True)
|
237
224
|
with open(cache_version_file, "w") as f:
|
238
225
|
f.write("1")
|
239
226
|
except Exception:
|
240
227
|
logger.warning(
|
241
|
-
f"There was a problem when trying to write in your cache folder ({
|
228
|
+
f"There was a problem when trying to write in your cache folder ({HF_HUB_CACHE}). Please, ensure "
|
242
229
|
"the directory exists and can be written to."
|
243
230
|
)
|
244
231
|
|
@@ -252,20 +239,21 @@ def _add_variant(weights_name: str, variant: Optional[str] = None) -> str:
|
|
252
239
|
return weights_name
|
253
240
|
|
254
241
|
|
242
|
+
@validate_hf_hub_args
|
255
243
|
def _get_model_file(
|
256
|
-
pretrained_model_name_or_path,
|
244
|
+
pretrained_model_name_or_path: Union[str, Path],
|
257
245
|
*,
|
258
|
-
weights_name,
|
259
|
-
subfolder,
|
260
|
-
cache_dir,
|
261
|
-
force_download,
|
262
|
-
proxies,
|
263
|
-
resume_download,
|
264
|
-
local_files_only,
|
265
|
-
|
266
|
-
user_agent,
|
267
|
-
revision,
|
268
|
-
commit_hash=None,
|
246
|
+
weights_name: str,
|
247
|
+
subfolder: Optional[str],
|
248
|
+
cache_dir: Optional[str],
|
249
|
+
force_download: bool,
|
250
|
+
proxies: Optional[Dict],
|
251
|
+
resume_download: bool,
|
252
|
+
local_files_only: bool,
|
253
|
+
token: Optional[str],
|
254
|
+
user_agent: Union[Dict, str, None],
|
255
|
+
revision: Optional[str],
|
256
|
+
commit_hash: Optional[str] = None,
|
269
257
|
):
|
270
258
|
pretrained_model_name_or_path = str(pretrained_model_name_or_path)
|
271
259
|
if os.path.isfile(pretrained_model_name_or_path):
|
@@ -300,7 +288,7 @@ def _get_model_file(
|
|
300
288
|
proxies=proxies,
|
301
289
|
resume_download=resume_download,
|
302
290
|
local_files_only=local_files_only,
|
303
|
-
|
291
|
+
token=token,
|
304
292
|
user_agent=user_agent,
|
305
293
|
subfolder=subfolder,
|
306
294
|
revision=revision or commit_hash,
|
@@ -325,7 +313,7 @@ def _get_model_file(
|
|
325
313
|
proxies=proxies,
|
326
314
|
resume_download=resume_download,
|
327
315
|
local_files_only=local_files_only,
|
328
|
-
|
316
|
+
token=token,
|
329
317
|
user_agent=user_agent,
|
330
318
|
subfolder=subfolder,
|
331
319
|
revision=revision or commit_hash,
|
@@ -336,7 +324,7 @@ def _get_model_file(
|
|
336
324
|
raise EnvironmentError(
|
337
325
|
f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier "
|
338
326
|
"listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a "
|
339
|
-
"token having permission to this repo with `
|
327
|
+
"token having permission to this repo with `token` or log in with `huggingface-cli "
|
340
328
|
"login`."
|
341
329
|
)
|
342
330
|
except RevisionNotFoundError:
|
diffusers/utils/logging.py
CHANGED
@@ -213,7 +213,7 @@ def remove_handler(handler: logging.Handler) -> None:
|
|
213
213
|
|
214
214
|
_configure_library_root_logger()
|
215
215
|
|
216
|
-
assert handler is not None and handler
|
216
|
+
assert handler is not None and handler in _get_library_root_logger().handlers
|
217
217
|
_get_library_root_logger().removeHandler(handler)
|
218
218
|
|
219
219
|
|
@@ -79,6 +79,14 @@ PEFT_TO_DIFFUSERS = {
|
|
79
79
|
".v_proj.lora_A": ".v_proj.lora_linear_layer.down",
|
80
80
|
".out_proj.lora_B": ".out_proj.lora_linear_layer.up",
|
81
81
|
".out_proj.lora_A": ".out_proj.lora_linear_layer.down",
|
82
|
+
"to_k.lora_A": "to_k.lora.down",
|
83
|
+
"to_k.lora_B": "to_k.lora.up",
|
84
|
+
"to_q.lora_A": "to_q.lora.down",
|
85
|
+
"to_q.lora_B": "to_q.lora.up",
|
86
|
+
"to_v.lora_A": "to_v.lora.down",
|
87
|
+
"to_v.lora_B": "to_v.lora.up",
|
88
|
+
"to_out.0.lora_A": "to_out.0.lora.down",
|
89
|
+
"to_out.0.lora_B": "to_out.0.lora.up",
|
82
90
|
}
|
83
91
|
|
84
92
|
DIFFUSERS_OLD_TO_DIFFUSERS = {
|
diffusers/utils/testing_utils.py
CHANGED
@@ -17,7 +17,7 @@ from contextlib import contextmanager
|
|
17
17
|
from distutils.util import strtobool
|
18
18
|
from io import BytesIO, StringIO
|
19
19
|
from pathlib import Path
|
20
|
-
from typing import List, Optional, Union
|
20
|
+
from typing import Callable, Dict, List, Optional, Union
|
21
21
|
|
22
22
|
import numpy as np
|
23
23
|
import PIL.Image
|
@@ -58,6 +58,17 @@ USE_PEFT_BACKEND = _required_peft_version and _required_transformers_version
|
|
58
58
|
if is_torch_available():
|
59
59
|
import torch
|
60
60
|
|
61
|
+
# Set a backend environment variable for any extra module import required for a custom accelerator
|
62
|
+
if "DIFFUSERS_TEST_BACKEND" in os.environ:
|
63
|
+
backend = os.environ["DIFFUSERS_TEST_BACKEND"]
|
64
|
+
try:
|
65
|
+
_ = importlib.import_module(backend)
|
66
|
+
except ModuleNotFoundError as e:
|
67
|
+
raise ModuleNotFoundError(
|
68
|
+
f"Failed to import `DIFFUSERS_TEST_BACKEND` '{backend}'! This should be the name of an installed module \
|
69
|
+
to enable a specified backend.):\n{e}"
|
70
|
+
) from e
|
71
|
+
|
61
72
|
if "DIFFUSERS_TEST_DEVICE" in os.environ:
|
62
73
|
torch_device = os.environ["DIFFUSERS_TEST_DEVICE"]
|
63
74
|
try:
|
@@ -210,6 +221,36 @@ def require_torch_gpu(test_case):
|
|
210
221
|
)
|
211
222
|
|
212
223
|
|
224
|
+
# These decorators are for accelerator-specific behaviours that are not GPU-specific
|
225
|
+
def require_torch_accelerator(test_case):
|
226
|
+
"""Decorator marking a test that requires an accelerator backend and PyTorch."""
|
227
|
+
return unittest.skipUnless(is_torch_available() and torch_device != "cpu", "test requires accelerator+PyTorch")(
|
228
|
+
test_case
|
229
|
+
)
|
230
|
+
|
231
|
+
|
232
|
+
def require_torch_accelerator_with_fp16(test_case):
|
233
|
+
"""Decorator marking a test that requires an accelerator with support for the FP16 data type."""
|
234
|
+
return unittest.skipUnless(_is_torch_fp16_available(torch_device), "test requires accelerator with fp16 support")(
|
235
|
+
test_case
|
236
|
+
)
|
237
|
+
|
238
|
+
|
239
|
+
def require_torch_accelerator_with_fp64(test_case):
|
240
|
+
"""Decorator marking a test that requires an accelerator with support for the FP64 data type."""
|
241
|
+
return unittest.skipUnless(_is_torch_fp64_available(torch_device), "test requires accelerator with fp64 support")(
|
242
|
+
test_case
|
243
|
+
)
|
244
|
+
|
245
|
+
|
246
|
+
def require_torch_accelerator_with_training(test_case):
|
247
|
+
"""Decorator marking a test that requires an accelerator with support for training."""
|
248
|
+
return unittest.skipUnless(
|
249
|
+
is_torch_available() and backend_supports_training(torch_device),
|
250
|
+
"test requires accelerator with training support",
|
251
|
+
)(test_case)
|
252
|
+
|
253
|
+
|
213
254
|
def skip_mps(test_case):
|
214
255
|
"""Decorator marking a test to skip if torch_device is 'mps'"""
|
215
256
|
return unittest.skipUnless(torch_device != "mps", "test requires non 'mps' device")(test_case)
|
@@ -259,6 +300,23 @@ def require_peft_backend(test_case):
|
|
259
300
|
return unittest.skipUnless(USE_PEFT_BACKEND, "test requires PEFT backend")(test_case)
|
260
301
|
|
261
302
|
|
303
|
+
def require_peft_version_greater(peft_version):
|
304
|
+
"""
|
305
|
+
Decorator marking a test that requires PEFT backend with a specific version, this would require some specific
|
306
|
+
versions of PEFT and transformers.
|
307
|
+
"""
|
308
|
+
|
309
|
+
def decorator(test_case):
|
310
|
+
correct_peft_version = is_peft_available() and version.parse(
|
311
|
+
version.parse(importlib.metadata.version("peft")).base_version
|
312
|
+
) > version.parse(peft_version)
|
313
|
+
return unittest.skipUnless(
|
314
|
+
correct_peft_version, f"test requires PEFT backend with the version greater than {peft_version}"
|
315
|
+
)(test_case)
|
316
|
+
|
317
|
+
return decorator
|
318
|
+
|
319
|
+
|
262
320
|
def deprecate_after_peft_backend(test_case):
|
263
321
|
"""
|
264
322
|
Decorator marking a test that will be skipped after PEFT backend
|
@@ -766,3 +824,143 @@ def disable_full_determinism():
|
|
766
824
|
os.environ["CUDA_LAUNCH_BLOCKING"] = "0"
|
767
825
|
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ""
|
768
826
|
torch.use_deterministic_algorithms(False)
|
827
|
+
|
828
|
+
|
829
|
+
# Utils for custom and alternative accelerator devices
|
830
|
+
def _is_torch_fp16_available(device):
|
831
|
+
if not is_torch_available():
|
832
|
+
return False
|
833
|
+
|
834
|
+
import torch
|
835
|
+
|
836
|
+
device = torch.device(device)
|
837
|
+
|
838
|
+
try:
|
839
|
+
x = torch.zeros((2, 2), dtype=torch.float16).to(device)
|
840
|
+
_ = torch.mul(x, x)
|
841
|
+
return True
|
842
|
+
|
843
|
+
except Exception as e:
|
844
|
+
if device.type == "cuda":
|
845
|
+
raise ValueError(
|
846
|
+
f"You have passed a device of type 'cuda' which should work with 'fp16', but 'cuda' does not seem to be correctly installed on your machine: {e}"
|
847
|
+
)
|
848
|
+
|
849
|
+
return False
|
850
|
+
|
851
|
+
|
852
|
+
def _is_torch_fp64_available(device):
|
853
|
+
if not is_torch_available():
|
854
|
+
return False
|
855
|
+
|
856
|
+
import torch
|
857
|
+
|
858
|
+
try:
|
859
|
+
x = torch.zeros((2, 2), dtype=torch.float64).to(device)
|
860
|
+
_ = torch.mul(x, x)
|
861
|
+
return True
|
862
|
+
|
863
|
+
except Exception as e:
|
864
|
+
if device.type == "cuda":
|
865
|
+
raise ValueError(
|
866
|
+
f"You have passed a device of type 'cuda' which should work with 'fp64', but 'cuda' does not seem to be correctly installed on your machine: {e}"
|
867
|
+
)
|
868
|
+
|
869
|
+
return False
|
870
|
+
|
871
|
+
|
872
|
+
# Guard these lookups for when Torch is not used - alternative accelerator support is for PyTorch
|
873
|
+
if is_torch_available():
|
874
|
+
# Behaviour flags
|
875
|
+
BACKEND_SUPPORTS_TRAINING = {"cuda": True, "cpu": True, "mps": False, "default": True}
|
876
|
+
|
877
|
+
# Function definitions
|
878
|
+
BACKEND_EMPTY_CACHE = {"cuda": torch.cuda.empty_cache, "cpu": None, "mps": None, "default": None}
|
879
|
+
BACKEND_DEVICE_COUNT = {"cuda": torch.cuda.device_count, "cpu": lambda: 0, "mps": lambda: 0, "default": 0}
|
880
|
+
BACKEND_MANUAL_SEED = {"cuda": torch.cuda.manual_seed, "cpu": torch.manual_seed, "default": torch.manual_seed}
|
881
|
+
|
882
|
+
|
883
|
+
# This dispatches a defined function according to the accelerator from the function definitions.
|
884
|
+
def _device_agnostic_dispatch(device: str, dispatch_table: Dict[str, Callable], *args, **kwargs):
|
885
|
+
if device not in dispatch_table:
|
886
|
+
return dispatch_table["default"](*args, **kwargs)
|
887
|
+
|
888
|
+
fn = dispatch_table[device]
|
889
|
+
|
890
|
+
# Some device agnostic functions return values. Need to guard against 'None' instead at
|
891
|
+
# user level
|
892
|
+
if fn is None:
|
893
|
+
return None
|
894
|
+
|
895
|
+
return fn(*args, **kwargs)
|
896
|
+
|
897
|
+
|
898
|
+
# These are callables which automatically dispatch the function specific to the accelerator
|
899
|
+
def backend_manual_seed(device: str, seed: int):
|
900
|
+
return _device_agnostic_dispatch(device, BACKEND_MANUAL_SEED, seed)
|
901
|
+
|
902
|
+
|
903
|
+
def backend_empty_cache(device: str):
|
904
|
+
return _device_agnostic_dispatch(device, BACKEND_EMPTY_CACHE)
|
905
|
+
|
906
|
+
|
907
|
+
def backend_device_count(device: str):
|
908
|
+
return _device_agnostic_dispatch(device, BACKEND_DEVICE_COUNT)
|
909
|
+
|
910
|
+
|
911
|
+
# These are callables which return boolean behaviour flags and can be used to specify some
|
912
|
+
# device agnostic alternative where the feature is unsupported.
|
913
|
+
def backend_supports_training(device: str):
|
914
|
+
if not is_torch_available():
|
915
|
+
return False
|
916
|
+
|
917
|
+
if device not in BACKEND_SUPPORTS_TRAINING:
|
918
|
+
device = "default"
|
919
|
+
|
920
|
+
return BACKEND_SUPPORTS_TRAINING[device]
|
921
|
+
|
922
|
+
|
923
|
+
# Guard for when Torch is not available
|
924
|
+
if is_torch_available():
|
925
|
+
# Update device function dict mapping
|
926
|
+
def update_mapping_from_spec(device_fn_dict: Dict[str, Callable], attribute_name: str):
|
927
|
+
try:
|
928
|
+
# Try to import the function directly
|
929
|
+
spec_fn = getattr(device_spec_module, attribute_name)
|
930
|
+
device_fn_dict[torch_device] = spec_fn
|
931
|
+
except AttributeError as e:
|
932
|
+
# If the function doesn't exist, and there is no default, throw an error
|
933
|
+
if "default" not in device_fn_dict:
|
934
|
+
raise AttributeError(
|
935
|
+
f"`{attribute_name}` not found in '{device_spec_path}' and no default fallback function found."
|
936
|
+
) from e
|
937
|
+
|
938
|
+
if "DIFFUSERS_TEST_DEVICE_SPEC" in os.environ:
|
939
|
+
device_spec_path = os.environ["DIFFUSERS_TEST_DEVICE_SPEC"]
|
940
|
+
if not Path(device_spec_path).is_file():
|
941
|
+
raise ValueError(f"Specified path to device specification file is not found. Received {device_spec_path}")
|
942
|
+
|
943
|
+
try:
|
944
|
+
import_name = device_spec_path[: device_spec_path.index(".py")]
|
945
|
+
except ValueError as e:
|
946
|
+
raise ValueError(f"Provided device spec file is not a Python file! Received {device_spec_path}") from e
|
947
|
+
|
948
|
+
device_spec_module = importlib.import_module(import_name)
|
949
|
+
|
950
|
+
try:
|
951
|
+
device_name = device_spec_module.DEVICE_NAME
|
952
|
+
except AttributeError:
|
953
|
+
raise AttributeError("Device spec file did not contain `DEVICE_NAME`")
|
954
|
+
|
955
|
+
if "DIFFUSERS_TEST_DEVICE" in os.environ and torch_device != device_name:
|
956
|
+
msg = f"Mismatch between environment variable `DIFFUSERS_TEST_DEVICE` '{torch_device}' and device found in spec '{device_name}'\n"
|
957
|
+
msg += "Either unset `DIFFUSERS_TEST_DEVICE` or ensure it matches device spec name."
|
958
|
+
raise ValueError(msg)
|
959
|
+
|
960
|
+
torch_device = device_name
|
961
|
+
|
962
|
+
# Add one entry here for each `BACKEND_*` dictionary.
|
963
|
+
update_mapping_from_spec(BACKEND_MANUAL_SEED, "MANUAL_SEED_FN")
|
964
|
+
update_mapping_from_spec(BACKEND_EMPTY_CACHE, "EMPTY_CACHE_FN")
|
965
|
+
update_mapping_from_spec(BACKEND_DEVICE_COUNT, "DEVICE_COUNT_FN")
|
966
|
+
update_mapping_from_spec(BACKEND_SUPPORTS_TRAINING, "SUPPORTS_TRAINING")
|
diffusers/utils/torch_utils.py
CHANGED
@@ -89,7 +89,7 @@ def is_compiled_module(module) -> bool:
|
|
89
89
|
return isinstance(module, torch._dynamo.eval_frame.OptimizedModule)
|
90
90
|
|
91
91
|
|
92
|
-
def fourier_filter(x_in: torch.Tensor, threshold: int, scale: int) -> torch.Tensor:
|
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: torch.Tensor, threshold: int, scale: int) -> torch.Tens
|
|
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,13 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: diffusers
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.25.1
|
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
|
@@ -19,84 +18,89 @@ Classifier: Programming Language :: Python :: 3
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.8
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
22
22
|
Requires-Python: >=3.8.0
|
23
23
|
Description-Content-Type: text/markdown
|
24
24
|
License-File: LICENSE
|
25
|
-
Requires-Dist: Pillow
|
26
|
-
Requires-Dist: filelock
|
27
|
-
Requires-Dist: huggingface-hub (>=0.19.4)
|
28
25
|
Requires-Dist: importlib-metadata
|
26
|
+
Requires-Dist: filelock
|
27
|
+
Requires-Dist: huggingface-hub >=0.20.2
|
29
28
|
Requires-Dist: numpy
|
30
|
-
Requires-Dist: regex
|
29
|
+
Requires-Dist: regex !=2019.12.17
|
31
30
|
Requires-Dist: requests
|
32
|
-
Requires-Dist: safetensors
|
31
|
+
Requires-Dist: safetensors >=0.3.1
|
32
|
+
Requires-Dist: Pillow
|
33
33
|
Provides-Extra: dev
|
34
|
-
Requires-Dist:
|
35
|
-
Requires-Dist:
|
36
|
-
Requires-Dist:
|
34
|
+
Requires-Dist: urllib3 <=2.0.0 ; extra == 'dev'
|
35
|
+
Requires-Dist: isort >=5.5.4 ; extra == 'dev'
|
36
|
+
Requires-Dist: ruff ==0.1.5 ; extra == 'dev'
|
37
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'dev'
|
38
|
+
Requires-Dist: compel ==0.1.8 ; extra == 'dev'
|
39
|
+
Requires-Dist: GitPython <3.1.19 ; extra == 'dev'
|
37
40
|
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'
|
41
|
+
Requires-Dist: Jinja2 ; extra == 'dev'
|
42
|
+
Requires-Dist: invisible-watermark >=0.2.0 ; extra == 'dev'
|
43
|
+
Requires-Dist: k-diffusion >=0.0.12 ; extra == 'dev'
|
45
44
|
Requires-Dist: librosa ; extra == 'dev'
|
46
45
|
Requires-Dist: omegaconf ; extra == 'dev'
|
47
46
|
Requires-Dist: parameterized ; extra == 'dev'
|
48
|
-
Requires-Dist: protobuf (<4,>=3.20.3) ; extra == 'dev'
|
49
47
|
Requires-Dist: pytest ; extra == 'dev'
|
50
48
|
Requires-Dist: pytest-timeout ; extra == 'dev'
|
51
49
|
Requires-Dist: pytest-xdist ; extra == 'dev'
|
52
|
-
Requires-Dist: requests-mock
|
53
|
-
Requires-Dist:
|
54
|
-
Requires-Dist:
|
50
|
+
Requires-Dist: requests-mock ==1.10.0 ; extra == 'dev'
|
51
|
+
Requires-Dist: safetensors >=0.3.1 ; extra == 'dev'
|
52
|
+
Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'dev'
|
55
53
|
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
54
|
Requires-Dist: torchvision ; extra == 'dev'
|
60
|
-
Requires-Dist: transformers
|
61
|
-
Requires-Dist:
|
55
|
+
Requires-Dist: transformers >=4.25.1 ; extra == 'dev'
|
56
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'dev'
|
57
|
+
Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'dev'
|
58
|
+
Requires-Dist: tensorboard ; extra == 'dev'
|
59
|
+
Requires-Dist: peft >=0.6.0 ; extra == 'dev'
|
60
|
+
Requires-Dist: torch >=1.4 ; extra == 'dev'
|
61
|
+
Requires-Dist: jax >=0.4.1 ; extra == 'dev'
|
62
|
+
Requires-Dist: jaxlib >=0.4.1 ; extra == 'dev'
|
63
|
+
Requires-Dist: flax >=0.4.1 ; extra == 'dev'
|
62
64
|
Provides-Extra: docs
|
63
|
-
Requires-Dist: hf-doc-builder
|
65
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'docs'
|
64
66
|
Provides-Extra: flax
|
65
|
-
Requires-Dist:
|
66
|
-
Requires-Dist:
|
67
|
-
Requires-Dist:
|
67
|
+
Requires-Dist: jax >=0.4.1 ; extra == 'flax'
|
68
|
+
Requires-Dist: jaxlib >=0.4.1 ; extra == 'flax'
|
69
|
+
Requires-Dist: flax >=0.4.1 ; extra == 'flax'
|
68
70
|
Provides-Extra: quality
|
69
|
-
Requires-Dist:
|
70
|
-
Requires-Dist: isort
|
71
|
-
Requires-Dist: ruff
|
72
|
-
Requires-Dist:
|
71
|
+
Requires-Dist: urllib3 <=2.0.0 ; extra == 'quality'
|
72
|
+
Requires-Dist: isort >=5.5.4 ; extra == 'quality'
|
73
|
+
Requires-Dist: ruff ==0.1.5 ; extra == 'quality'
|
74
|
+
Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'quality'
|
73
75
|
Provides-Extra: test
|
74
|
-
Requires-Dist:
|
75
|
-
Requires-Dist:
|
76
|
+
Requires-Dist: compel ==0.1.8 ; extra == 'test'
|
77
|
+
Requires-Dist: GitPython <3.1.19 ; extra == 'test'
|
76
78
|
Requires-Dist: datasets ; extra == 'test'
|
77
|
-
Requires-Dist:
|
78
|
-
Requires-Dist:
|
79
|
+
Requires-Dist: Jinja2 ; extra == 'test'
|
80
|
+
Requires-Dist: invisible-watermark >=0.2.0 ; extra == 'test'
|
81
|
+
Requires-Dist: k-diffusion >=0.0.12 ; extra == 'test'
|
79
82
|
Requires-Dist: librosa ; extra == 'test'
|
80
83
|
Requires-Dist: omegaconf ; extra == 'test'
|
81
84
|
Requires-Dist: parameterized ; extra == 'test'
|
82
85
|
Requires-Dist: pytest ; extra == 'test'
|
83
86
|
Requires-Dist: pytest-timeout ; extra == 'test'
|
84
87
|
Requires-Dist: pytest-xdist ; extra == 'test'
|
85
|
-
Requires-Dist: requests-mock
|
86
|
-
Requires-Dist: safetensors
|
88
|
+
Requires-Dist: requests-mock ==1.10.0 ; extra == 'test'
|
89
|
+
Requires-Dist: safetensors >=0.3.1 ; extra == 'test'
|
90
|
+
Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'test'
|
87
91
|
Requires-Dist: scipy ; extra == 'test'
|
88
|
-
Requires-Dist: sentencepiece (!=0.1.92,>=0.1.91) ; extra == 'test'
|
89
92
|
Requires-Dist: torchvision ; extra == 'test'
|
90
|
-
Requires-Dist: transformers
|
93
|
+
Requires-Dist: transformers >=4.25.1 ; extra == 'test'
|
91
94
|
Provides-Extra: torch
|
92
|
-
Requires-Dist:
|
93
|
-
Requires-Dist:
|
95
|
+
Requires-Dist: torch >=1.4 ; extra == 'torch'
|
96
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'torch'
|
94
97
|
Provides-Extra: training
|
95
|
-
Requires-Dist:
|
96
|
-
Requires-Dist: accelerate (>=0.11.0) ; extra == 'training'
|
98
|
+
Requires-Dist: accelerate >=0.11.0 ; extra == 'training'
|
97
99
|
Requires-Dist: datasets ; extra == 'training'
|
98
|
-
Requires-Dist: protobuf
|
100
|
+
Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'training'
|
99
101
|
Requires-Dist: tensorboard ; extra == 'training'
|
102
|
+
Requires-Dist: Jinja2 ; extra == 'training'
|
103
|
+
Requires-Dist: peft >=0.6.0 ; extra == 'training'
|
100
104
|
|
101
105
|
<!---
|
102
106
|
Copyright 2022 - The HuggingFace Team. All rights reserved.
|
@@ -177,7 +181,7 @@ Please refer to the [How to use Stable Diffusion in Apple Silicon](https://huggi
|
|
177
181
|
|
178
182
|
## Quickstart
|
179
183
|
|
180
|
-
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
|
184
|
+
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):
|
181
185
|
|
182
186
|
```python
|
183
187
|
from diffusers import DiffusionPipeline
|
@@ -319,7 +323,7 @@ Also, say 👋 in our public Discord channel <a href="https://discord.gg/G7tWnz9
|
|
319
323
|
- https://github.com/deep-floyd/IF
|
320
324
|
- https://github.com/bentoml/BentoML
|
321
325
|
- https://github.com/bmaltais/kohya_ss
|
322
|
-
- +
|
326
|
+
- +7000 other amazing GitHub repositories 💪
|
323
327
|
|
324
328
|
Thank you for using us ❤️.
|
325
329
|
|
@@ -346,5 +350,3 @@ We also want to thank @heejkoo for the very helpful overview of papers, code and
|
|
346
350
|
howpublished = {\url{https://github.com/huggingface/diffusers}}
|
347
351
|
}
|
348
352
|
```
|
349
|
-
|
350
|
-
|