+15






![mintlify[bot]](/assets/img/avatar_default.png)


Mingyi
AdityaVKochar
mintlify[bot]
adhyan-jain
Adhyan Jain
Maitri-shah29
Adarsh Shirawalmath
Maitri Shah
Aditya Vardhan Kochar
Rishit Shivam
Rishitshivam
IshhanKheria
Ishita Joshi
Richard Chen
longGGGGGG
Richard
Nakul Sinha
Divyam Agrawal
Richardczl98
Krishang Zinzuwadia
nimeshas
Claude Opus 4.6
github-actions[bot]
Jignas Paturu
zijiexia
a3291b5654
Co-authored-by: AdityaVKochar <adityavardhankochar@gmail.com> Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: adhyan-jain <adhyanjain2006@gmail.com> Co-authored-by: Adhyan Jain <71976554+adhyan-jain@users.noreply.github.com> Co-authored-by: Maitri-shah29 <maitrirajivshah@gmail.com> Co-authored-by: Adarsh Shirawalmath <114558126+adarshxs@users.noreply.github.com> Co-authored-by: Maitri Shah <shah29maitri@gmail.com> Co-authored-by: Aditya Vardhan Kochar <80113212+AdityaVKochar@users.noreply.github.com> Co-authored-by: Rishit Shivam <164783543+pokymono@users.noreply.github.com> Co-authored-by: Rishitshivam <164783543+Rishitshivam@users.noreply.github.com> Co-authored-by: IshhanKheria <ishhankheria06@gmail.com> Co-authored-by: Ishita Joshi <ishitata.joshi@gmail.com> Co-authored-by: Richard Chen <104477092+Richardczl98@users.noreply.github.com> Co-authored-by: longGGGGGG <553746008@qq.com> Co-authored-by: Richard <richardchen@radixark.ai> Co-authored-by: Nakul Sinha <nakul.new4socials@gmail.com> Co-authored-by: Divyam Agrawal <ludicrouslytrue@gmail.com> Co-authored-by: Richardczl98 <Zhenlinc@stanford.edu> Co-authored-by: Krishang Zinzuwadia <krishangzinzuwadia@gmail.com> Co-authored-by: nimeshas <nimesha.s106@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jignas Paturu <86356085+JignasP@users.noreply.github.com> Co-authored-by: zijiexia <37504505+zijiexia@users.noreply.github.com>
66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
---
|
|
title: SGLang Diffusion
|
|
description: Accelerated image and video generation with diffusion models.
|
|
---
|
|
|
|
SGLang Diffusion is an inference framework for accelerated image and video generation using diffusion models. It provides an end-to-end unified pipeline with optimized kernels and an efficient scheduler loop.
|
|
|
|
## Key features
|
|
|
|
* **Broad model support:** Wan series, FastWan series, Hunyuan, Qwen-Image, Qwen-Image-Edit, Flux, Z-Image, GLM-Image, and more
|
|
* **Fast inference:** optimized kernels, efficient scheduler loop, and Cache-DiT acceleration
|
|
* **Ease of use:** OpenAI-compatible API, CLI, and Python SDK
|
|
* **Multi-platform:** NVIDIA GPUs (H100, H200, A100, B200, 4090), AMD GPUs (MI300X, MI325X), and Ascend NPU (A2, A3)
|
|
|
|
## Quick start
|
|
|
|
1. **Install SGLang Diffusion**
|
|
|
|
```bash
|
|
uv pip install "sglang[diffusion]" --prerelease=allow
|
|
```
|
|
|
|
See the [installation guide](../docs/sglang-diffusion/installation) for more installation methods and ROCm-specific instructions.
|
|
|
|
2. **Run a one-off generation**
|
|
|
|
```bash
|
|
sglang generate --model-path Qwen/Qwen-Image \
|
|
--prompt "A beautiful sunset over the mountains" \
|
|
--save-output
|
|
```
|
|
|
|
3. **Serve with the OpenAI-compatible API**
|
|
|
|
```bash
|
|
sglang serve --model-path Qwen/Qwen-Image --port 30010
|
|
```
|
|
|
|
## CLI quick reference
|
|
|
|
### Generate (one-off generation)
|
|
|
|
```bash
|
|
sglang generate --model-path <MODEL> --prompt "<PROMPT>" --save-output
|
|
```
|
|
|
|
### Serve (HTTP server)
|
|
|
|
```bash
|
|
sglang serve --model-path <MODEL> --port 30010
|
|
```
|
|
|
|
### Enable Cache-DiT acceleration
|
|
|
|
```bash
|
|
SGLANG_CACHE_DIT_ENABLED=true sglang generate --model-path <MODEL> --prompt "<PROMPT>"
|
|
```
|
|
|
|
## References
|
|
|
|
* [SGLang GitHub](https://github.com/sgl-project/sglang)
|
|
* [Cache-DiT](https://github.com/vipshop/cache-dit)
|
|
* [FastVideo](https://github.com/hao-ai-lab/FastVideo)
|
|
* [xDiT](https://github.com/xdit-project/xDiT)
|
|
* [Diffusers](https://github.com/huggingface/diffusers)
|