File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 336336            "PixArtAlphaPipeline" ,
337337            "PixArtSigmaPAGPipeline" ,
338338            "PixArtSigmaPipeline" ,
339+             "PyramidAttentionBroadcastConfig" ,
339340            "ReduxImageEncoder" ,
340341            "SanaPAGPipeline" ,
341342            "SanaPipeline" ,
422423            "WuerstchenCombinedPipeline" ,
423424            "WuerstchenDecoderPipeline" ,
424425            "WuerstchenPriorPipeline" ,
426+             "apply_pyramid_attention_broadcast" ,
427+             "apply_pyramid_attention_broadcast_on_module" ,
425428        ]
426429    )
427430
825828            PixArtAlphaPipeline ,
826829            PixArtSigmaPAGPipeline ,
827830            PixArtSigmaPipeline ,
831+             PyramidAttentionBroadcastConfig ,
828832            ReduxImageEncoder ,
829833            SanaPAGPipeline ,
830834            SanaPipeline ,
909913            WuerstchenCombinedPipeline ,
910914            WuerstchenDecoderPipeline ,
911915            WuerstchenPriorPipeline ,
916+             apply_pyramid_attention_broadcast ,
917+             apply_pyramid_attention_broadcast_on_module ,
912918        )
913919
914920    try :
Original file line number Diff line number Diff 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
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments