🤗Why Cache-DiT❓❓Cache-DiT is built on top of the Diffusers library and now supports nearly ALL DiTs from Diffusers. It provides hybrid cache acceleration (DBCache, TaylorSeer, SCM, etc.) and comprehensive parallelism optimizations, including Context Parallelism, Tensor Parallelism, hybrid 2D or 3D parallelism, and dedicated extra parallelism support for Text Encoder, VAE, and ControlNet.
Cache-DiT is compatible with compilation, CPU offloading, and quantization (TorchAo, nunchaku), fully integrates with SGLang Diffusion, vLLM-Omni, ComfyUI, and runs natively on NVIDIA GPUs and Ascend NPUs. Cache-DiT is fast, easy to use, and flexible for various DiTs (online docs at 📘readthedocs.io).
(Let's go beyond Cache-DiT) 👉 SGLang Diffusion | vLLM-Omni | Diffusers
You can install the cache-dit from PyPI or from source:
pip3 install -U cache-dit # or, pip3 install git+https://github.com/vipshop/cache-dit.gitThen accelerate your DiTs with just
>>> import cache_dit
>>> from diffusers import DiffusionPipeline
>>> pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image")
>>> cache_dit.enable_cache(pipe) # Cache Acceleration with One-line code.
>>> from cache_dit import DBCacheConfig, ParallelismConfig
>>> cache_dit.enable_cache( # Or, Hybrid Cache Acceleration + 1D Parallelism.
... pipe, cache_config=DBCacheConfig(), # w/ default
... parallelism_config=ParallelismConfig(ulysses_size=2))
>>> cache_dit.enable_cache( # Or, Hybrid Cache Acceleration + 2D Parallelism.
... pipe, cache_config=DBCacheConfig(), # w/ default
... parallelism_config=ParallelismConfig(ulysses_size=2, tp_size=2))
>>> output = pipe(...) # Then, just call the pipe as normal.For more advanced features, please refer to our online documentation at 📘readthedocs.io.
- 🎉ComfyUI x Cache-DiT
- 🎉(Intel) llm-scaler x Cache-DiT
- 🎉Ascend NPU x Cache-DiT
- 🎉Diffusers x Cache-DiT
- 🎉SGLang Diffusion x Cache-DiT
- 🎉vLLM-Omni x Cache-DiT
- 🎉Nunchaku x Cache-DiT
- 🎉SD.Next x Cache-DiT
- 🎉stable-diffusion.cpp x Cache-DiT
- 🎉jetson-containers x Cache-DiT
Special thanks to vipshop's Computer Vision AI Team for supporting document, testing and deployment of this project. We learned the design and reused code from the following projects: Diffusers, SGLang, vLLM, vLLM-Omni, ParaAttention, xDiT and TaylorSeer.
@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, etc.},
year={2025}
}
