Skip to content

Commit 3c79498

Browse files
committed
Add Caching Mechanisms section to README for Wan pipelines
Signed-off-by: James Huang <syhuang1201@gmail.com>
1 parent 1d5d773 commit 3c79498

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
[![Unit Tests](https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml/badge.svg)](https://github.com/AI-Hypercomputer/maxdiffusion/actions/workflows/UnitTests.yml)
1818

1919
# What's new?
20+
- **`2026/03/31`**: Wan2.2 SenCache inference is now supported for T2V and I2V (up to 1.4x speedup)
2021
- **`2026/03/25`**: Wan2.1 and Wan2.2 Magcache inference is now supported
2122
- **`2026/03/25`**: LTX-2 Video Inference is now supported
2223
- **`2026/01/29`**: Wan LoRA for inference is now supported
@@ -571,6 +572,32 @@ To generate images, run the following command:
571572
* For Wan2.2 T2V, use `base_wan_27b.yml`.
572573
* For Wan2.2 I2V, use `base_wan_i2v_27b.yml`.
573574

575+
### Caching Mechanisms
576+
577+
Wan 2.x pipelines support several caching strategies to accelerate inference by skipping redundant transformer forward passes. These are **mutually exclusive** — enable only one at a time.
578+
579+
| Cache Type | Config Flag | Supported Pipelines | Speedup | Description |
580+
| --- | --- | --- | --- | --- |
581+
| **CFG Cache** | `use_cfg_cache: True` | Wan 2.1 T2V, Wan 2.2 T2V/I2V | ~1.2x | FasterCache-style: caches the unconditional branch and applies FFT frequency-domain compensation on skipped steps. |
582+
| **SenCache** | `use_sen_cache: True` | Wan 2.2 T2V/I2V | ~1.4x | Sensitivity-Aware Caching ([arXiv:2602.24208](https://arxiv.org/abs/2602.24208)): predicts output change via first-order sensitivity S = α_x·‖Δx‖ + α_t·\|Δt\|. Skips the full CFG forward pass when predicted change is below tolerance ε. |
583+
| **MagCache** | `use_magcache: True` | Wan 2.1 T2V | ~1.3x | Magnitude-based caching with configurable threshold and retention ratio. |
584+
585+
To enable a caching mechanism, set the corresponding flag in your config YAML or pass it as a command-line override:
586+
587+
```bash
588+
# Example: enable SenCache for Wan 2.2 T2V
589+
python src/maxdiffusion/generate_wan.py \
590+
src/maxdiffusion/configs/base_wan_27b.yml \
591+
use_sen_cache=True \
592+
...
593+
594+
# Example: enable CFG Cache for Wan 2.2 I2V
595+
python src/maxdiffusion/generate_wan.py \
596+
src/maxdiffusion/configs/base_wan_i2v_27b.yml \
597+
use_cfg_cache=True \
598+
...
599+
```
600+
574601
## Flux
575602

576603
First make sure you have permissions to access the Flux repos in Huggingface.

0 commit comments

Comments
 (0)