[diffusion] doc: consolidate documentation (#21373)

This commit is contained in:
Mick
2026-03-25 16:01:32 +08:00
committed by GitHub
parent f5c225eeba
commit 6425df5c8a
15 changed files with 204 additions and 376 deletions
+22 -74
View File
@@ -1,100 +1,48 @@
# SGLang Diffusion
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.
SGLang Diffusion is a high-performance inference framework for image and video generation. It provides native SGLang pipelines, diffusers backend support, an OpenAI-compatible server, and an optimized kernel stack built on both precompiled `sgl-kernel` operators and JIT kernels for key inference paths.
## 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)
- Ascend NPU (A2, A3)
- Apple Silicon (M-series via MPS)
- Moore Threads GPUs (MTT S5000)
---
- Broad model support across Wan, Hunyuan, Qwen-Image, FLUX, Z-Image, GLM-Image, and more
- Fast inference with `sgl-kernel`, JIT kernels, scheduler improvements, and caching acceleration
- Multiple interfaces: `sglang generate`, `sglang serve`, and an OpenAI-compatible API
- Multi-platform support for NVIDIA, AMD, Ascend, Apple Silicon, and Moore Threads
## Quick Start
### Installation
```bash
uv pip install "sglang[diffusion]" --prerelease=allow
```
See [Installation Guide](installation.md) for more installation methods and ROCm-specific instructions.
### Basic Usage
Generate an image with the CLI:
```bash
sglang generate --model-path Qwen/Qwen-Image \
--prompt "A beautiful sunset over the mountains" \
--save-output
--prompt "A beautiful sunset over the mountains" \
--save-output
```
Or start a server with the OpenAI-compatible API:
```bash
sglang serve --model-path Qwen/Qwen-Image --port 30010
```
---
## Start Here
## Documentation
- [Installation](installation.md): install SGLang Diffusion and platform dependencies
- [Compatibility Matrix](compatibility_matrix.md): check model and optimization support
- [CLI](api/cli.md): run one-off generation jobs or launch a persistent server
- [OpenAI-Compatible API](api/openai_api.md): send image and video requests to the HTTP server
- [Attention Backends](performance/attention_backends.md): choose the best backend for your model and hardware
- [Caching Acceleration](performance/cache/index.md): use Cache-DiT or TeaCache to reduce denoising cost
- [Quantization](quantization.md): load quantized transformer checkpoints
- [Contributing](contributing.md): contribution workflow, adding new models, and CI perf baselines
### Getting Started
## Additional Documentation
- **[Installation](installation.md)** - Install SGLang Diffusion via pip, uv, Docker, or from source
- **[Compatibility Matrix](compatibility_matrix.md)** - Supported models and optimization compatibility
### Usage
- **[CLI Documentation](api/cli.md)** - Command-line interface for `sglang generate` and `sglang serve`
- **[Quantization](quantization.md)** - Quantized transformer checkpoint usage and supported quantization families
- **[OpenAI API](api/openai_api.md)** - OpenAI-compatible API for image/video generation and LoRA management
- **[Post-Processing](api/post_processing.md)** - Frame interpolation (RIFE) and upscaling (Real-ESRGAN)
### Performance Optimization
- **[Performance Overview](performance/index.md)** - Overview of all performance optimization strategies
- **[Attention Backends](performance/attention_backends.md)** - Available attention backends (FlashAttention, SageAttention, etc.)
- **[Caching Strategies](performance/cache/)** - Cache-DiT and TeaCache acceleration
- **[Profiling](performance/profiling.md)** - Profiling techniques with PyTorch Profiler and Nsight Systems
### Reference
- **[Environment Variables](environment_variables.md)** - Configuration via environment variables
- **[Support New Models](support_new_models.md)** - Guide for adding new diffusion models
- **[Contributing](contributing.md)** - Contribution guidelines and commit message conventions
- **[CI Performance](ci_perf.md)** - Performance baseline generation script
---
## 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>"
```
---
- [Post-Processing](api/post_processing.md): frame interpolation and upscaling
- [Performance Overview](performance/index.md): overview of attention, caching, and profiling
- [Environment Variables](environment_variables.md): platform, caching, storage, and debugging configuration
- [Support New Models](support_new_models.md): implementation guide for new diffusion pipelines
- [CI Performance](ci_perf.md): performance baseline generation
## References