MagCache: Fast Video Generation with Magnitude-Aware Cache

Zehong Ma, Long-Hui Wei, Feng Wang, Shi-Liang Zhang, Qi Tian
6/1/2025
51 citations

Official code: Zehong-Ma/MagCache (280 stars). 1 more implementation below.

Abstract

Existing acceleration techniques for video diffusion models often rely on uniform heuristics or time-embedding variants to skip timesteps and reuse cached features. These approaches typically require extensive calibration with curated prompts and risk inconsistent outputs due to prompt-specific overfitting.

Show full abstract

In this paper, we introduce a novel and robust discovery: a unified magnitude law observed across different models and prompts. Specifically, the magnitude ratio of successive residual outputs decreases monotonically, steadily in most timesteps while rapidly in the last several steps. Leveraging this insight, we introduce a Magnitude-aware Cache (MagCache) that adaptively skips unimportant timesteps using an error modeling mechanism and adaptive caching strategy. Unlike existing methods requiring dozens of curated samples for calibration, MagCache only requires a single sample for calibration. Experimental results show that MagCache achieves 2.10x-2.68x speedups on Open-Sora, CogVideoX, Wan 2.1, and HunyuanVideo, while preserving superior visual fidelity. It significantly outperforms existing methods in LPIPS, SSIM, and PSNR, under similar computational budgets.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
Zehong-Ma/MagCacheOfficial280–––
Zehong-Ma/ComfyUI-MagCacheOfficial275–––

The official code for NeurIPS 2025 "MagCache: Fast Video Generation with Magnitude-Aware Cache"

2807

The official code that integrates MagCache (Fast Video Generation with Magnitude-Aware Cache) with ComfyUI.

27524

Similar Papers

Cite this paper

@article{ma2025magcache,
  title  = {MagCache: Fast Video Generation with Magnitude-Aware Cache},
  author = {Zehong Ma and Long-Hui Wei and Feng Wang and Shi-Liang Zhang and Qi Tian},
  year   = {2025},
  eprint = {2506.09045},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.09045},
  url    = {https://doi.org/10.48550/arXiv.2506.09045},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.09045.svg)](https://codeofpaper.com/paper/2506.09045)

Discussion