xdit-project/xDiT

xDiT: A Scalable Inference Engine for Diffusion Transformers (DiTs) with Massive Parallelism

xDiT is an open-source inference engine designed to run Diffusion Transformers (DiTs) — the AI models behind high-quality image and video generation — across multiple GPUs or machines. Its goal is to make these models fast enough for real-time use, which is challenging because the attention mechanism inside DiTs grows quadratically with input length, demanding heavy parallel computing.

Key capabilities

  • Parallel inference: xDiT offers several ways to split the work across devices:
    • Sequence Parallelism (USP): Splits the input sequence across GPUs.
    • PipeFusion: A pipeline method that exploits the step-by-step nature of diffusion to overlap computation.
    • Data Parallel: Processes multiple prompts or images at once.
    • CFG Parallel: Doubles parallelism when using classifier-free guidance.
    • These can be combined (hybrid) to match the hardware.
  • Cache acceleration: Reuses intermediate results across diffusion steps (e.g., TeaCache, DiTFastAttn) to speed up single-GPU inference.
  • Computing acceleration: Uses kernel optimizations and compilation tools like torch.compile and onediff.

Supported models

xDiT works with many popular DiT models, including Flux, HunyuanVideo, StepVideo, Wan2.1, Stable Diffusion 3, PixArt, SANA, and more. A full table is in the README.

Quick start

Install via pip:

pip install xfuser

Or from source. Then run a model with the built-in runner:

xdit --model FLUX.1-dev --prompt "A cat running in a garden" --ulysses_degree 8

Alternatively, use example scripts for older models. The README also explains how to launch an HTTP service and lists supported attention backends (e.g., SDPA, FlashAttention, cuDNN).

ComfyUI integration

xDiT powers a commercial ComfyUI variant called TACO-DiT (closed-source) for multi-GPU workflows, and a plugin is available for the open-source ComfyUI.

For full details, see the project README.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch