Skip to content

Commit bc0a7e4

Browse files
committed
feat: add KV caching support for Wan models
1 parent bb3b0c6 commit bc0a7e4

12 files changed

Lines changed: 849 additions & 128 deletions

src/maxdiffusion/configs/base_wan_14b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ flow_shift: 3.0
348348
# Skips the unconditional forward pass on ~35% of steps via residual compensation.
349349
# See: FasterCache (Lv et al. 2024), WAN 2.1 paper §4.4.2
350350
use_cfg_cache: False
351+
use_kv_cache: False
351352
use_magcache: False
352353
magcache_thresh: 0.12
353354
magcache_K: 2

src/maxdiffusion/configs/base_wan_1_3b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ flow_shift: 3.0
301301

302302
# Diffusion CFG cache (FasterCache-style, WAN 2.1 T2V only)
303303
use_cfg_cache: False
304+
use_kv_cache: False
304305

305306
# Based on 3.4. in https://arxiv.org/pdf/2305.08891.pdf
306307
guidance_rescale: 0.0

src/maxdiffusion/configs/base_wan_27b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ boundary_ratio: 0.875
323323

324324
# Diffusion CFG cache (FasterCache-style)
325325
use_cfg_cache: False
326+
use_kv_cache: False
326327
# SenCache: Sensitivity-Aware Caching (arXiv:2602.24208) — skip forward pass
327328
# when predicted output change (based on accumulated latent/timestep drift) is small
328329
use_sen_cache: False

src/maxdiffusion/configs/base_wan_i2v_14b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ flow_shift: 5.0
306306

307307
# Diffusion CFG cache (FasterCache-style)
308308
use_cfg_cache: False
309+
use_kv_cache: False
309310
# SenCache: Sensitivity-Aware Caching (arXiv:2602.24208)
310311
use_sen_cache: False
311312
use_magcache: False

src/maxdiffusion/configs/base_wan_i2v_27b.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ boundary_ratio: 0.875
318318

319319
# Diffusion CFG cache (FasterCache-style)
320320
use_cfg_cache: False
321+
use_kv_cache: False
321322
# SenCache: Sensitivity-Aware Caching (arXiv:2602.24208)
322323
use_sen_cache: False
323324

0 commit comments

Comments
 (0)