diffusers 0.17.1__py3-none-any.whl → 0.18.2__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. diffusers/__init__.py +26 -1
  2. diffusers/configuration_utils.py +34 -29
  3. diffusers/dependency_versions_table.py +4 -0
  4. diffusers/image_processor.py +125 -12
  5. diffusers/loaders.py +169 -203
  6. diffusers/models/attention.py +24 -1
  7. diffusers/models/attention_flax.py +10 -5
  8. diffusers/models/attention_processor.py +3 -0
  9. diffusers/models/autoencoder_kl.py +114 -33
  10. diffusers/models/controlnet.py +131 -14
  11. diffusers/models/controlnet_flax.py +37 -26
  12. diffusers/models/cross_attention.py +17 -17
  13. diffusers/models/embeddings.py +67 -0
  14. diffusers/models/modeling_flax_utils.py +64 -56
  15. diffusers/models/modeling_utils.py +193 -104
  16. diffusers/models/prior_transformer.py +207 -37
  17. diffusers/models/resnet.py +26 -26
  18. diffusers/models/transformer_2d.py +36 -41
  19. diffusers/models/transformer_temporal.py +24 -21
  20. diffusers/models/unet_1d.py +31 -25
  21. diffusers/models/unet_2d.py +43 -30
  22. diffusers/models/unet_2d_blocks.py +210 -89
  23. diffusers/models/unet_2d_blocks_flax.py +12 -12
  24. diffusers/models/unet_2d_condition.py +172 -64
  25. diffusers/models/unet_2d_condition_flax.py +38 -24
  26. diffusers/models/unet_3d_blocks.py +34 -31
  27. diffusers/models/unet_3d_condition.py +101 -34
  28. diffusers/models/vae.py +5 -5
  29. diffusers/models/vae_flax.py +37 -34
  30. diffusers/models/vq_model.py +23 -14
  31. diffusers/pipelines/__init__.py +24 -1
  32. diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py +1 -1
  33. diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py +5 -3
  34. diffusers/pipelines/consistency_models/__init__.py +1 -0
  35. diffusers/pipelines/consistency_models/pipeline_consistency_models.py +337 -0
  36. diffusers/pipelines/controlnet/multicontrolnet.py +120 -1
  37. diffusers/pipelines/controlnet/pipeline_controlnet.py +59 -17
  38. diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +60 -15
  39. diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +60 -17
  40. diffusers/pipelines/controlnet/pipeline_flax_controlnet.py +1 -1
  41. diffusers/pipelines/kandinsky/__init__.py +1 -1
  42. diffusers/pipelines/kandinsky/pipeline_kandinsky.py +4 -6
  43. diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py +1 -0
  44. diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py +1 -0
  45. diffusers/pipelines/kandinsky2_2/__init__.py +7 -0
  46. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py +317 -0
  47. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py +372 -0
  48. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py +434 -0
  49. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py +398 -0
  50. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py +531 -0
  51. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py +541 -0
  52. diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py +605 -0
  53. diffusers/pipelines/pipeline_flax_utils.py +2 -2
  54. diffusers/pipelines/pipeline_utils.py +124 -146
  55. diffusers/pipelines/shap_e/__init__.py +27 -0
  56. diffusers/pipelines/shap_e/camera.py +147 -0
  57. diffusers/pipelines/shap_e/pipeline_shap_e.py +390 -0
  58. diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py +349 -0
  59. diffusers/pipelines/shap_e/renderer.py +709 -0
  60. diffusers/pipelines/stable_diffusion/__init__.py +2 -0
  61. diffusers/pipelines/stable_diffusion/convert_from_ckpt.py +261 -66
  62. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +3 -3
  63. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +5 -3
  64. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +4 -2
  65. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py +6 -6
  66. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py +1 -1
  67. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_k_diffusion.py +1 -1
  68. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py +719 -0
  69. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py +1 -1
  70. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_paradigms.py +832 -0
  71. diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py +17 -7
  72. diffusers/pipelines/stable_diffusion_xl/__init__.py +26 -0
  73. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +823 -0
  74. diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +896 -0
  75. diffusers/pipelines/stable_diffusion_xl/watermark.py +31 -0
  76. diffusers/pipelines/text_to_video_synthesis/__init__.py +2 -1
  77. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py +5 -1
  78. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py +771 -0
  79. diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py +92 -6
  80. diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py +3 -3
  81. diffusers/pipelines/versatile_diffusion/modeling_text_unet.py +209 -91
  82. diffusers/schedulers/__init__.py +3 -0
  83. diffusers/schedulers/scheduling_consistency_models.py +380 -0
  84. diffusers/schedulers/scheduling_ddim.py +28 -6
  85. diffusers/schedulers/scheduling_ddim_inverse.py +19 -4
  86. diffusers/schedulers/scheduling_ddim_parallel.py +642 -0
  87. diffusers/schedulers/scheduling_ddpm.py +53 -7
  88. diffusers/schedulers/scheduling_ddpm_parallel.py +604 -0
  89. diffusers/schedulers/scheduling_deis_multistep.py +66 -11
  90. diffusers/schedulers/scheduling_dpmsolver_multistep.py +55 -13
  91. diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py +19 -4
  92. diffusers/schedulers/scheduling_dpmsolver_sde.py +73 -11
  93. diffusers/schedulers/scheduling_dpmsolver_singlestep.py +23 -7
  94. diffusers/schedulers/scheduling_euler_ancestral_discrete.py +58 -9
  95. diffusers/schedulers/scheduling_euler_discrete.py +58 -8
  96. diffusers/schedulers/scheduling_heun_discrete.py +89 -14
  97. diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py +73 -11
  98. diffusers/schedulers/scheduling_k_dpm_2_discrete.py +73 -11
  99. diffusers/schedulers/scheduling_lms_discrete.py +57 -8
  100. diffusers/schedulers/scheduling_pndm.py +46 -10
  101. diffusers/schedulers/scheduling_repaint.py +19 -4
  102. diffusers/schedulers/scheduling_sde_ve.py +5 -1
  103. diffusers/schedulers/scheduling_unclip.py +43 -4
  104. diffusers/schedulers/scheduling_unipc_multistep.py +48 -7
  105. diffusers/training_utils.py +1 -1
  106. diffusers/utils/__init__.py +2 -1
  107. diffusers/utils/dummy_pt_objects.py +60 -0
  108. diffusers/utils/dummy_torch_and_transformers_and_invisible_watermark_objects.py +32 -0
  109. diffusers/utils/dummy_torch_and_transformers_objects.py +180 -0
  110. diffusers/utils/hub_utils.py +1 -1
  111. diffusers/utils/import_utils.py +20 -3
  112. diffusers/utils/logging.py +15 -18
  113. diffusers/utils/outputs.py +3 -3
  114. diffusers/utils/testing_utils.py +15 -0
  115. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/METADATA +4 -2
  116. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/RECORD +120 -94
  117. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/WHEEL +1 -1
  118. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/LICENSE +0 -0
  119. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/entry_points.txt +0 -0
  120. {diffusers-0.17.1.dist-info → diffusers-0.18.2.dist-info}/top_level.txt +0 -0
@@ -227,6 +227,111 @@ class KandinskyPriorPipeline(metaclass=DummyObject):
227
227
  requires_backends(cls, ["torch", "transformers"])
228
228
 
229
229
 
230
+ class KandinskyV22ControlnetImg2ImgPipeline(metaclass=DummyObject):
231
+ _backends = ["torch", "transformers"]
232
+
233
+ def __init__(self, *args, **kwargs):
234
+ requires_backends(self, ["torch", "transformers"])
235
+
236
+ @classmethod
237
+ def from_config(cls, *args, **kwargs):
238
+ requires_backends(cls, ["torch", "transformers"])
239
+
240
+ @classmethod
241
+ def from_pretrained(cls, *args, **kwargs):
242
+ requires_backends(cls, ["torch", "transformers"])
243
+
244
+
245
+ class KandinskyV22ControlnetPipeline(metaclass=DummyObject):
246
+ _backends = ["torch", "transformers"]
247
+
248
+ def __init__(self, *args, **kwargs):
249
+ requires_backends(self, ["torch", "transformers"])
250
+
251
+ @classmethod
252
+ def from_config(cls, *args, **kwargs):
253
+ requires_backends(cls, ["torch", "transformers"])
254
+
255
+ @classmethod
256
+ def from_pretrained(cls, *args, **kwargs):
257
+ requires_backends(cls, ["torch", "transformers"])
258
+
259
+
260
+ class KandinskyV22Img2ImgPipeline(metaclass=DummyObject):
261
+ _backends = ["torch", "transformers"]
262
+
263
+ def __init__(self, *args, **kwargs):
264
+ requires_backends(self, ["torch", "transformers"])
265
+
266
+ @classmethod
267
+ def from_config(cls, *args, **kwargs):
268
+ requires_backends(cls, ["torch", "transformers"])
269
+
270
+ @classmethod
271
+ def from_pretrained(cls, *args, **kwargs):
272
+ requires_backends(cls, ["torch", "transformers"])
273
+
274
+
275
+ class KandinskyV22InpaintPipeline(metaclass=DummyObject):
276
+ _backends = ["torch", "transformers"]
277
+
278
+ def __init__(self, *args, **kwargs):
279
+ requires_backends(self, ["torch", "transformers"])
280
+
281
+ @classmethod
282
+ def from_config(cls, *args, **kwargs):
283
+ requires_backends(cls, ["torch", "transformers"])
284
+
285
+ @classmethod
286
+ def from_pretrained(cls, *args, **kwargs):
287
+ requires_backends(cls, ["torch", "transformers"])
288
+
289
+
290
+ class KandinskyV22Pipeline(metaclass=DummyObject):
291
+ _backends = ["torch", "transformers"]
292
+
293
+ def __init__(self, *args, **kwargs):
294
+ requires_backends(self, ["torch", "transformers"])
295
+
296
+ @classmethod
297
+ def from_config(cls, *args, **kwargs):
298
+ requires_backends(cls, ["torch", "transformers"])
299
+
300
+ @classmethod
301
+ def from_pretrained(cls, *args, **kwargs):
302
+ requires_backends(cls, ["torch", "transformers"])
303
+
304
+
305
+ class KandinskyV22PriorEmb2EmbPipeline(metaclass=DummyObject):
306
+ _backends = ["torch", "transformers"]
307
+
308
+ def __init__(self, *args, **kwargs):
309
+ requires_backends(self, ["torch", "transformers"])
310
+
311
+ @classmethod
312
+ def from_config(cls, *args, **kwargs):
313
+ requires_backends(cls, ["torch", "transformers"])
314
+
315
+ @classmethod
316
+ def from_pretrained(cls, *args, **kwargs):
317
+ requires_backends(cls, ["torch", "transformers"])
318
+
319
+
320
+ class KandinskyV22PriorPipeline(metaclass=DummyObject):
321
+ _backends = ["torch", "transformers"]
322
+
323
+ def __init__(self, *args, **kwargs):
324
+ requires_backends(self, ["torch", "transformers"])
325
+
326
+ @classmethod
327
+ def from_config(cls, *args, **kwargs):
328
+ requires_backends(cls, ["torch", "transformers"])
329
+
330
+ @classmethod
331
+ def from_pretrained(cls, *args, **kwargs):
332
+ requires_backends(cls, ["torch", "transformers"])
333
+
334
+
230
335
  class LDMTextToImagePipeline(metaclass=DummyObject):
231
336
  _backends = ["torch", "transformers"]
232
337
 
@@ -272,6 +377,36 @@ class SemanticStableDiffusionPipeline(metaclass=DummyObject):
272
377
  requires_backends(cls, ["torch", "transformers"])
273
378
 
274
379
 
380
+ class ShapEImg2ImgPipeline(metaclass=DummyObject):
381
+ _backends = ["torch", "transformers"]
382
+
383
+ def __init__(self, *args, **kwargs):
384
+ requires_backends(self, ["torch", "transformers"])
385
+
386
+ @classmethod
387
+ def from_config(cls, *args, **kwargs):
388
+ requires_backends(cls, ["torch", "transformers"])
389
+
390
+ @classmethod
391
+ def from_pretrained(cls, *args, **kwargs):
392
+ requires_backends(cls, ["torch", "transformers"])
393
+
394
+
395
+ class ShapEPipeline(metaclass=DummyObject):
396
+ _backends = ["torch", "transformers"]
397
+
398
+ def __init__(self, *args, **kwargs):
399
+ requires_backends(self, ["torch", "transformers"])
400
+
401
+ @classmethod
402
+ def from_config(cls, *args, **kwargs):
403
+ requires_backends(cls, ["torch", "transformers"])
404
+
405
+ @classmethod
406
+ def from_pretrained(cls, *args, **kwargs):
407
+ requires_backends(cls, ["torch", "transformers"])
408
+
409
+
275
410
  class StableDiffusionAttendAndExcitePipeline(metaclass=DummyObject):
276
411
  _backends = ["torch", "transformers"]
277
412
 
@@ -452,6 +587,21 @@ class StableDiffusionLatentUpscalePipeline(metaclass=DummyObject):
452
587
  requires_backends(cls, ["torch", "transformers"])
453
588
 
454
589
 
590
+ class StableDiffusionLDM3DPipeline(metaclass=DummyObject):
591
+ _backends = ["torch", "transformers"]
592
+
593
+ def __init__(self, *args, **kwargs):
594
+ requires_backends(self, ["torch", "transformers"])
595
+
596
+ @classmethod
597
+ def from_config(cls, *args, **kwargs):
598
+ requires_backends(cls, ["torch", "transformers"])
599
+
600
+ @classmethod
601
+ def from_pretrained(cls, *args, **kwargs):
602
+ requires_backends(cls, ["torch", "transformers"])
603
+
604
+
455
605
  class StableDiffusionModelEditingPipeline(metaclass=DummyObject):
456
606
  _backends = ["torch", "transformers"]
457
607
 
@@ -482,6 +632,21 @@ class StableDiffusionPanoramaPipeline(metaclass=DummyObject):
482
632
  requires_backends(cls, ["torch", "transformers"])
483
633
 
484
634
 
635
+ class StableDiffusionParadigmsPipeline(metaclass=DummyObject):
636
+ _backends = ["torch", "transformers"]
637
+
638
+ def __init__(self, *args, **kwargs):
639
+ requires_backends(self, ["torch", "transformers"])
640
+
641
+ @classmethod
642
+ def from_config(cls, *args, **kwargs):
643
+ requires_backends(cls, ["torch", "transformers"])
644
+
645
+ @classmethod
646
+ def from_pretrained(cls, *args, **kwargs):
647
+ requires_backends(cls, ["torch", "transformers"])
648
+
649
+
485
650
  class StableDiffusionPipeline(metaclass=DummyObject):
486
651
  _backends = ["torch", "transformers"]
487
652
 
@@ -752,6 +917,21 @@ class VersatileDiffusionTextToImagePipeline(metaclass=DummyObject):
752
917
  requires_backends(cls, ["torch", "transformers"])
753
918
 
754
919
 
920
+ class VideoToVideoSDPipeline(metaclass=DummyObject):
921
+ _backends = ["torch", "transformers"]
922
+
923
+ def __init__(self, *args, **kwargs):
924
+ requires_backends(self, ["torch", "transformers"])
925
+
926
+ @classmethod
927
+ def from_config(cls, *args, **kwargs):
928
+ requires_backends(cls, ["torch", "transformers"])
929
+
930
+ @classmethod
931
+ def from_pretrained(cls, *args, **kwargs):
932
+ requires_backends(cls, ["torch", "transformers"])
933
+
934
+
755
935
  class VQDiffusionPipeline(metaclass=DummyObject):
756
936
  _backends = ["torch", "transformers"]
757
937
 
@@ -280,7 +280,7 @@ def _get_model_file(
280
280
  if (
281
281
  revision in DEPRECATED_REVISION_ARGS
282
282
  and (weights_name == WEIGHTS_NAME or weights_name == SAFETENSORS_WEIGHTS_NAME)
283
- and version.parse(version.parse(__version__).base_version) >= version.parse("0.18.0")
283
+ and version.parse(version.parse(__version__).base_version) >= version.parse("0.20.0")
284
284
  ):
285
285
  try:
286
286
  model_file = hf_hub_download(
@@ -294,6 +294,13 @@ try:
294
294
  except importlib_metadata.PackageNotFoundError:
295
295
  _torchsde_available = False
296
296
 
297
+ _invisible_watermark_available = importlib.util.find_spec("imwatermark") is not None
298
+ try:
299
+ _invisible_watermark_version = importlib_metadata.version("invisible-watermark")
300
+ logger.debug(f"Successfully imported invisible-watermark version {_invisible_watermark_version}")
301
+ except importlib_metadata.PackageNotFoundError:
302
+ _invisible_watermark_available = False
303
+
297
304
 
298
305
  def is_torch_available():
299
306
  return _torch_available
@@ -383,6 +390,10 @@ def is_torchsde_available():
383
390
  return _torchsde_available
384
391
 
385
392
 
393
+ def is_invisible_watermark_available():
394
+ return _invisible_watermark_available
395
+
396
+
386
397
  # docstyle-ignore
387
398
  FLAX_IMPORT_ERROR = """
388
399
  {0} requires the FLAX library but it was not found in your environment. Checkout the instructions on the
@@ -491,6 +502,11 @@ TORCHSDE_IMPORT_ERROR = """
491
502
  {0} requires the torchsde library but it was not found in your environment. You can install it with pip: `pip install torchsde`
492
503
  """
493
504
 
505
+ # docstyle-ignore
506
+ INVISIBLE_WATERMARK_IMPORT_ERROR = """
507
+ {0} requires the invisible-watermark library but it was not found in your environment. You can install it with pip: `pip install invisible-watermark>=2.0`
508
+ """
509
+
494
510
 
495
511
  BACKENDS_MAPPING = OrderedDict(
496
512
  [
@@ -508,10 +524,11 @@ BACKENDS_MAPPING = OrderedDict(
508
524
  ("note_seq", (is_note_seq_available, NOTE_SEQ_IMPORT_ERROR)),
509
525
  ("wandb", (is_wandb_available, WANDB_IMPORT_ERROR)),
510
526
  ("omegaconf", (is_omegaconf_available, OMEGACONF_IMPORT_ERROR)),
511
- ("tensorboard", (_tensorboard_available, TENSORBOARD_IMPORT_ERROR)),
512
- ("compel", (_compel_available, COMPEL_IMPORT_ERROR)),
527
+ ("tensorboard", (is_tensorboard_available, TENSORBOARD_IMPORT_ERROR)),
528
+ ("compel", (is_compel_available, COMPEL_IMPORT_ERROR)),
513
529
  ("ftfy", (is_ftfy_available, FTFY_IMPORT_ERROR)),
514
- ("torchsde", (_torchsde_available, TORCHSDE_IMPORT_ERROR)),
530
+ ("torchsde", (is_torchsde_available, TORCHSDE_IMPORT_ERROR)),
531
+ ("invisible_watermark", (is_invisible_watermark_available, INVISIBLE_WATERMARK_IMPORT_ERROR)),
515
532
  ]
516
533
  )
517
534
 
@@ -124,22 +124,19 @@ def get_logger(name: Optional[str] = None) -> logging.Logger:
124
124
 
125
125
  def get_verbosity() -> int:
126
126
  """
127
- Return the current level for the 🤗 Diffusers' root logger as an int.
127
+ Return the current level for the 🤗 Diffusers' root logger as an `int`.
128
128
 
129
129
  Returns:
130
- `int`: The logging level.
130
+ `int`:
131
+ Logging level integers which can be one of:
131
132
 
132
- <Tip>
133
+ - `50`: `diffusers.logging.CRITICAL` or `diffusers.logging.FATAL`
134
+ - `40`: `diffusers.logging.ERROR`
135
+ - `30`: `diffusers.logging.WARNING` or `diffusers.logging.WARN`
136
+ - `20`: `diffusers.logging.INFO`
137
+ - `10`: `diffusers.logging.DEBUG`
133
138
 
134
- 🤗 Diffusers has following logging levels:
135
-
136
- - 50: `diffusers.logging.CRITICAL` or `diffusers.logging.FATAL`
137
- - 40: `diffusers.logging.ERROR`
138
- - 30: `diffusers.logging.WARNING` or `diffusers.logging.WARN`
139
- - 20: `diffusers.logging.INFO`
140
- - 10: `diffusers.logging.DEBUG`
141
-
142
- </Tip>"""
139
+ """
143
140
 
144
141
  _configure_library_root_logger()
145
142
  return _get_library_root_logger().getEffectiveLevel()
@@ -151,7 +148,7 @@ def set_verbosity(verbosity: int) -> None:
151
148
 
152
149
  Args:
153
150
  verbosity (`int`):
154
- Logging level, e.g., one of:
151
+ Logging level which can be one of:
155
152
 
156
153
  - `diffusers.logging.CRITICAL` or `diffusers.logging.FATAL`
157
154
  - `diffusers.logging.ERROR`
@@ -185,7 +182,7 @@ def set_verbosity_error():
185
182
 
186
183
 
187
184
  def disable_default_handler() -> None:
188
- """Disable the default handler of the HuggingFace Diffusers' root logger."""
185
+ """Disable the default handler of the 🤗 Diffusers' root logger."""
189
186
 
190
187
  _configure_library_root_logger()
191
188
 
@@ -194,7 +191,7 @@ def disable_default_handler() -> None:
194
191
 
195
192
 
196
193
  def enable_default_handler() -> None:
197
- """Enable the default handler of the HuggingFace Diffusers' root logger."""
194
+ """Enable the default handler of the 🤗 Diffusers' root logger."""
198
195
 
199
196
  _configure_library_root_logger()
200
197
 
@@ -241,9 +238,9 @@ def enable_propagation() -> None:
241
238
 
242
239
  def enable_explicit_format() -> None:
243
240
  """
244
- Enable explicit formatting for every HuggingFace Diffusers' logger. The explicit formatter is as follows:
241
+ Enable explicit formatting for every 🤗 Diffusers' logger. The explicit formatter is as follows:
245
242
  ```
246
- [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE
243
+ [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE
247
244
  ```
248
245
  All handlers currently bound to the root logger are affected by this method.
249
246
  """
@@ -256,7 +253,7 @@ def enable_explicit_format() -> None:
256
253
 
257
254
  def reset_format() -> None:
258
255
  """
259
- Resets the formatting for HuggingFace Diffusers' loggers.
256
+ Resets the formatting for 🤗 Diffusers' loggers.
260
257
 
261
258
  All handlers currently bound to the root logger are affected by this method.
262
259
  """
@@ -41,12 +41,12 @@ class BaseOutput(OrderedDict):
41
41
  """
42
42
  Base class for all model outputs as dataclass. Has a `__getitem__` that allows indexing by integer or slice (like a
43
43
  tuple) or strings (like a dictionary) that will ignore the `None` attributes. Otherwise behaves like a regular
44
- python dictionary.
44
+ Python dictionary.
45
45
 
46
46
  <Tip warning={true}>
47
47
 
48
- You can't unpack a `BaseOutput` directly. Use the [`~utils.BaseOutput.to_tuple`] method to convert it to a tuple
49
- before.
48
+ You can't unpack a [`BaseOutput`] directly. Use the [`~utils.BaseOutput.to_tuple`] method to convert it to a tuple
49
+ first.
50
50
 
51
51
  </Tip>
52
52
  """
@@ -300,6 +300,21 @@ def preprocess_image(image: PIL.Image, batch_size: int):
300
300
  return 2.0 * image - 1.0
301
301
 
302
302
 
303
+ def export_to_gif(image: List[PIL.Image.Image], output_gif_path: str = None) -> str:
304
+ if output_gif_path is None:
305
+ output_gif_path = tempfile.NamedTemporaryFile(suffix=".gif").name
306
+
307
+ image[0].save(
308
+ output_gif_path,
309
+ save_all=True,
310
+ append_images=image[1:],
311
+ optimize=False,
312
+ duration=100,
313
+ loop=0,
314
+ )
315
+ return output_gif_path
316
+
317
+
303
318
  def export_to_video(video_frames: List[np.ndarray], output_video_path: str = None) -> str:
304
319
  if is_opencv_available():
305
320
  import cv2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffusers
3
- Version: 0.17.1
3
+ Version: 0.18.2
4
4
  Summary: Diffusers
5
5
  Home-page: https://github.com/huggingface/diffusers
6
6
  Author: The HuggingFace team
@@ -37,6 +37,7 @@ Requires-Dist: compel (==0.1.8) ; extra == 'dev'
37
37
  Requires-Dist: datasets ; extra == 'dev'
38
38
  Requires-Dist: flax (>=0.4.1) ; extra == 'dev'
39
39
  Requires-Dist: hf-doc-builder (>=0.3.0) ; extra == 'dev'
40
+ Requires-Dist: invisible-watermark ; extra == 'dev'
40
41
  Requires-Dist: isort (>=5.5.4) ; extra == 'dev'
41
42
  Requires-Dist: jax (!=0.3.2,>=0.2.8) ; extra == 'dev'
42
43
  Requires-Dist: jaxlib (>=0.1.65) ; extra == 'dev'
@@ -74,6 +75,7 @@ Provides-Extra: test
74
75
  Requires-Dist: Jinja2 ; extra == 'test'
75
76
  Requires-Dist: compel (==0.1.8) ; extra == 'test'
76
77
  Requires-Dist: datasets ; extra == 'test'
78
+ Requires-Dist: invisible-watermark ; extra == 'test'
77
79
  Requires-Dist: k-diffusion (>=0.0.12) ; extra == 'test'
78
80
  Requires-Dist: librosa ; extra == 'test'
79
81
  Requires-Dist: omegaconf ; extra == 'test'
@@ -124,7 +126,7 @@ Requires-Dist: tensorboard ; extra == 'training'
124
126
 
125
127
  ## Installation
126
128
 
127
- 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.html), please refer to their official documentation.
129
+ 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.
128
130
 
129
131
  ### PyTorch
130
132