2828 StableDiffusionPipeline ,
2929 StableDiffusionXLPipeline ,
3030 UNet2DConditionModel ,
31- apply_faster_cache ,
31+ apply_fastercache ,
3232)
3333from diffusers .image_processor import VaeImageProcessor
3434from diffusers .loaders import FluxIPAdapterMixin , IPAdapterMixin
3737from diffusers .models .unets .unet_3d_condition import UNet3DConditionModel
3838from diffusers .models .unets .unet_i2vgen_xl import I2VGenXLUNet
3939from diffusers .models .unets .unet_motion_model import UNetMotionModel
40- from diffusers .pipelines .faster_cache_utils import FasterCacheBlockHook , FasterCacheDenoiserHook
40+ from diffusers .pipelines .fastercache_utils import FasterCacheBlockHook , FasterCacheDenoiserHook
4141from diffusers .pipelines .pipeline_utils import StableDiffusionMixin
4242from diffusers .schedulers import KarrasDiffusionSchedulers
4343from diffusers .utils import logging
@@ -2291,21 +2291,21 @@ def test_fastercache_basic_warning_or_errors_raised(self):
22912291 # Check if warning is raised when no FasterCacheConfig is provided
22922292 pipe = self .pipeline_class (** components )
22932293 with CaptureLogger (logger ) as cap_logger :
2294- apply_faster_cache (pipe )
2294+ apply_fastercache (pipe )
22952295 self .assertTrue ("No FasterCacheConfig provided" in cap_logger .out )
22962296
22972297 # Check if warning is raise when no attention_weight_callback is provided
22982298 pipe = self .pipeline_class (** components )
22992299 with CaptureLogger (logger ) as cap_logger :
23002300 config = FasterCacheConfig (spatial_attention_block_skip_range = 2 , attention_weight_callback = None )
2301- apply_faster_cache (pipe , config )
2301+ apply_fastercache (pipe , config )
23022302 self .assertTrue ("No `attention_weight_callback` provided when enabling FasterCache" in cap_logger .out )
23032303
23042304 # Check if error raised when unsupported tensor format used
23052305 pipe = self .pipeline_class (** components )
23062306 with self .assertRaises (ValueError ):
23072307 config = FasterCacheConfig (spatial_attention_block_skip_range = 2 , tensor_format = "BFHWC" )
2308- apply_faster_cache (pipe , config )
2308+ apply_fastercache (pipe , config )
23092309
23102310 def test_fastercache_inference (self , expected_atol : float = 0.1 ):
23112311 device = "cpu" # ensure determinism for the device-dependent torch.Generator
@@ -2321,7 +2321,7 @@ def test_fastercache_inference(self, expected_atol: float = 0.1):
23212321 original_image_slice = output .flatten ()
23222322 original_image_slice = np .concatenate ((original_image_slice [:8 ], original_image_slice [- 8 :]))
23232323
2324- apply_faster_cache (pipe , self .fastercache_config )
2324+ apply_fastercache (pipe , self .fastercache_config )
23252325
23262326 inputs = self .get_dummy_inputs (device )
23272327 inputs ["num_inference_steps" ] = 4
@@ -2353,7 +2353,7 @@ def test_fastercache_state(self):
23532353 pipe = self .pipeline_class (** components )
23542354 pipe .set_progress_bar_config (disable = None )
23552355
2356- apply_faster_cache (pipe , self .fastercache_config )
2356+ apply_fastercache (pipe , self .fastercache_config )
23572357
23582358 expected_hooks = 0
23592359 if self .fastercache_config .spatial_attention_block_skip_range is not None :
0 commit comments