diffusers 0.29.2__py3-none-any.whl → 0.30.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. diffusers/__init__.py +94 -3
  2. diffusers/commands/env.py +1 -5
  3. diffusers/configuration_utils.py +4 -9
  4. diffusers/dependency_versions_table.py +2 -2
  5. diffusers/image_processor.py +1 -2
  6. diffusers/loaders/__init__.py +17 -2
  7. diffusers/loaders/ip_adapter.py +10 -7
  8. diffusers/loaders/lora_base.py +752 -0
  9. diffusers/loaders/lora_pipeline.py +2252 -0
  10. diffusers/loaders/peft.py +213 -5
  11. diffusers/loaders/single_file.py +3 -14
  12. diffusers/loaders/single_file_model.py +31 -10
  13. diffusers/loaders/single_file_utils.py +293 -8
  14. diffusers/loaders/textual_inversion.py +1 -6
  15. diffusers/loaders/unet.py +23 -208
  16. diffusers/models/__init__.py +20 -0
  17. diffusers/models/activations.py +22 -0
  18. diffusers/models/attention.py +386 -7
  19. diffusers/models/attention_processor.py +1937 -629
  20. diffusers/models/autoencoders/__init__.py +2 -0
  21. diffusers/models/autoencoders/autoencoder_kl.py +14 -3
  22. diffusers/models/autoencoders/autoencoder_kl_cogvideox.py +1271 -0
  23. diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py +1 -1
  24. diffusers/models/autoencoders/autoencoder_oobleck.py +464 -0
  25. diffusers/models/autoencoders/autoencoder_tiny.py +1 -0
  26. diffusers/models/autoencoders/consistency_decoder_vae.py +1 -1
  27. diffusers/models/autoencoders/vq_model.py +4 -4
  28. diffusers/models/controlnet.py +2 -3
  29. diffusers/models/controlnet_hunyuan.py +401 -0
  30. diffusers/models/controlnet_sd3.py +11 -11
  31. diffusers/models/controlnet_sparsectrl.py +789 -0
  32. diffusers/models/controlnet_xs.py +40 -10
  33. diffusers/models/downsampling.py +68 -0
  34. diffusers/models/embeddings.py +403 -36
  35. diffusers/models/model_loading_utils.py +1 -3
  36. diffusers/models/modeling_flax_utils.py +1 -6
  37. diffusers/models/modeling_utils.py +4 -16
  38. diffusers/models/normalization.py +203 -12
  39. diffusers/models/transformers/__init__.py +6 -0
  40. diffusers/models/transformers/auraflow_transformer_2d.py +543 -0
  41. diffusers/models/transformers/cogvideox_transformer_3d.py +485 -0
  42. diffusers/models/transformers/hunyuan_transformer_2d.py +19 -15
  43. diffusers/models/transformers/latte_transformer_3d.py +327 -0
  44. diffusers/models/transformers/lumina_nextdit2d.py +340 -0
  45. diffusers/models/transformers/pixart_transformer_2d.py +102 -1
  46. diffusers/models/transformers/prior_transformer.py +1 -1
  47. diffusers/models/transformers/stable_audio_transformer.py +458 -0
  48. diffusers/models/transformers/transformer_flux.py +455 -0
  49. diffusers/models/transformers/transformer_sd3.py +18 -4
  50. diffusers/models/unets/unet_1d_blocks.py +1 -1
  51. diffusers/models/unets/unet_2d_condition.py +8 -1
  52. diffusers/models/unets/unet_3d_blocks.py +51 -920
  53. diffusers/models/unets/unet_3d_condition.py +4 -1
  54. diffusers/models/unets/unet_i2vgen_xl.py +4 -1
  55. diffusers/models/unets/unet_kandinsky3.py +1 -1
  56. diffusers/models/unets/unet_motion_model.py +1330 -84
  57. diffusers/models/unets/unet_spatio_temporal_condition.py +1 -1
  58. diffusers/models/unets/unet_stable_cascade.py +1 -3
  59. diffusers/models/unets/uvit_2d.py +1 -1
  60. diffusers/models/upsampling.py +64 -0
  61. diffusers/models/vq_model.py +8 -4
  62. diffusers/optimization.py +1 -1
  63. diffusers/pipelines/__init__.py +100 -3
  64. diffusers/pipelines/animatediff/__init__.py +4 -0
  65. diffusers/pipelines/animatediff/pipeline_animatediff.py +50 -40
  66. diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py +1076 -0
  67. diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py +17 -27
  68. diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py +1008 -0
  69. diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py +51 -38
  70. diffusers/pipelines/audioldm2/modeling_audioldm2.py +1 -1
  71. diffusers/pipelines/audioldm2/pipeline_audioldm2.py +1 -0
  72. diffusers/pipelines/aura_flow/__init__.py +48 -0
  73. diffusers/pipelines/aura_flow/pipeline_aura_flow.py +591 -0
  74. diffusers/pipelines/auto_pipeline.py +97 -19
  75. diffusers/pipelines/cogvideo/__init__.py +48 -0
  76. diffusers/pipelines/cogvideo/pipeline_cogvideox.py +746 -0
  77. diffusers/pipelines/consistency_models/pipeline_consistency_models.py +1 -1
  78. diffusers/pipelines/controlnet/pipeline_controlnet.py +24 -30
  79. diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +31 -30
  80. diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +24 -153
  81. diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +19 -28
  82. diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py +18 -28
  83. diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py +29 -32
  84. diffusers/pipelines/controlnet/pipeline_flax_controlnet.py +2 -2
  85. diffusers/pipelines/controlnet_hunyuandit/__init__.py +48 -0
  86. diffusers/pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py +1042 -0
  87. diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet.py +35 -0
  88. diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs.py +10 -6
  89. diffusers/pipelines/controlnet_xs/pipeline_controlnet_xs_sd_xl.py +0 -4
  90. diffusers/pipelines/deepfloyd_if/pipeline_if.py +2 -2
  91. diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py +2 -2
  92. diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py +2 -2
  93. diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py +2 -2
  94. diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py +2 -2
  95. diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py +2 -2
  96. diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py +11 -6
  97. diffusers/pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py +11 -6
  98. diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_cycle_diffusion.py +6 -6
  99. diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py +6 -6
  100. diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_model_editing.py +10 -10
  101. diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py +10 -6
  102. diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py +3 -3
  103. diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py +1 -1
  104. diffusers/pipelines/flux/__init__.py +47 -0
  105. diffusers/pipelines/flux/pipeline_flux.py +749 -0
  106. diffusers/pipelines/flux/pipeline_output.py +21 -0
  107. diffusers/pipelines/free_init_utils.py +2 -0
  108. diffusers/pipelines/free_noise_utils.py +236 -0
  109. diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py +2 -2
  110. diffusers/pipelines/kandinsky3/pipeline_kandinsky3_img2img.py +2 -2
  111. diffusers/pipelines/kolors/__init__.py +54 -0
  112. diffusers/pipelines/kolors/pipeline_kolors.py +1070 -0
  113. diffusers/pipelines/kolors/pipeline_kolors_img2img.py +1247 -0
  114. diffusers/pipelines/kolors/pipeline_output.py +21 -0
  115. diffusers/pipelines/kolors/text_encoder.py +889 -0
  116. diffusers/pipelines/kolors/tokenizer.py +334 -0
  117. diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_img2img.py +30 -29
  118. diffusers/pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py +23 -29
  119. diffusers/pipelines/latte/__init__.py +48 -0
  120. diffusers/pipelines/latte/pipeline_latte.py +881 -0
  121. diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py +4 -4
  122. diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py +0 -4
  123. diffusers/pipelines/lumina/__init__.py +48 -0
  124. diffusers/pipelines/lumina/pipeline_lumina.py +897 -0
  125. diffusers/pipelines/pag/__init__.py +67 -0
  126. diffusers/pipelines/pag/pag_utils.py +237 -0
  127. diffusers/pipelines/pag/pipeline_pag_controlnet_sd.py +1329 -0
  128. diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py +1612 -0
  129. diffusers/pipelines/pag/pipeline_pag_hunyuandit.py +953 -0
  130. diffusers/pipelines/pag/pipeline_pag_kolors.py +1136 -0
  131. diffusers/pipelines/pag/pipeline_pag_pixart_sigma.py +872 -0
  132. diffusers/pipelines/pag/pipeline_pag_sd.py +1050 -0
  133. diffusers/pipelines/pag/pipeline_pag_sd_3.py +985 -0
  134. diffusers/pipelines/pag/pipeline_pag_sd_animatediff.py +862 -0
  135. diffusers/pipelines/pag/pipeline_pag_sd_xl.py +1333 -0
  136. diffusers/pipelines/pag/pipeline_pag_sd_xl_img2img.py +1529 -0
  137. diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py +1753 -0
  138. diffusers/pipelines/pia/pipeline_pia.py +30 -37
  139. diffusers/pipelines/pipeline_flax_utils.py +4 -9
  140. diffusers/pipelines/pipeline_loading_utils.py +0 -3
  141. diffusers/pipelines/pipeline_utils.py +2 -14
  142. diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py +0 -1
  143. diffusers/pipelines/stable_audio/__init__.py +50 -0
  144. diffusers/pipelines/stable_audio/modeling_stable_audio.py +158 -0
  145. diffusers/pipelines/stable_audio/pipeline_stable_audio.py +745 -0
  146. diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +2 -0
  147. diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py +1 -1
  148. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +23 -29
  149. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py +15 -8
  150. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +30 -29
  151. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +23 -152
  152. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +8 -4
  153. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +11 -11
  154. diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py +8 -6
  155. diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py +6 -6
  156. diffusers/pipelines/stable_diffusion_3/__init__.py +2 -0
  157. diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py +34 -3
  158. diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py +33 -7
  159. diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py +1201 -0
  160. diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py +3 -3
  161. diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py +6 -6
  162. diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py +5 -5
  163. diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py +5 -5
  164. diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py +6 -6
  165. diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py +0 -4
  166. diffusers/pipelines/stable_diffusion_ldm3d/pipeline_stable_diffusion_ldm3d.py +23 -29
  167. diffusers/pipelines/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py +27 -29
  168. diffusers/pipelines/stable_diffusion_sag/pipeline_stable_diffusion_sag.py +3 -3
  169. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +17 -27
  170. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +26 -29
  171. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +17 -145
  172. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py +0 -4
  173. diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py +6 -6
  174. diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py +18 -28
  175. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +8 -6
  176. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +8 -6
  177. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +6 -4
  178. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py +0 -4
  179. diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py +3 -3
  180. diffusers/pipelines/wuerstchen/modeling_wuerstchen_prior.py +1 -1
  181. diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py +5 -4
  182. diffusers/schedulers/__init__.py +8 -0
  183. diffusers/schedulers/scheduling_cosine_dpmsolver_multistep.py +572 -0
  184. diffusers/schedulers/scheduling_ddim.py +1 -1
  185. diffusers/schedulers/scheduling_ddim_cogvideox.py +449 -0
  186. diffusers/schedulers/scheduling_ddpm.py +1 -1
  187. diffusers/schedulers/scheduling_ddpm_parallel.py +1 -1
  188. diffusers/schedulers/scheduling_deis_multistep.py +2 -2
  189. diffusers/schedulers/scheduling_dpm_cogvideox.py +489 -0
  190. diffusers/schedulers/scheduling_dpmsolver_multistep.py +1 -1
  191. diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +1 -1
  192. diffusers/schedulers/scheduling_dpmsolver_singlestep.py +64 -19
  193. diffusers/schedulers/scheduling_edm_dpmsolver_multistep.py +2 -2
  194. diffusers/schedulers/scheduling_flow_match_euler_discrete.py +63 -39
  195. diffusers/schedulers/scheduling_flow_match_heun_discrete.py +321 -0
  196. diffusers/schedulers/scheduling_ipndm.py +1 -1
  197. diffusers/schedulers/scheduling_unipc_multistep.py +1 -1
  198. diffusers/schedulers/scheduling_utils.py +1 -3
  199. diffusers/schedulers/scheduling_utils_flax.py +1 -3
  200. diffusers/training_utils.py +99 -14
  201. diffusers/utils/__init__.py +2 -2
  202. diffusers/utils/dummy_pt_objects.py +210 -0
  203. diffusers/utils/dummy_torch_and_torchsde_objects.py +15 -0
  204. diffusers/utils/dummy_torch_and_transformers_and_sentencepiece_objects.py +47 -0
  205. diffusers/utils/dummy_torch_and_transformers_objects.py +315 -0
  206. diffusers/utils/dynamic_modules_utils.py +1 -11
  207. diffusers/utils/export_utils.py +50 -6
  208. diffusers/utils/hub_utils.py +45 -42
  209. diffusers/utils/import_utils.py +37 -15
  210. diffusers/utils/loading_utils.py +80 -3
  211. diffusers/utils/testing_utils.py +11 -8
  212. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/METADATA +73 -83
  213. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/RECORD +217 -164
  214. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/WHEEL +1 -1
  215. diffusers/loaders/autoencoder.py +0 -146
  216. diffusers/loaders/controlnet.py +0 -136
  217. diffusers/loaders/lora.py +0 -1728
  218. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/LICENSE +0 -0
  219. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/entry_points.txt +0 -0
  220. {diffusers-0.29.2.dist-info → diffusers-0.30.1.dist-info}/top_level.txt +0 -0
@@ -271,7 +271,8 @@ if cache_version < 1:
271
271
  def _add_variant(weights_name: str, variant: Optional[str] = None) -> str:
272
272
  if variant is not None:
273
273
  splits = weights_name.split(".")
274
- splits = splits[:-1] + [variant] + splits[-1:]
274
+ split_index = -2 if weights_name.endswith(".index.json") else -1
275
+ splits = splits[:-split_index] + [variant] + splits[-split_index:]
275
276
  weights_name = ".".join(splits)
276
277
 
277
278
  return weights_name
@@ -286,7 +287,6 @@ def _get_model_file(
286
287
  cache_dir: Optional[str] = None,
287
288
  force_download: bool = False,
288
289
  proxies: Optional[Dict] = None,
289
- resume_download: Optional[bool] = None,
290
290
  local_files_only: bool = False,
291
291
  token: Optional[str] = None,
292
292
  user_agent: Optional[Union[Dict, str]] = None,
@@ -324,7 +324,6 @@ def _get_model_file(
324
324
  cache_dir=cache_dir,
325
325
  force_download=force_download,
326
326
  proxies=proxies,
327
- resume_download=resume_download,
328
327
  local_files_only=local_files_only,
329
328
  token=token,
330
329
  user_agent=user_agent,
@@ -349,7 +348,6 @@ def _get_model_file(
349
348
  cache_dir=cache_dir,
350
349
  force_download=force_download,
351
350
  proxies=proxies,
352
- resume_download=resume_download,
353
351
  local_files_only=local_files_only,
354
352
  token=token,
355
353
  user_agent=user_agent,
@@ -358,42 +356,42 @@ def _get_model_file(
358
356
  )
359
357
  return model_file
360
358
 
361
- except RepositoryNotFoundError:
359
+ except RepositoryNotFoundError as e:
362
360
  raise EnvironmentError(
363
361
  f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier "
364
362
  "listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a "
365
363
  "token having permission to this repo with `token` or log in with `huggingface-cli "
366
364
  "login`."
367
- )
368
- except RevisionNotFoundError:
365
+ ) from e
366
+ except RevisionNotFoundError as e:
369
367
  raise EnvironmentError(
370
368
  f"{revision} is not a valid git identifier (branch name, tag name or commit id) that exists for "
371
369
  "this model name. Check the model page at "
372
370
  f"'https://huggingface.co/{pretrained_model_name_or_path}' for available revisions."
373
- )
374
- except EntryNotFoundError:
371
+ ) from e
372
+ except EntryNotFoundError as e:
375
373
  raise EnvironmentError(
376
374
  f"{pretrained_model_name_or_path} does not appear to have a file named {weights_name}."
377
- )
378
- except HTTPError as err:
375
+ ) from e
376
+ except HTTPError as e:
379
377
  raise EnvironmentError(
380
- f"There was a specific connection error when trying to load {pretrained_model_name_or_path}:\n{err}"
381
- )
382
- except ValueError:
378
+ f"There was a specific connection error when trying to load {pretrained_model_name_or_path}:\n{e}"
379
+ ) from e
380
+ except ValueError as e:
383
381
  raise EnvironmentError(
384
382
  f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load this model, couldn't find it"
385
383
  f" in the cached files and it looks like {pretrained_model_name_or_path} is not the path to a"
386
384
  f" directory containing a file named {weights_name} or"
387
385
  " \nCheckout your internet connection or see how to run the library in"
388
386
  " offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'."
389
- )
390
- except EnvironmentError:
387
+ ) from e
388
+ except EnvironmentError as e:
391
389
  raise EnvironmentError(
392
390
  f"Can't load the model for '{pretrained_model_name_or_path}'. If you were trying to load it from "
393
391
  "'https://huggingface.co/models', make sure you don't have a local directory with the same name. "
394
392
  f"Otherwise, make sure '{pretrained_model_name_or_path}' is the correct path to a directory "
395
393
  f"containing a file named {weights_name}"
396
- )
394
+ ) from e
397
395
 
398
396
 
399
397
  # Adapted from
@@ -417,7 +415,6 @@ def _get_checkpoint_shard_files(
417
415
  index_filename,
418
416
  cache_dir=None,
419
417
  proxies=None,
420
- resume_download=False,
421
418
  local_files_only=False,
422
419
  token=None,
423
420
  user_agent=None,
@@ -451,14 +448,17 @@ def _get_checkpoint_shard_files(
451
448
  _check_if_shards_exist_locally(
452
449
  pretrained_model_name_or_path, subfolder=subfolder, original_shard_filenames=original_shard_filenames
453
450
  )
454
- return pretrained_model_name_or_path, sharded_metadata
451
+ return shards_path, sharded_metadata
455
452
 
456
453
  # At this stage pretrained_model_name_or_path is a model identifier on the Hub
457
454
  allow_patterns = original_shard_filenames
455
+ if subfolder is not None:
456
+ allow_patterns = [os.path.join(subfolder, p) for p in allow_patterns]
457
+
458
458
  ignore_patterns = ["*.json", "*.md"]
459
459
  if not local_files_only:
460
460
  # `model_info` call must guarded with the above condition.
461
- model_files_info = model_info(pretrained_model_name_or_path)
461
+ model_files_info = model_info(pretrained_model_name_or_path, revision=revision)
462
462
  for shard_file in original_shard_filenames:
463
463
  shard_file_present = any(shard_file in k.rfilename for k in model_files_info.siblings)
464
464
  if not shard_file_present:
@@ -467,34 +467,37 @@ def _get_checkpoint_shard_files(
467
467
  "required according to the checkpoint index."
468
468
  )
469
469
 
470
- try:
471
- # Load from URL
472
- cached_folder = snapshot_download(
473
- pretrained_model_name_or_path,
474
- cache_dir=cache_dir,
475
- resume_download=resume_download,
476
- proxies=proxies,
477
- local_files_only=local_files_only,
478
- token=token,
479
- revision=revision,
480
- allow_patterns=allow_patterns,
481
- ignore_patterns=ignore_patterns,
482
- user_agent=user_agent,
483
- )
470
+ try:
471
+ # Load from URL
472
+ cached_folder = snapshot_download(
473
+ pretrained_model_name_or_path,
474
+ cache_dir=cache_dir,
475
+ proxies=proxies,
476
+ local_files_only=local_files_only,
477
+ token=token,
478
+ revision=revision,
479
+ allow_patterns=allow_patterns,
480
+ ignore_patterns=ignore_patterns,
481
+ user_agent=user_agent,
482
+ )
483
+ if subfolder is not None:
484
+ cached_folder = os.path.join(cached_folder, subfolder)
484
485
 
485
- # We have already dealt with RepositoryNotFoundError and RevisionNotFoundError when getting the index, so
486
- # we don't have to catch them here. We have also dealt with EntryNotFoundError.
487
- except HTTPError as e:
488
- raise EnvironmentError(
489
- f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load {pretrained_model_name_or_path}. You should try"
490
- " again after checking your internet connection."
491
- ) from e
486
+ # We have already dealt with RepositoryNotFoundError and RevisionNotFoundError when getting the index, so
487
+ # we don't have to catch them here. We have also dealt with EntryNotFoundError.
488
+ except HTTPError as e:
489
+ raise EnvironmentError(
490
+ f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load {pretrained_model_name_or_path}. You should try"
491
+ " again after checking your internet connection."
492
+ ) from e
492
493
 
493
494
  # If `local_files_only=True`, `cached_folder` may not contain all the shard files.
494
- if local_files_only:
495
+ elif local_files_only:
495
496
  _check_if_shards_exist_locally(
496
497
  local_dir=cache_dir, subfolder=subfolder, original_shard_filenames=original_shard_filenames
497
498
  )
499
+ if subfolder is not None:
500
+ cached_folder = os.path.join(cached_folder, subfolder)
498
501
 
499
502
  return cached_folder, sharded_metadata
500
503
 
@@ -294,6 +294,13 @@ try:
294
294
  except importlib_metadata.PackageNotFoundError:
295
295
  _torchvision_available = False
296
296
 
297
+ _sentencepiece_available = importlib.util.find_spec("sentencepiece") is not None
298
+ try:
299
+ _sentencepiece_version = importlib_metadata.version("sentencepiece")
300
+ logger.info(f"Successfully imported sentencepiece version {_sentencepiece_version}")
301
+ except importlib_metadata.PackageNotFoundError:
302
+ _sentencepiece_available = False
303
+
297
304
  _matplotlib_available = importlib.util.find_spec("matplotlib") is not None
298
305
  try:
299
306
  _matplotlib_version = importlib_metadata.version("matplotlib")
@@ -321,18 +328,16 @@ try:
321
328
  except importlib_metadata.PackageNotFoundError:
322
329
  _bitsandbytes_available = False
323
330
 
324
- # Taken from `huggingface_hub`.
325
- _is_notebook = False
326
- try:
327
- shell_class = get_ipython().__class__ # type: ignore # noqa: F821
328
- for parent_class in shell_class.__mro__: # e.g. "is subclass of"
329
- if parent_class.__name__ == "ZMQInteractiveShell":
330
- _is_notebook = True # Jupyter notebook, Google colab or qtconsole
331
- break
332
- except NameError:
333
- pass # Probably standard Python interpreter
331
+ _is_google_colab = "google.colab" in sys.modules or any(k.startswith("COLAB_") for k in os.environ)
334
332
 
335
- _is_google_colab = "google.colab" in sys.modules
333
+ _imageio_available = importlib.util.find_spec("imageio") is not None
334
+ if _imageio_available:
335
+ try:
336
+ _imageio_version = importlib_metadata.version("imageio")
337
+ logger.debug(f"Successfully imported imageio version {_imageio_version}")
338
+
339
+ except importlib_metadata.PackageNotFoundError:
340
+ _imageio_available = False
336
341
 
337
342
 
338
343
  def is_torch_available():
@@ -443,14 +448,18 @@ def is_bitsandbytes_available():
443
448
  return _bitsandbytes_available
444
449
 
445
450
 
446
- def is_notebook():
447
- return _is_notebook
448
-
449
-
450
451
  def is_google_colab():
451
452
  return _is_google_colab
452
453
 
453
454
 
455
+ def is_sentencepiece_available():
456
+ return _sentencepiece_available
457
+
458
+
459
+ def is_imageio_available():
460
+ return _imageio_available
461
+
462
+
454
463
  # docstyle-ignore
455
464
  FLAX_IMPORT_ERROR = """
456
465
  {0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the
@@ -568,11 +577,22 @@ SAFETENSORS_IMPORT_ERROR = """
568
577
  {0} requires the safetensors library but it was not found in your environment. You can install it with pip: `pip install safetensors`
569
578
  """
570
579
 
580
+ # docstyle-ignore
581
+ SENTENCEPIECE_IMPORT_ERROR = """
582
+ {0} requires the sentencepiece library but it was not found in your environment. You can install it with pip: `pip install sentencepiece`
583
+ """
584
+
585
+
571
586
  # docstyle-ignore
572
587
  BITSANDBYTES_IMPORT_ERROR = """
573
588
  {0} requires the bitsandbytes library but it was not found in your environment. You can install it with pip: `pip install bitsandbytes`
574
589
  """
575
590
 
591
+ # docstyle-ignore
592
+ IMAGEIO_IMPORT_ERROR = """
593
+ {0} requires the imageio library and ffmpeg but it was not found in your environment. You can install it with pip: `pip install imageio imageio-ffmpeg`
594
+ """
595
+
576
596
  BACKENDS_MAPPING = OrderedDict(
577
597
  [
578
598
  ("bs4", (is_bs4_available, BS4_IMPORT_ERROR)),
@@ -596,6 +616,8 @@ BACKENDS_MAPPING = OrderedDict(
596
616
  ("peft", (is_peft_available, PEFT_IMPORT_ERROR)),
597
617
  ("safetensors", (is_safetensors_available, SAFETENSORS_IMPORT_ERROR)),
598
618
  ("bitsandbytes", (is_bitsandbytes_available, BITSANDBYTES_IMPORT_ERROR)),
619
+ ("sentencepiece", (is_sentencepiece_available, SENTENCEPIECE_IMPORT_ERROR)),
620
+ ("imageio", (is_imageio_available, IMAGEIO_IMPORT_ERROR)),
599
621
  ]
600
622
  )
601
623
 
@@ -1,13 +1,16 @@
1
1
  import os
2
- from typing import Callable, Union
2
+ import tempfile
3
+ from typing import Callable, List, Optional, Union
3
4
 
4
5
  import PIL.Image
5
6
  import PIL.ImageOps
6
7
  import requests
7
8
 
9
+ from .import_utils import BACKENDS_MAPPING, is_imageio_available
10
+
8
11
 
9
12
  def load_image(
10
- image: Union[str, PIL.Image.Image], convert_method: Callable[[PIL.Image.Image], PIL.Image.Image] = None
13
+ image: Union[str, PIL.Image.Image], convert_method: Optional[Callable[[PIL.Image.Image], PIL.Image.Image]] = None
11
14
  ) -> PIL.Image.Image:
12
15
  """
13
16
  Loads `image` to a PIL Image.
@@ -15,7 +18,7 @@ def load_image(
15
18
  Args:
16
19
  image (`str` or `PIL.Image.Image`):
17
20
  The image to convert to the PIL Image format.
18
- convert_method (Callable[[PIL.Image.Image], PIL.Image.Image], optional):
21
+ convert_method (Callable[[PIL.Image.Image], PIL.Image.Image], *optional*):
19
22
  A conversion method to apply to the image after loading it. When set to `None` the image will be converted
20
23
  "RGB".
21
24
 
@@ -47,3 +50,77 @@ def load_image(
47
50
  image = image.convert("RGB")
48
51
 
49
52
  return image
53
+
54
+
55
+ def load_video(
56
+ video: str,
57
+ convert_method: Optional[Callable[[List[PIL.Image.Image]], List[PIL.Image.Image]]] = None,
58
+ ) -> List[PIL.Image.Image]:
59
+ """
60
+ Loads `video` to a list of PIL Image.
61
+
62
+ Args:
63
+ video (`str`):
64
+ A URL or Path to a video to convert to a list of PIL Image format.
65
+ convert_method (Callable[[List[PIL.Image.Image]], List[PIL.Image.Image]], *optional*):
66
+ A conversion method to apply to the video after loading it. When set to `None` the images will be converted
67
+ to "RGB".
68
+
69
+ Returns:
70
+ `List[PIL.Image.Image]`:
71
+ The video as a list of PIL images.
72
+ """
73
+ is_url = video.startswith("http://") or video.startswith("https://")
74
+ is_file = os.path.isfile(video)
75
+ was_tempfile_created = False
76
+
77
+ if not (is_url or is_file):
78
+ raise ValueError(
79
+ f"Incorrect path or URL. URLs must start with `http://` or `https://`, and {video} is not a valid path."
80
+ )
81
+
82
+ if is_url:
83
+ video_data = requests.get(video, stream=True).raw
84
+ suffix = os.path.splitext(video)[1] or ".mp4"
85
+ video_path = tempfile.NamedTemporaryFile(suffix=suffix, delete=False).name
86
+ was_tempfile_created = True
87
+ with open(video_path, "wb") as f:
88
+ f.write(video_data.read())
89
+
90
+ video = video_path
91
+
92
+ pil_images = []
93
+ if video.endswith(".gif"):
94
+ gif = PIL.Image.open(video)
95
+ try:
96
+ while True:
97
+ pil_images.append(gif.copy())
98
+ gif.seek(gif.tell() + 1)
99
+ except EOFError:
100
+ pass
101
+
102
+ else:
103
+ if is_imageio_available():
104
+ import imageio
105
+ else:
106
+ raise ImportError(BACKENDS_MAPPING["imageio"][1].format("load_video"))
107
+
108
+ try:
109
+ imageio.plugins.ffmpeg.get_exe()
110
+ except AttributeError:
111
+ raise AttributeError(
112
+ "`Unable to find an ffmpeg installation on your machine. Please install via `pip install imageio-ffmpeg"
113
+ )
114
+
115
+ with imageio.get_reader(video) as reader:
116
+ # Read all frames
117
+ for frame in reader:
118
+ pil_images.append(PIL.Image.fromarray(frame))
119
+
120
+ if was_tempfile_created:
121
+ os.remove(video_path)
122
+
123
+ if convert_method is not None:
124
+ pil_images = convert_method(pil_images)
125
+
126
+ return pil_images
@@ -187,6 +187,7 @@ def parse_flag_from_env(key, default=False):
187
187
 
188
188
  _run_slow_tests = parse_flag_from_env("RUN_SLOW", default=False)
189
189
  _run_nightly_tests = parse_flag_from_env("RUN_NIGHTLY", default=False)
190
+ _run_compile_tests = parse_flag_from_env("RUN_COMPILE", default=False)
190
191
 
191
192
 
192
193
  def floats_tensor(shape, scale=1.0, rng=None, name=None):
@@ -225,6 +226,16 @@ def nightly(test_case):
225
226
  return unittest.skipUnless(_run_nightly_tests, "test is nightly")(test_case)
226
227
 
227
228
 
229
+ def is_torch_compile(test_case):
230
+ """
231
+ Decorator marking a test that runs compile tests in the diffusers CI.
232
+
233
+ Compile tests are skipped by default. Set the RUN_COMPILE environment variable to a truthy value to run them.
234
+
235
+ """
236
+ return unittest.skipUnless(_run_compile_tests, "test is torch compile")(test_case)
237
+
238
+
228
239
  def require_torch(test_case):
229
240
  """
230
241
  Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.
@@ -390,14 +401,6 @@ def get_python_version():
390
401
  return major, minor
391
402
 
392
403
 
393
- def require_python39_or_higher(test_case):
394
- def python39_available():
395
- major, minor = get_python_version()
396
- return major == 3 and minor >= 9
397
-
398
- return unittest.skipUnless(python39_available(), "test requires Python 3.9 or higher")(test_case)
399
-
400
-
401
404
  def load_numpy(arry: Union[str, np.ndarray], local_path: Optional[str] = None) -> np.ndarray:
402
405
  if isinstance(arry, str):
403
406
  if local_path is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffusers
3
- Version: 0.29.2
3
+ Version: 0.30.1
4
4
  Summary: State-of-the-art diffusion in PyTorch and JAX.
5
5
  Home-page: https://github.com/huggingface/diffusers
6
6
  Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
@@ -23,81 +23,81 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: importlib-metadata
25
25
  Requires-Dist: filelock
26
- Requires-Dist: huggingface-hub >=0.23.2
26
+ Requires-Dist: huggingface-hub>=0.23.2
27
27
  Requires-Dist: numpy
28
- Requires-Dist: regex !=2019.12.17
28
+ Requires-Dist: regex!=2019.12.17
29
29
  Requires-Dist: requests
30
- Requires-Dist: safetensors >=0.3.1
30
+ Requires-Dist: safetensors>=0.3.1
31
31
  Requires-Dist: Pillow
32
32
  Provides-Extra: dev
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'
39
- Requires-Dist: datasets ; 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'
43
- Requires-Dist: librosa ; extra == 'dev'
44
- Requires-Dist: parameterized ; extra == 'dev'
45
- Requires-Dist: pytest ; extra == 'dev'
46
- Requires-Dist: pytest-timeout ; extra == 'dev'
47
- Requires-Dist: pytest-xdist ; extra == 'dev'
48
- Requires-Dist: requests-mock ==1.10.0 ; extra == 'dev'
49
- Requires-Dist: safetensors >=0.3.1 ; extra == 'dev'
50
- Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'dev'
51
- Requires-Dist: scipy ; extra == 'dev'
52
- Requires-Dist: torchvision ; extra == 'dev'
53
- Requires-Dist: transformers >=4.25.1 ; extra == 'dev'
54
- Requires-Dist: accelerate >=0.29.3 ; extra == 'dev'
55
- Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'dev'
56
- Requires-Dist: tensorboard ; extra == 'dev'
57
- Requires-Dist: peft >=0.6.0 ; extra == 'dev'
58
- Requires-Dist: torch >=1.4 ; extra == 'dev'
59
- Requires-Dist: jax >=0.4.1 ; extra == 'dev'
60
- Requires-Dist: jaxlib >=0.4.1 ; extra == 'dev'
61
- Requires-Dist: flax >=0.4.1 ; extra == 'dev'
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"
39
+ Requires-Dist: datasets; 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"
43
+ Requires-Dist: librosa; extra == "dev"
44
+ Requires-Dist: parameterized; extra == "dev"
45
+ Requires-Dist: pytest; extra == "dev"
46
+ Requires-Dist: pytest-timeout; extra == "dev"
47
+ Requires-Dist: pytest-xdist; extra == "dev"
48
+ Requires-Dist: requests-mock==1.10.0; extra == "dev"
49
+ Requires-Dist: safetensors>=0.3.1; extra == "dev"
50
+ Requires-Dist: sentencepiece!=0.1.92,>=0.1.91; extra == "dev"
51
+ Requires-Dist: scipy; extra == "dev"
52
+ Requires-Dist: torchvision; extra == "dev"
53
+ Requires-Dist: transformers>=4.41.2; extra == "dev"
54
+ Requires-Dist: accelerate>=0.31.0; extra == "dev"
55
+ Requires-Dist: protobuf<4,>=3.20.3; extra == "dev"
56
+ Requires-Dist: tensorboard; extra == "dev"
57
+ Requires-Dist: peft>=0.6.0; extra == "dev"
58
+ Requires-Dist: torch>=1.4; extra == "dev"
59
+ Requires-Dist: jax>=0.4.1; extra == "dev"
60
+ Requires-Dist: jaxlib>=0.4.1; extra == "dev"
61
+ Requires-Dist: flax>=0.4.1; extra == "dev"
62
62
  Provides-Extra: docs
63
- Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'docs'
63
+ Requires-Dist: hf-doc-builder>=0.3.0; extra == "docs"
64
64
  Provides-Extra: flax
65
- Requires-Dist: jax >=0.4.1 ; extra == 'flax'
66
- Requires-Dist: jaxlib >=0.4.1 ; extra == 'flax'
67
- Requires-Dist: flax >=0.4.1 ; extra == 'flax'
65
+ Requires-Dist: jax>=0.4.1; extra == "flax"
66
+ Requires-Dist: jaxlib>=0.4.1; extra == "flax"
67
+ Requires-Dist: flax>=0.4.1; extra == "flax"
68
68
  Provides-Extra: quality
69
- Requires-Dist: urllib3 <=2.0.0 ; extra == 'quality'
70
- Requires-Dist: isort >=5.5.4 ; extra == 'quality'
71
- Requires-Dist: ruff ==0.1.5 ; extra == 'quality'
72
- Requires-Dist: hf-doc-builder >=0.3.0 ; extra == 'quality'
69
+ Requires-Dist: urllib3<=2.0.0; extra == "quality"
70
+ Requires-Dist: isort>=5.5.4; extra == "quality"
71
+ Requires-Dist: ruff==0.1.5; extra == "quality"
72
+ Requires-Dist: hf-doc-builder>=0.3.0; extra == "quality"
73
73
  Provides-Extra: test
74
- Requires-Dist: compel ==0.1.8 ; extra == 'test'
75
- Requires-Dist: GitPython <3.1.19 ; extra == 'test'
76
- Requires-Dist: datasets ; extra == 'test'
77
- Requires-Dist: Jinja2 ; extra == 'test'
78
- Requires-Dist: invisible-watermark >=0.2.0 ; extra == 'test'
79
- Requires-Dist: k-diffusion >=0.0.12 ; extra == 'test'
80
- Requires-Dist: librosa ; extra == 'test'
81
- Requires-Dist: parameterized ; extra == 'test'
82
- Requires-Dist: pytest ; extra == 'test'
83
- Requires-Dist: pytest-timeout ; extra == 'test'
84
- Requires-Dist: pytest-xdist ; extra == 'test'
85
- Requires-Dist: requests-mock ==1.10.0 ; extra == 'test'
86
- Requires-Dist: safetensors >=0.3.1 ; extra == 'test'
87
- Requires-Dist: sentencepiece !=0.1.92,>=0.1.91 ; extra == 'test'
88
- Requires-Dist: scipy ; extra == 'test'
89
- Requires-Dist: torchvision ; extra == 'test'
90
- Requires-Dist: transformers >=4.25.1 ; extra == 'test'
74
+ Requires-Dist: compel==0.1.8; extra == "test"
75
+ Requires-Dist: GitPython<3.1.19; extra == "test"
76
+ Requires-Dist: datasets; extra == "test"
77
+ Requires-Dist: Jinja2; extra == "test"
78
+ Requires-Dist: invisible-watermark>=0.2.0; extra == "test"
79
+ Requires-Dist: k-diffusion>=0.0.12; extra == "test"
80
+ Requires-Dist: librosa; extra == "test"
81
+ Requires-Dist: parameterized; extra == "test"
82
+ Requires-Dist: pytest; extra == "test"
83
+ Requires-Dist: pytest-timeout; extra == "test"
84
+ Requires-Dist: pytest-xdist; extra == "test"
85
+ Requires-Dist: requests-mock==1.10.0; extra == "test"
86
+ Requires-Dist: safetensors>=0.3.1; extra == "test"
87
+ Requires-Dist: sentencepiece!=0.1.92,>=0.1.91; extra == "test"
88
+ Requires-Dist: scipy; extra == "test"
89
+ Requires-Dist: torchvision; extra == "test"
90
+ Requires-Dist: transformers>=4.41.2; extra == "test"
91
91
  Provides-Extra: torch
92
- Requires-Dist: torch >=1.4 ; extra == 'torch'
93
- Requires-Dist: accelerate >=0.29.3 ; extra == 'torch'
92
+ Requires-Dist: torch>=1.4; extra == "torch"
93
+ Requires-Dist: accelerate>=0.31.0; extra == "torch"
94
94
  Provides-Extra: training
95
- Requires-Dist: accelerate >=0.29.3 ; extra == 'training'
96
- Requires-Dist: datasets ; extra == 'training'
97
- Requires-Dist: protobuf <4,>=3.20.3 ; extra == 'training'
98
- Requires-Dist: tensorboard ; extra == 'training'
99
- Requires-Dist: Jinja2 ; extra == 'training'
100
- Requires-Dist: peft >=0.6.0 ; extra == 'training'
95
+ Requires-Dist: accelerate>=0.31.0; extra == "training"
96
+ Requires-Dist: datasets; extra == "training"
97
+ Requires-Dist: protobuf<4,>=3.20.3; extra == "training"
98
+ Requires-Dist: tensorboard; extra == "training"
99
+ Requires-Dist: Jinja2; extra == "training"
100
+ Requires-Dist: peft>=0.6.0; extra == "training"
101
101
 
102
102
  <!---
103
103
  Copyright 2022 - The HuggingFace Team. All rights reserved.
@@ -121,21 +121,11 @@ limitations under the License.
121
121
  <br>
122
122
  <p>
123
123
  <p align="center">
124
- <a href="https://github.com/huggingface/diffusers/blob/main/LICENSE">
125
- <img alt="GitHub" src="https://img.shields.io/github/license/huggingface/datasets.svg?color=blue">
126
- </a>
127
- <a href="https://github.com/huggingface/diffusers/releases">
128
- <img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/diffusers.svg">
129
- </a>
130
- <a href="https://pepy.tech/project/diffusers">
131
- <img alt="GitHub release" src="https://static.pepy.tech/badge/diffusers/month">
132
- </a>
133
- <a href="CODE_OF_CONDUCT.md">
134
- <img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg">
135
- </a>
136
- <a href="https://twitter.com/diffuserslib">
137
- <img alt="X account" src="https://img.shields.io/twitter/url/https/twitter.com/diffuserslib.svg?style=social&label=Follow%20%40diffuserslib">
138
- </a>
124
+ <a href="https://github.com/huggingface/diffusers/blob/main/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/huggingface/datasets.svg?color=blue"></a>
125
+ <a href="https://github.com/huggingface/diffusers/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/diffusers.svg"></a>
126
+ <a href="https://pepy.tech/project/diffusers"><img alt="GitHub release" src="https://static.pepy.tech/badge/diffusers/month"></a>
127
+ <a href="CODE_OF_CONDUCT.md"><img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg"></a>
128
+ <a href="https://twitter.com/diffuserslib"><img alt="X account" src="https://img.shields.io/twitter/url/https/twitter.com/diffuserslib.svg?style=social&label=Follow%20%40diffuserslib"></a>
139
129
  </p>
140
130
 
141
131
  🤗 Diffusers is the go-to library for state-of-the-art pretrained diffusion models for generating images, audio, and even 3D structures of molecules. Whether you're looking for a simple inference solution or training your own diffusion models, 🤗 Diffusers is a modular toolbox that supports both. Our library is designed with a focus on [usability over performance](https://huggingface.co/docs/diffusers/conceptual/philosophy#usability-over-performance), [simple over easy](https://huggingface.co/docs/diffusers/conceptual/philosophy#simple-over-easy), and [customizability over abstractions](https://huggingface.co/docs/diffusers/conceptual/philosophy#tweakable-contributorfriendly-over-abstraction).
@@ -178,7 +168,7 @@ Please refer to the [How to use Stable Diffusion in Apple Silicon](https://huggi
178
168
 
179
169
  ## Quickstart
180
170
 
181
- 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 25.000+ checkpoints):
171
+ 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 30,000+ checkpoints):
182
172
 
183
173
  ```python
184
174
  from diffusers import DiffusionPipeline
@@ -320,7 +310,7 @@ Also, say 👋 in our public Discord channel <a href="https://discord.gg/G7tWnz9
320
310
  - https://github.com/deep-floyd/IF
321
311
  - https://github.com/bentoml/BentoML
322
312
  - https://github.com/bmaltais/kohya_ss
323
- - +11.000 other amazing GitHub repositories 💪
313
+ - +14,000 other amazing GitHub repositories 💪
324
314
 
325
315
  Thank you for using us ❤️.
326
316