Skip to main content

A PyTorch-native and Flexible Inference Engine with Hybrid Cache Acceleration and Parallelism for ๐Ÿค—DiTs.

Project description

A PyTorch-native and Flexible Inference Engine with
Hybrid Cache Acceleration and Parallelism for ๐Ÿค—DiTs
Featured๏ฝœHelloGitHub

Baseline SCM S S* SCM F D* SCM U D* +TS +compile +FP8*
24.85s 15.4s 11.4s 8.2s 8.2s ๐ŸŽ‰7.1s ๐ŸŽ‰4.5s

Scheme: DBCache + SCM(steps_computation_mask) + TS(TaylorSeer) + FP8*, L20x1, S*: static cache,
D*: dynamic cache, S: Slow, F: Fast, U: Ultra Fast, TS: TaylorSeer, FP8*: FP8 DQ + Sage, FLUX.1-Dev

U*: Ulysses Attention, UAA: Ulysses Anything Attenton, UAA*: UAA + Gloo, Device: NVIDIA L20
FLUX.1-Dev w/o CPU Offload, 28 steps; Qwen-Image w/ CPU Offload, 50 steps; Gloo: Extra All Gather w/ Gloo

CP2 U* CP2 UAA* L20x1 CP2 UAA* CP2 U* L20x1 CP2 UAA*
FLUX, 13.87s ๐ŸŽ‰13.88s 23.25s ๐ŸŽ‰13.75s Qwen, 132s 181s ๐ŸŽ‰133s
1024x1024 1024x1024 1008x1008 1008x1008 1312x1312 1328x1328 1328x1328
โœ”๏ธU* โœ”๏ธUAA โœ”๏ธU* โœ”๏ธUAA NO CP โŒU* โœ”๏ธUAA โœ”๏ธU* โœ”๏ธUAA NO CP โŒU* โœ”๏ธUAA

SGLang Diffusion x Cache-DiT News vLLM Omni x Cache-DiT News

๐Ÿ”ฅHightlight

We are excited to announce that the ๐ŸŽ‰v1.1.0 version of cache-dit has finally been released! It brings ๐Ÿ”ฅContext Parallelism and ๐Ÿ”ฅTensor Parallelism to cache-dit, thus making it a PyTorch-native and Flexible Inference Engine for ๐Ÿค—DiTs. Key features: Unified Cache APIs, Forward Pattern Matching, Block Adapter, DBCache, DBPrune, Cache CFG, TaylorSeer, SCM, Context Parallelism (w/ UAA), Tensor Parallelism and ๐ŸŽ‰SOTA performance.

pip3 install -U cache-dit # Also, pip3 install git+https://github.com/huggingface/diffusers.git (latest)

You can install the stable release of cache-dit from PyPI, or the latest development version from GitHub. Then try โ™ฅ๏ธ Cache Acceleration with just one line of code ~ โ™ฅ๏ธ

>>> import cache_dit
>>> from diffusers import DiffusionPipeline
>>> pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image") # Can be any diffusion pipeline
>>> cache_dit.enable_cache(pipe) # One-line code with default cache options.
>>> output = pipe(...) # Just call the pipe as normal.
>>> stats = cache_dit.summary(pipe) # Then, get the summary of cache acceleration stats.
>>> cache_dit.disable_cache(pipe) # Disable cache and run original pipe.

๐Ÿ“šCore Features

๐Ÿ”ฅSupported DiTs

[!Tip]
One Model Series may contain many pipelines. cache-dit applies optimizations at the Transformer level; thus, any pipelines that include the supported transformer are already supported by cache-dit. โœ…: supported now; โœ–๏ธ: not supported now; ๐Ÿค–Q: nunchaku w/ SVDQ W4A4; C-P: Context Parallelism; T-P: Tensor Parallelism; TE-P: Text Encoder Parallelism; CN-P: ControlNet Parallelism; VAE-P: VAE Parallelism (TODO).

๐Ÿ“šSupported DiTs: ๐Ÿค—65+ Cache C-P T-P TE-P CN-P VAE-P
Z-Image-Turbo ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Layered โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2511-Lightning โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2511 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
LongCat-Image โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
LongCat-Image-Edit โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Z-Image-Turbo โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Z-Image-Turbo-Fun-ControlNet-2.0 โœ… โœ… โœ… โœ… โœ… โœ–๏ธ
Z-Image-Turbo-Fun-ControlNet-2.1 โœ… โœ… โœ… โœ… โœ… โœ–๏ธ
Ovis-Image โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
FLUX.2-dev โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-dev โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-Fill-dev โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-Kontext-dev โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2509 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-ControlNet โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-ControlNet-Inpainting โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Lightning โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-Lightning โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2509-Lightning โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.2-T2V โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.2-ITV โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.2-VACE-Fun โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.1-T2V โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.1-ITV โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.1-FLF2V โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Wan-2.1-VACE โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
HunyuanImage-2.1 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
HunyuanVideo-1.5 โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
HunyuanVideo โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-dev ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-Fill-dev ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
FLUX.1-Kontext-dev ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2509 ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Lightning ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-Lightning ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Qwen-Image-Edit-2509-Lightning ๐Ÿค–Q โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
SkyReels-V2-T2V โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
LongCat-Video โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
ChronoEdit-14B โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Kandinsky-5.0-T2V-Lite โœ… โœ…๏ธ โœ…๏ธ โœ… โœ–๏ธ โœ–๏ธ
PRX-512-t2i-sft โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
LTX-Video-v0.9.8 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
LTX-Video-v0.9.7 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
CogVideoX โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
CogVideoX-1.5 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
CogView-4 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
CogView-3-Plus โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
Chroma1-HD โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
PixArt-Sigma-XL-2-1024-MS โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
PixArt-XL-2-1024-MS โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
VisualCloze-512 โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
ConsisID-preview โœ… โœ… โœ… โœ… โœ–๏ธ โœ–๏ธ
mochi-1-preview โœ… โœ–๏ธ โœ… โœ… โœ–๏ธ โœ–๏ธ
Lumina-Image-2.0 โœ… โœ–๏ธ โœ… โœ… โœ–๏ธ โœ–๏ธ
HiDream-I1-Full โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
HunyuanDiT โœ… โœ–๏ธ โœ… โœ… โœ–๏ธ โœ–๏ธ
Sana-1600M-1024px โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
DiT-XL-2-256 โœ… โœ… โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Allegro-T2V โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
OmniGen-2 โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
stable-diffusion-3.5-large โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
Amused-512 โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
AuraFlow โœ… โœ–๏ธ โœ–๏ธ โœ… โœ–๏ธ โœ–๏ธ
๐Ÿ”ฅClick here to show many Image/Video cases๐Ÿ”ฅ

๐ŸŽ‰Now, cache-dit covers almost All Diffusers' DiT Pipelines๐ŸŽ‰
๐Ÿ”ฅQwen-Image | Qwen-Image-Edit | Qwen-Image-Edit-Plus ๐Ÿ”ฅ
๐Ÿ”ฅFLUX.1 | Qwen-Image-Lightning 4/8 Steps | Wan 2.1 | Wan 2.2 ๐Ÿ”ฅ
๐Ÿ”ฅHunyuanImage-2.1 | HunyuanVideo | HunyuanDiT | HiDream | AuraFlow๐Ÿ”ฅ
๐Ÿ”ฅCogView3Plus | CogView4 | LTXVideo | CogVideoX | CogVideoX 1.5 | ConsisID๐Ÿ”ฅ
๐Ÿ”ฅCosmos | SkyReelsV2 | VisualCloze | OmniGen 1/2 | Lumina 1/2 | PixArt๐Ÿ”ฅ
๐Ÿ”ฅChroma | Sana | Allegro | Mochi | SD 3/3.5 | Amused | ... | DiT-XL๐Ÿ”ฅ

๐Ÿ”ฅWan2.2 MoE | +cache-dit:2.0xโ†‘๐ŸŽ‰ | HunyuanVideo | +cache-dit:2.1xโ†‘๐ŸŽ‰

๐Ÿ”ฅQwen-Image | +cache-dit:1.8xโ†‘๐ŸŽ‰ | FLUX.1-dev | +cache-dit:2.1xโ†‘๐ŸŽ‰

๐Ÿ”ฅQwen...Lightning | +cache-dit:1.14xโ†‘๐ŸŽ‰ | HunyuanImage | +cache-dit:1.7xโ†‘๐ŸŽ‰

๐Ÿ”ฅQwen-Image-Edit | Input w/o Edit | Baseline | +cache-dit:1.6xโ†‘๐ŸŽ‰ | 1.9xโ†‘๐ŸŽ‰

๐Ÿ”ฅFLUX-Kontext-dev | Baseline | +cache-dit:1.3xโ†‘๐ŸŽ‰ | 1.7xโ†‘๐ŸŽ‰ | 2.0xโ†‘ ๐ŸŽ‰

๐Ÿ”ฅHiDream-I1 | +cache-dit:1.9xโ†‘๐ŸŽ‰ | CogView4 | +cache-dit:1.4xโ†‘๐ŸŽ‰ | 1.7xโ†‘๐ŸŽ‰

๐Ÿ”ฅCogView3 | +cache-dit:1.5xโ†‘๐ŸŽ‰ | 2.0xโ†‘๐ŸŽ‰| Chroma1-HD | +cache-dit:1.9xโ†‘๐ŸŽ‰

๐Ÿ”ฅMochi-1-preview | +cache-dit:1.8xโ†‘๐ŸŽ‰ | SkyReelsV2 | +cache-dit:1.6xโ†‘๐ŸŽ‰

๐Ÿ”ฅVisualCloze-512 | Model | Cloth | Baseline | +cache-dit:1.4xโ†‘๐ŸŽ‰ | 1.7xโ†‘๐ŸŽ‰

๐Ÿ”ฅLTX-Video-0.9.7 | +cache-dit:1.7xโ†‘๐ŸŽ‰ | CogVideoX1.5 | +cache-dit:2.0xโ†‘๐ŸŽ‰

๐Ÿ”ฅOmniGen-v1 | +cache-dit:1.5xโ†‘๐ŸŽ‰ | 3.3xโ†‘๐ŸŽ‰ | Lumina2 | +cache-dit:1.9xโ†‘๐ŸŽ‰

๐Ÿ”ฅAllegro | +cache-dit:1.36xโ†‘๐ŸŽ‰ | AuraFlow-v0.3 | +cache-dit:2.27xโ†‘๐ŸŽ‰

๐Ÿ”ฅSana | +cache-dit:1.3xโ†‘๐ŸŽ‰ | 1.6xโ†‘๐ŸŽ‰| PixArt-Sigma | +cache-dit:2.3xโ†‘๐ŸŽ‰

๐Ÿ”ฅPixArt-Alpha | +cache-dit:1.6xโ†‘๐ŸŽ‰ | 1.8xโ†‘๐ŸŽ‰| SD 3.5 | +cache-dit:2.5xโ†‘๐ŸŽ‰

๐Ÿ”ฅAsumed | +cache-dit:1.1xโ†‘๐ŸŽ‰ | 1.2xโ†‘๐ŸŽ‰ | DiT-XL-256 | +cache-dit:1.8xโ†‘๐ŸŽ‰
โ™ฅ๏ธ Please consider to leave a โญ๏ธ Star to support us ~ โ™ฅ๏ธ

๐Ÿ“–Table of Contents

๐Ÿš€Quick Links

  • ๐Ÿ“ŠExamples - The easiest way to enable hybrid cache acceleration and parallelism for DiTs with cache-dit is to start with our examples for popular models: FLUX, Z-Image, Qwen-Image, Wan, etc.
  • ๐ŸŒHTTP Serving - Deploy cache-dit models with HTTP API for text-to-image, image editing, multi-image editing, and text/image-to-video generation.
  • ๐ŸŽ‰User Guide - For more advanced features, please refer to the ๐ŸŽ‰User_Guide.md for details.
  • โ“FAQ - Frequently asked questions including attention backend configuration, troubleshooting, and optimization tips.

๐Ÿ“šDocumentation

๐Ÿ‘‹Contribute

How to contribute? Star โญ๏ธ this repo to support us or check CONTRIBUTE.md.

๐ŸŽ‰Projects Using CacheDiT

Here is a curated list of open-source projects integrating CacheDiT, including popular repositories like jetson-containers, flux-fast, ๐Ÿ”ฅsdnext, ๐Ÿ”ฅstable-diffusion.cpp, ๐Ÿ”ฅnunchaku, ๐Ÿ”ฅvLLM-Omni, and ๐Ÿ”ฅSGLang Diffusion. ๐ŸŽ‰CacheDiT has been recommended by many famous opensource projects: ๐Ÿ”ฅZ-Image, ๐Ÿ”ฅWan 2.2, ๐Ÿ”ฅQwen-Image, ๐Ÿ”ฅLongCat-Video, Qwen-Image-Lightning, Kandinsky-5, LeMiCa, ๐Ÿค—diffusers, HelloGitHub and GiantPandaLLM.

ยฉ๏ธAcknowledgements

Special thanks to vipshop's Computer Vision AI Team for supporting document, testing and production-level deployment of this project. We learned the design and reused code from the following projects: ๐Ÿค—diffusers, SGLang, ParaAttention, xDiT, TaylorSeer and LeMiCa.

ยฉ๏ธCitations

@misc{cache-dit@2025,
  title={cache-dit: A PyTorch-native and Flexible Inference Engine with Hybrid Cache Acceleration and Parallelism for DiTs.},
  url={https://github.com/vipshop/cache-dit.git},
  note={Open-source software available at https://github.com/vipshop/cache-dit.git},
  author={DefTruth, vipshop.com},
  year={2025}
}

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cache_dit-1.1.10-py3-none-any.whl (267.9 kB view details)

Uploaded Python 3

File details

Details for the file cache_dit-1.1.10-py3-none-any.whl.

File metadata

  • Download URL: cache_dit-1.1.10-py3-none-any.whl
  • Upload date:
  • Size: 267.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cache_dit-1.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5f697410cc81f519bd7833f1f4f1f3d9d94fad768f049790b43d0e701e5d3d04
MD5 61f1f1d1c8f4db3b17bb50c8eca2558c
BLAKE2b-256 c9d2d61f814de0871ccb460443f73fd8e0c4d9f3aa033f5c2be4e38cb97e959b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page