Skip to content

Enable Taylorseer for all Flux Pipelines #14922

Description

@Reis-McMillan

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions