MagCache
The official code for NeurIPS 2025 "MagCache: Fast Video Generation with Magnitude-Aware Cache"
Install / Use
/learn @Zehong-Ma/MagCacheREADME
MagCache: Fast Video Generation with Magnitude-Aware Cache
<div class="is-size-5 publication-authors", align="center",> <span class="author-block"> <a href="https://zehong-ma.github.io/" target="_blank">Zehong Ma</a><sup>1,2</sup><sup>†</sup>, </span> <span class="author-block"> <a href="https://joinwei-pku.github.io/longhuiwei.github.io/" target="_blank">Longhui Wei</a><sup>2</sup><sup>*</sup><sup>‡</sup>, </span> <span class="author-block"> <a href="https://scholar.google.com/citations?user=bKG4Un8AAAAJ&hl=zh-CN" target="_blank">Feng Wang</a><sup>2</sup>, </span> <span class="author-block"> <a href="https://www.pkuvmc.com/" target="_blank">Shiliang Zhang</a><sup>1</sup><sup>*</sup>, </span> <span class="author-block"> <a href="https://www.qitian1987.com/" target="_blank">Qi Tian</a><sup>2</sup> </span> </div> <div class="is-size-5 publication-authors", align="center",> <span class="author-block"><sup>1</sup>State Key Laboratory of Multimedia Information Processing, <br>School of Computer Science, Peking University, </span> <span class="author-block"><sup>2</sup>Huawei Inc.</span> </div> <div class="is-size-5 publication-authors", align="center",> († Work was done during internship at Huawei Inc., ‡ Project Leader. * Corresponding author.) </div> <h5 align="center"> <!-- [](---) --> </h5> <!--  --> <div class="content has-text-centered"> <img src="./docs/static/images/intro_demo_image.jpg" style="width: 100%;"><br> <span style="font-size: 0.8em; width: 100%; display: inline-block;">Figure 1: Visualization of MagCache on Open-Sora and Wan2.1. MagCache can achieve better visual quality with a comparable or less latency. More demos are shown in the subfolders of each model.</span> </div>🫖 Introduction
We introduce Magnitude-aware Cache (MagCache), a training-free caching approach that estimates and leverages the fluctuating differences among model outputs across timesteps based on the robust magnitude observations, thereby accelerating the inference. MagCache works well for Video Diffusion Models, Image Diffusion models. For more details and results, please visit our project page.
<div class="content has-text-centered"> <img src="./docs/static/images/final_intro.png" style="width: 95%;"><br> <span style="font-size: 0.8em; width: 100%; display: inline-block;">Figure 2: Relationships between output residuals across diffusion timesteps. Magnitude ratio serves as both an accurate and stable criterion for measuring the difference between residuals.</span> </div>🔥 Latest News
- If you like our project, please give us a star ⭐ on GitHub for the latest update.
- [2025/11/17] 🔥Accepted by NeurIPS 2025. Welcome to follow and improve MagCache.
- [2025/8/20] 🔥 Support Qwen-Image and Qwen-Image-Edit with 1.5x speedup officially.
- [2025/8/7] 🔥 Support Wan2.2 with 1.5-2x speedup officially.
- [2025/7/14] 🔥 Support OmniGen2 with 1.9x speedup officially.
- [2025/6/30] 🔥 Support Flux-Kontext with 2x speedup officially.
- [2025/6/19] 🔥 Support FramePack officially.
- [2025/6/17] 🔥 Support VACE 1.3B&14B officially.
- [2025/6/17] 🔥 MagCache is supported by ComfyUI-WanVideoWrapper. Thanks @kijai.
- [2025/6/16] 🔥 Support Chroma officially. Please try it in ComfyUI-MagCache.
- [2025/6/12] 🔥 Support ComfyUI-MagCache officially. Please have a try!
- [2025/6/10] 🔥 Support Wan2.1, HunyuanVideo, FLUX, Open-Sora.
- [2025/6/10] 🎉 Release the code of MagCache.
- [2025/6/10] 🎉 Release the paper of MagCache.
🧩 Community Contributions
If you develop/use MagCache in your projects and you would like more people to see it, please inform us.(zehongma@stu.pku.edu.cn)
ComfyUI
- ComfyUI-WanVideoWrapper
- ComfyUI-MagCache (Community) for MagCache. Support Flux now. Thanks @wildminder. Our official ComfyUI-MagCache now support Wan2.1, HunyuanVideo, Flux.
🎉 Supported Models
Text to Video
Image to Video
Video Editing
Text to Image
<!-- - [MagCache4FLUX-schnell](./MagCache4FLUX_schnell/README.md) -->Image Editing
Demos
- HunyuanVideo T2V 720P
- Wan2.1 14B I2V 720P
- Wan2.1 14B T2V 720P
