Skip to content

Commit cbc086f

Browse files
committed
update
1 parent bb250d6 commit cbc086f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/diffusers/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
"PixArtAlphaPipeline",
337337
"PixArtSigmaPAGPipeline",
338338
"PixArtSigmaPipeline",
339+
"PyramidAttentionBroadcastConfig",
339340
"ReduxImageEncoder",
340341
"SanaPAGPipeline",
341342
"SanaPipeline",
@@ -422,6 +423,8 @@
422423
"WuerstchenCombinedPipeline",
423424
"WuerstchenDecoderPipeline",
424425
"WuerstchenPriorPipeline",
426+
"apply_pyramid_attention_broadcast",
427+
"apply_pyramid_attention_broadcast_on_module",
425428
]
426429
)
427430

@@ -825,6 +828,7 @@
825828
PixArtAlphaPipeline,
826829
PixArtSigmaPAGPipeline,
827830
PixArtSigmaPipeline,
831+
PyramidAttentionBroadcastConfig,
828832
ReduxImageEncoder,
829833
SanaPAGPipeline,
830834
SanaPipeline,
@@ -909,6 +913,8 @@
909913
WuerstchenCombinedPipeline,
910914
WuerstchenDecoderPipeline,
911915
WuerstchenPriorPipeline,
916+
apply_pyramid_attention_broadcast,
917+
apply_pyramid_attention_broadcast_on_module,
912918
)
913919

914920
try:

src/diffusers/pipelines/pyramid_attention_broadcast_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def apply_pyramid_attention_broadcast(
143143
Example:
144144
145145
```python
146+
>>> import torch
146147
>>> from diffusers import CogVideoXPipeline, PyramidAttentionBroadcastConfig, apply_pyramid_attention_broadcast
147148
148149
>>> pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16)
@@ -169,6 +170,10 @@ def apply_pyramid_attention_broadcast(
169170
)
170171
config.spatial_attention_block_skip_range = 2
171172

173+
# Note: For diffusers models, we know that it will be either a transformer or a unet, and we also follow
174+
# the naming convention. The option to specify a denoiser is provided for flexibility when this function
175+
# is used outside of the diffusers library, say for a ComfyUI custom model. In that case, the user can
176+
# specify pipeline as None but provide the denoiser module.
172177
if denoiser is None:
173178
denoiser = pipeline.transformer if hasattr(pipeline, "transformer") else pipeline.unet
174179

0 commit comments

Comments
 (0)