SkillAgentSearch skills...

MagCache

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

Install / Use

/learn @Zehong-Ma/MagCache
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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>,&nbsp; </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>,&nbsp; </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>,&nbsp; </span> <span class="author-block"> <a href="https://www.pkuvmc.com/" target="_blank">Shiliang Zhang</a><sup>1</sup><sup>*</sup>,&nbsp; </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,&nbsp;</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"> <!-- [![hf_paper](https://img.shields.io/badge/🤗-Paper%20In%20HF-red.svg)](---) -->

arXiv Home Page License github

</h5> <!-- ![visualization](./docs/static/images/intro_demo_image.png) --> <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

🎉 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
<!-- <table style="width:100%; margin: auto; text-align:center; font-size:0.7em;"> <tr> <td>HunyuanVideo T2V (54min05s)</td> <td>TeaCache (23min49s)<br>PSNR: 22.80, 2.3x speedup</td> <td>MagCache (19min33s)<br>PSNR: 26.76, <b>2.8x</b> speedup</td> </tr> </table> --> <div align="center"> <video src="https://github.com/user-attachments/assets/a815048a-b25b-4c4a-8742-6c19ab572fbb" width="100%" poster=""> </video> </div> <div class="content has-text-centered"> <img src="./assets/Hunyuan_T2V_720P_header.jpg" style="width: 100%"><br> </div> <details style="width: 100%; margin: auto;"> <summary>Prompt: The video shows two astronauts in bulky suits walking slowly on the moon’s surface....</summary> The video shows two astronauts in bulky suits walking slowly on the moon’s surface, against a vast starry universe. Their steps are heavy and slow, kicking up dust in the low-gravity environment. The scene is silent, mysterious, and evokes the courage and dreams of space exploration. </details>
  • Wan2.1 14B I2V 720P
<!-- <table style="width:100%; text-align:center; font-size:0.7em;"> <tr> <td>Wan2.1 14B I2V (30min40s)</td> <td>TeaCache (13min04s)<br>PSNR: 13.67, 2.3x speedup</td> <td>MagCache (10min03s)<br>PSNR: 23.67, <b>3.0x</b> speedup</td> </tr> </table> --> <div align="center"> <video src="https://github.com/user-attachments/assets/98c03bad-59ac-4d7f-bd43-7792c60ac957" width="100%" poster=""> </video> </div> <div class="content has-text-centered"> <img src="./assets/Wan_14B_I2V_720P_header.jpg" style="width: 100%"><br> </div> <details style="width: 100%; margin: auto;"> <summary>Prompt: A woman in black lace stands confidently in a dim Art Deco interior with polished marble floors....</summary> A woman in black lace stands confidently in a dim Art Deco interior with polished marble floors. Stark chiaroscuro lighting highlights her sharp features as she tilts her head, crimson lips parting in a knowing smile. Her smoldering gaze meets the viewer while she turns gracefully, lace casting shifting shadows on the walls. A medium shot with a subtle dolly zoom, framed by velvet drapes, adds depth. The mysterious, refined atmosphere blends modern elegance with vintage Hollywood glamour, rendered in 8K hyper-realistic detail, metallic gold accents glowing in the soft light. </details>
  • Wan2.1 14B T2V 720P
<!-- <table style="width:100%; text-align:center; font-size:0.7em;"> <tr> <td>Wan2.1 14B T2V (60min04s)</td> <td>TeaCache (30min01s) <br> PSNR: 17.39, 2.0x speedup</td> <td>MagCache (21min40s) <br> PSNR: 24.39, <b>2.8x</b> speedup</td> </tr> </table> --> <div align="center"> <video src="https://github.com/user-attachments/assets/39dd52b8-3b45-4c87-b6fd-df979c0d062c" width="100%" poster=""> </video> </div> <div class="content has-text-centered"> <img src="./assets/Wan_14B_T2V_720P_header1.jpg" style="width: 100%"><br> </div> <details style="width: 100%; margin: auto;"> <summary>Prompt: The video shows two astronauts in bulky suits walking slowly on the moon’s surface....</summary> The video shows two astronauts in bulky suits walking slowly on the moon’s surface, against a vast starry universe. Their steps are heavy and slow, kicking up dust in the low-gravity environment. The scene is silent, mysterious, and evokes the courage and dreams of space exploration. </details> <!-- <table style="width:100%; text-align:center; font-size:0.7em;"> <tr> <td>Wan2.1 14B T2V (60min04s)</td> <td
View on GitHub
GitHub Stars265
CategoryContent
Updated18d ago
Forks8

Languages

Python

Security Score

95/100

Audited on Mar 20, 2026

No findings