The FluxTransformer2DModel inherits from CacheMixin so pipe.transformer.enable_cache(TaylorSeerCacheConfig(...)) installs Taylorseer hooks. In src/diffusers/pipelines/flux/pipeline_flux.py, the transformer is wrapped with with self.transformer.cache_context("cond"): as well as with self.transformer.cache_context("uncond"): at line 917.
No other Flux pipeline wraps the transformer, so pipe.transformer.enable_cache(TaylorSeerCacheConfig(...)) throws a ValueError: No cache context is set. Wrap the denoiser call in model.cache_context(name, ...) before calling it.
Wrapping all Flux pipelines so that they can be implemented with TaylorSeer caching would be useful, and is a relatively simple implementation.
The
FluxTransformer2DModelinherits fromCacheMixinsopipe.transformer.enable_cache(TaylorSeerCacheConfig(...))installs Taylorseer hooks. In src/diffusers/pipelines/flux/pipeline_flux.py, the transformer is wrapped withwith self.transformer.cache_context("cond"):as well aswith self.transformer.cache_context("uncond"):at line 917.No other Flux pipeline wraps the transformer, so
pipe.transformer.enable_cache(TaylorSeerCacheConfig(...))throws aValueError:No cache context is set. Wrap the denoiser call inmodel.cache_context(name, ...)before calling it.Wrapping all Flux pipelines so that they can be implemented with TaylorSeer caching would be useful, and is a relatively simple implementation.