Skip to content

Installation

Prequisites

  • Python >= 3.10 (3.12, recommended)
  • PyTorch >= 2.7.1 (2.11.0, recommended)
  • CUDA >= 12.6 (>= 13.0, recommended) for Nvidia GPU
  • Diffusers >= 0.36.0 (>= 0.37.0, recommended)
  • TorchAo >= 0.15.0 (>= 0.17.0, recommended)

Installation with Nvidia GPU

Firstly, install the required dependencies, including PyTorch, Diffusers, and TorchAo. We recommend installing the latest versions for better compatibility and performance.

pip install -U uv # use uv for faster installation
uv pip install torch==2.11.0 torchvision torchaudio triton \
  transformers diffusers accelerate torchao opencv-python-headless \
  einops imageio-ffmpeg ftfy numpy

Then, you can install Cache-DiT from PyPI:

uv pip install -U cache-dit # PyPI, stable release.
uv pip install git+https://github.com/vipshop/cache-dit.git # latest

Or, install Cache-DiT with SVDQuant support (Experimental):

# Required: CUDA 13.0+, PyTorch 2.11+, Ubuntu 22.04+ (GLIBC 2.32+).
uv pip install -U cache-dit-cu13 # PyPI, stable release with SVDQ.
# Optional: just build Cache-DiT with SVDQuant support from source.
git clone https://github.com/vipshop/cache-dit.git && cd cache-dit
git submodule update --init --recursive --force # init submodules 
CACHE_DIT_BUILD_SVDQUANT=1 MAX_JOBS=32 uv pip install -e ".[quantization]"

Installation with Ascend NPU

Please refer to Ascend NPU Support documentation for more details.

Installation with AMD GPU

Please refer to AMD GPU Support documentation for more details.