Merge d76b744ac3 into 6bf668c4d2
This commit is contained in:
@@ -29,7 +29,7 @@ Cache methods speedup diffusion transformers by storing and reusing intermediate
|
|||||||
|
|
||||||
[[autodoc]] apply_faster_cache
|
[[autodoc]] apply_faster_cache
|
||||||
|
|
||||||
### FirstBlockCacheConfig
|
## FirstBlockCacheConfig
|
||||||
|
|
||||||
[[autodoc]] FirstBlockCacheConfig
|
[[autodoc]] FirstBlockCacheConfig
|
||||||
|
|
||||||
|
|||||||
@@ -66,4 +66,8 @@ config = FasterCacheConfig(
|
|||||||
tensor_format="BFCHW",
|
tensor_format="BFCHW",
|
||||||
)
|
)
|
||||||
pipeline.transformer.enable_cache(config)
|
pipeline.transformer.enable_cache(config)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## FirstBlockCache
|
||||||
|
|
||||||
|
[FirstBlock Cache](https://huggingface.co/docs/diffusers/main/en/api/cache#diffusers.FirstBlockCacheConfig) builds on the ideas of [TeaCache](https://huggingface.co/papers/2411.19108). It is much simpler to implement generically for a wide range of models and has been integrated first for experimental purposes.
|
||||||
@@ -41,9 +41,11 @@ class CacheMixin:
|
|||||||
Enable caching techniques on the model.
|
Enable caching techniques on the model.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
config (`Union[PyramidAttentionBroadcastConfig]`):
|
config (`Union[PyramidAttentionBroadcastConfig, FasterCacheConfig, FirstBlockCacheConfig]`):
|
||||||
The configuration for applying the caching technique. Currently supported caching techniques are:
|
The configuration for applying the caching technique. Currently supported caching techniques are:
|
||||||
- [`~hooks.PyramidAttentionBroadcastConfig`]
|
- [`~hooks.PyramidAttentionBroadcastConfig`]
|
||||||
|
- [`~hooks.FasterCacheConfig`]
|
||||||
|
- [`~hooks.FirstBlockCacheConfig`]
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user