MagCache  by Zehong-Ma

Magnitude-aware caching for accelerated diffusion models

Created 7 months ago
253 stars

Top 99.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

MagCache introduces a training-free caching technique to accelerate inference for video and image diffusion models. Targeting researchers and practitioners in generative AI, it leverages magnitude observations to estimate output differences across timesteps, significantly reducing latency while maintaining or improving visual quality.

How It Works

The core innovation is Magnitude-aware Cache (MagCache), which analyzes the magnitude ratio of output residuals between diffusion timesteps. This robust and stable criterion allows MagCache to predict and cache intermediate results, bypassing computationally expensive steps during inference without requiring additional training.

Quick Start & Requirements

Installation details are not explicitly provided, but the project is integrated with ComfyUI via ComfyUI-MagCache and ComfyUI-WanVideoWrapper. It supports numerous diffusion models (e.g., Wan2.1, Open-Sora, FLUX, Qwen-Image), implying a need for GPU acceleration and standard deep learning environment setups. Further details and demos are available on the official project page: https://zehong-ma.github.io/MagCache/.

Highlighted Details

  • Accepted to NeurIPS 2025.
  • Achieves significant speedups (up to 2x) across various models like Wan2.1, OmniGen2, and Flux-Kontext.
  • Offers a training-free approach, simplifying integration and reducing computational overhead.
  • Claims comparable or improved visual quality alongside reduced latency.

Maintenance & Community

The project encourages community contributions for supporting additional models via pull requests. It lists several community integrations, including ComfyUI wrappers. The primary authors are affiliated with Peking University and Huawei Inc.

Licensing & Compatibility

The core MagCache code is released under the permissive Apache 2.0 license. However, users must also adhere to the licenses of the underlying libraries it integrates with (e.g., VideoSys, Diffusers, Open-Sora), which may introduce compatibility considerations for closed-source or commercial applications.

Limitations & Caveats

Support for new models requires manual implementation of specific calibration and forward functions. As a recent release, long-term maintenance and the full scope of compatibility across all dependent libraries remain to be seen.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Yaowei Zheng Yaowei Zheng(Author of LLaMA-Factory), and
1 more.

FastVideo by hao-ai-lab

1.4%
3k
Framework for accelerated video generation
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.