diffusers 0.16.0__py3-none-any.whl → 0.16.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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.16.0"
1
+ __version__ = "0.16.1"
2
2
 
3
3
  from .configuration_utils import ConfigMixin
4
4
  from .utils import (
@@ -71,6 +71,7 @@ class AttentionBlock(nn.Module):
71
71
  self.proj_attn = nn.Linear(channels, channels, bias=True)
72
72
 
73
73
  self._use_memory_efficient_attention_xformers = False
74
+ self._use_2_0_attn = True
74
75
  self._attention_op = None
75
76
 
76
77
  def reshape_heads_to_batch_dim(self, tensor, merge_head_and_batch=True):
@@ -142,9 +143,8 @@ class AttentionBlock(nn.Module):
142
143
 
143
144
  scale = 1 / math.sqrt(self.channels / self.num_heads)
144
145
 
145
- use_torch_2_0_attn = (
146
- hasattr(F, "scaled_dot_product_attention") and not self._use_memory_efficient_attention_xformers
147
- )
146
+ _use_2_0_attn = self._use_2_0_attn and not self._use_memory_efficient_attention_xformers
147
+ use_torch_2_0_attn = hasattr(F, "scaled_dot_product_attention") and _use_2_0_attn
148
148
 
149
149
  query_proj = self.reshape_heads_to_batch_dim(query_proj, merge_head_and_batch=not use_torch_2_0_attn)
150
150
  key_proj = self.reshape_heads_to_batch_dim(key_proj, merge_head_and_batch=not use_torch_2_0_attn)
@@ -41,7 +41,7 @@ EXAMPLE_DOC_STRING = """
41
41
  >>> from diffusers.utils import pt_to_pil
42
42
  >>> import torch
43
43
 
44
- >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
44
+ >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16)
45
45
  >>> pipe.enable_model_cpu_offload()
46
46
 
47
47
  >>> prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
@@ -70,7 +70,7 @@ EXAMPLE_DOC_STRING = """
70
70
  >>> original_image = original_image.resize((768, 512))
71
71
 
72
72
  >>> pipe = IFImg2ImgPipeline.from_pretrained(
73
- ... "DeepFloyd/IF-I-IF-v1.0",
73
+ ... "DeepFloyd/IF-I-XL-v1.0",
74
74
  ... variant="fp16",
75
75
  ... torch_dtype=torch.float16,
76
76
  ... )
@@ -73,7 +73,7 @@ EXAMPLE_DOC_STRING = """
73
73
  >>> original_image = original_image.resize((768, 512))
74
74
 
75
75
  >>> pipe = IFImg2ImgPipeline.from_pretrained(
76
- ... "DeepFloyd/IF-I-IF-v1.0",
76
+ ... "DeepFloyd/IF-I-XL-v1.0",
77
77
  ... variant="fp16",
78
78
  ... torch_dtype=torch.float16,
79
79
  ... )
@@ -76,7 +76,7 @@ EXAMPLE_DOC_STRING = """
76
76
  >>> mask_image = mask_image
77
77
 
78
78
  >>> pipe = IFInpaintingPipeline.from_pretrained(
79
- ... "DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16
79
+ ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16
80
80
  ... )
81
81
  >>> pipe.enable_model_cpu_offload()
82
82
 
@@ -78,7 +78,7 @@ EXAMPLE_DOC_STRING = """
78
78
  >>> mask_image = mask_image
79
79
 
80
80
  >>> pipe = IFInpaintingPipeline.from_pretrained(
81
- ... "DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16
81
+ ... "DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16
82
82
  ... )
83
83
  >>> pipe.enable_model_cpu_offload()
84
84
 
@@ -45,7 +45,7 @@ EXAMPLE_DOC_STRING = """
45
45
  >>> from diffusers.utils import pt_to_pil
46
46
  >>> import torch
47
47
 
48
- >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-IF-v1.0", variant="fp16", torch_dtype=torch.float16)
48
+ >>> pipe = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16)
49
49
  >>> pipe.enable_model_cpu_offload()
50
50
 
51
51
  >>> prompt = 'a photo of a kangaroo wearing an orange hoodie and blue sunglasses standing in front of the eiffel tower holding a sign that says "very deep learning"'
@@ -267,7 +267,7 @@ def get_cached_module_file(
267
267
 
268
268
  # retrieve github version that matches
269
269
  if revision is None:
270
- revision = latest_version if latest_version in available_versions else "main"
270
+ revision = latest_version if latest_version[1:] in available_versions else "main"
271
271
  logger.info(f"Defaulting to latest_version: {revision}.")
272
272
  elif revision in available_versions:
273
273
  revision = f"v{revision}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffusers
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Diffusers
5
5
  Home-page: https://github.com/huggingface/diffusers
6
6
  Author: The HuggingFace team
@@ -1,4 +1,4 @@
1
- diffusers/__init__.py,sha256=4f2QjsXOEIb79fxTN5qGhoK1wjUfmFbylEQucDKWr38,7592
1
+ diffusers/__init__.py,sha256=kQGvFsKmd0Su3vlL0SD2W5SKOcls4LTLqysqJ7-L4nk,7592
2
2
  diffusers/configuration_utils.py,sha256=CM8n5Ym8e-hDEFE29pTK8mYyRNY_qFpI9pqIBZbLypI,29814
3
3
  diffusers/dependency_versions_check.py,sha256=T2AQMFfOGMCULAqRAE8zf1VE5j7GFxxs7SfEuhTY4lA,1756
4
4
  diffusers/dependency_versions_table.py,sha256=4PcAiwioEAQaZUMsMvbsHeiB-sKcWZVZozIXXbyHqww,1285
@@ -14,7 +14,7 @@ diffusers/experimental/__init__.py,sha256=0C9ExG0XYiGZuzFJkZuJ53K6Ix5ylF2kWe4PGA
14
14
  diffusers/experimental/rl/__init__.py,sha256=Gcoznw9rYjfMvswH0seXekKYDAAN1YXXxZ-RWMdzvrE,57
15
15
  diffusers/experimental/rl/value_guided_sampling.py,sha256=iIhf1gc2QP7Jx4HrsoOyRCWlDnIM_qa4E15pAdFVZU4,6133
16
16
  diffusers/models/__init__.py,sha256=MDG83d8C1YGGSnGNwi9sG6c33_FEaMGS3BVGnaqWJqQ,1446
17
- diffusers/models/attention.py,sha256=yWlNnocvFzEF7d1pDK-kzJnhZyi6qSwQp1if9PQx1Pc,21418
17
+ diffusers/models/attention.py,sha256=-gsUzy8fNGPPSxzGuYXVOX4IaTzKgN7X89Jjc48EEgo,21489
18
18
  diffusers/models/attention_flax.py,sha256=IHc1OfaIfmlJ2xYHdZ2UGixO9m08ThBN-6C7fv1XEb0,17680
19
19
  diffusers/models/attention_processor.py,sha256=gnUTfw4LMUAGP_U6xGgp1VM2lY0aDFM5jLODkOg7v2o,43390
20
20
  diffusers/models/autoencoder_kl.py,sha256=AzUWbgrdxbTqwIg7bt3NRsxw9oH9GtR6USDRvkyDfkc,14620
@@ -66,12 +66,12 @@ diffusers/pipelines/ddim/pipeline_ddim.py,sha256=o7iz1PjV-9ZxTJzV4PMvR808cPcpqcf
66
66
  diffusers/pipelines/ddpm/__init__.py,sha256=9QmH5pLtYW_vH19JuiVrdEnMOrGGJbTkN3W1bhp_ReY,40
67
67
  diffusers/pipelines/ddpm/pipeline_ddpm.py,sha256=OScm5JyyaXdFLZE74kj8MfS-wO1Cdbn3gKvE4eHwMn0,4495
68
68
  diffusers/pipelines/deepfloyd_if/__init__.py,sha256=ZrlYKSfROYMXWvUFjT2LTM2obu4DKMxpHIwK6Pxr3f0,2163
69
- diffusers/pipelines/deepfloyd_if/pipeline_if.py,sha256=UZOx7NzcNefUhqx899uyrvcJ6dchFYNYHsdbLGFHLcU,39304
70
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py,sha256=IbBxjCD-Sn9nyE-zUrcGDK9qDQ2kQZnp6yJaa1Jt-qE,43914
71
- diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py,sha256=rfW7CL7DqJCyNV4w-b9gEAy1ohehDDI962KXR6WlohY,49061
72
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py,sha256=OLfNlRbeWGaA7h9H8ncOW70GkNqj3szPnQ6FLVqQkSA,49126
73
- diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py,sha256=nZFczaehdor_w-igpyDMQNu-AXn7X3dLybvoQtD5-Ek,54084
74
- diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py,sha256=gkcVbK850I1Cg4efSUxzgKMggpmvNbvbHr1FwjVBxpA,43516
69
+ diffusers/pipelines/deepfloyd_if/pipeline_if.py,sha256=ehwuXa3KA07MAWzwrhw9sSWy1-acb3OHMowTkGS5alQ,39304
70
+ diffusers/pipelines/deepfloyd_if/pipeline_if_img2img.py,sha256=J7vwELOaCTbTlZV-va5nqk4TKbCIl0q78215q0MAWYg,43914
71
+ diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py,sha256=YOJr32lu7p1QPTWUKF9ietJ9Uc31szA-PnWZ_ZIiEUY,49061
72
+ diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py,sha256=nhVaEcXDDlspkDmuDNmrx3UtWpfTP1qmD41C6Xq2iC0,49126
73
+ diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py,sha256=vzALHC7vmVvXduItL8xfm_TLf8Z3ac2YfRSFSAp1ppg,54084
74
+ diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py,sha256=iutTANZg1k8EEm3nSKnHwVywceMNk-YruAeAARbHz5o,43516
75
75
  diffusers/pipelines/deepfloyd_if/safety_checker.py,sha256=zqN0z4Mvf7AtrxlUb6qAoiw_QuxGdDk-6js5YuarxTo,2117
76
76
  diffusers/pipelines/deepfloyd_if/timesteps.py,sha256=JO8b-8zlcvk_Tb6s6GGY7MgRPRADs35y0KBcSkqmNDM,5164
77
77
  diffusers/pipelines/deepfloyd_if/watermark.py,sha256=921onf5SVSnRlc4q-x0T9WRA3ZswfLpsjcoqcD4GpEY,1595
@@ -198,7 +198,7 @@ diffusers/utils/dummy_torch_and_transformers_and_k_diffusion_objects.py,sha256=R
198
198
  diffusers/utils/dummy_torch_and_transformers_and_onnx_objects.py,sha256=SiKni7YZ-pmZrurHU3-lhbDGKOGCCVxSK3GJbrARqgU,3023
199
199
  diffusers/utils/dummy_torch_and_transformers_objects.py,sha256=lzMCxHPu4b8WDPyozOZt7VO8w0267ZSNYNetTM1aNyw,17953
200
200
  diffusers/utils/dummy_transformers_and_torch_and_note_seq_objects.py,sha256=z-JrPgPo2dWv-buMytUqBd6QqEx8Uha6M1cKa6gR4Dc,621
201
- diffusers/utils/dynamic_modules_utils.py,sha256=K3-UvcJGvxR6tSURoiXdr1cCqBcDanSmEzxBcH3gnEQ,19344
201
+ diffusers/utils/dynamic_modules_utils.py,sha256=5VlChP00ubpi2Z_21WFtXQgx-G4m8ygHNbmd4WsiZsU,19348
202
202
  diffusers/utils/hub_utils.py,sha256=ijZsAEjcBjo3Qd7ACokoykUSx0p82vOViMCLYR2aHjY,15783
203
203
  diffusers/utils/import_utils.py,sha256=g_JVWJyVxWtUDDO1u5-ibqPebSoy17QggxaEbx4-Tik,21862
204
204
  diffusers/utils/logging.py,sha256=-YXQPvkJzquZ2FRqUu2n60VSGBV4moEJz55fQpPHHsQ,9317
@@ -207,9 +207,9 @@ diffusers/utils/outputs.py,sha256=Q6UGMwk7Fy707KZutGDoHX1HiWXHgsYiiQdO7p36XBo,36
207
207
  diffusers/utils/pil_utils.py,sha256=7OkDvrfymKUdBdJIQ0GjgAF_vGK1Rf5AmVM8mfcpok4,1365
208
208
  diffusers/utils/testing_utils.py,sha256=WDEyeQxkW8c7iUHO8MDx2MVWWcndxwuLigtyBsOZLBY,17693
209
209
  diffusers/utils/torch_utils.py,sha256=8cU1D4-13dAAK2bc-WIR2t0CW87w_v4JasJ-D40QSBs,3226
210
- diffusers-0.16.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
211
- diffusers-0.16.0.dist-info/METADATA,sha256=w8aILQk6R0sLvepqLox4zmAPSR6Ds-9LA3f9Hrrnc-k,19887
212
- diffusers-0.16.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
213
- diffusers-0.16.0.dist-info/entry_points.txt,sha256=VULXr1th-UU5J0Ou_l0If6E4CY4HSSiMElweZ58u9H0,73
214
- diffusers-0.16.0.dist-info/top_level.txt,sha256=axJl2884vMSvhzrFrSoht36QXA_6gZN9cKtg4xOO72o,10
215
- diffusers-0.16.0.dist-info/RECORD,,
210
+ diffusers-0.16.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
211
+ diffusers-0.16.1.dist-info/METADATA,sha256=ggh3AHjTAFThWkYxpO7KDKr_aEADXPogLxWwEFKcKJA,19887
212
+ diffusers-0.16.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
213
+ diffusers-0.16.1.dist-info/entry_points.txt,sha256=VULXr1th-UU5J0Ou_l0If6E4CY4HSSiMElweZ58u9H0,73
214
+ diffusers-0.16.1.dist-info/top_level.txt,sha256=axJl2884vMSvhzrFrSoht36QXA_6gZN9cKtg4xOO72o,10
215
+ diffusers-0.16.1.dist-info/RECORD,,