[diffusion] doc: fix diffusion docs and cookbook drift (#29302)

This commit is contained in:
Mick
2026-06-25 21:13:00 +08:00
committed by GitHub
parent bc150173b2
commit 890b38c211
12 changed files with 51 additions and 46 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ FLUX models are optimized for high-quality image generation. The recommended lau
### 3.2 Configuration Tips
Current supported optimization all listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--vae-path`: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
- `--num-gpus`: Number of GPUs to use
@@ -61,7 +61,7 @@ Current supported optimization all listed [here](https://github.com/sgl-project/
## 4. API Usage
For complete API documentation, please refer to the [official API usage guide](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md).
For complete API documentation, please refer to the [official API usage guide](/docs/sglang-diffusion/api/openai_api).
### 4.1 Generate an Image
@@ -89,7 +89,7 @@ with open("output.png", "wb") as f:
#### 4.2.1 Cache-DiT Acceleration
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/cache_dit.md).
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](/docs/sglang-diffusion/cache_dit).
**Basic Usage**
+2 -2
View File
@@ -46,14 +46,14 @@ The step count and guidance scale are **request-time** settings (see [API Usage]
### 3.2 Configuration Tips
Currently supported optimizations are listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--num-gpus`: Number of GPUs to use.
- `--tp-size`: Tensor parallelism size (the recommended multi-GPU path for Krea-2). Its attention heads (48, with 12 KV heads) and text heads (20) are divisible by a tensor-parallel size of 1, 2, or 4.
## 4. API Usage
For complete API documentation, please refer to the [official API usage guide](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md).
For complete API documentation, please refer to the [official API usage guide](/docs/sglang-diffusion/api/openai_api).
### 4.1 Generate an Image
+3 -3
View File
@@ -41,7 +41,7 @@ import { MOVADeployment } from '/src/snippets/diffusion/mova-deployment.jsx'
### 3.2 Configuration Tips
Current supported optimization all listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--num-gpus`: Number of GPUs to use
- `--tp`: Tensor parallelism size (should not be larger than 1 if text encoder offload is enabled, as layer-wise offload plus prefetch is faster)
@@ -52,7 +52,7 @@ Current supported optimization all listed [here](https://github.com/sgl-project/
## 4. API Usage
For complete API documentation, please refer to the [official API usage guide](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md).
For complete API documentation, please refer to the [official API usage guide](/docs/sglang-diffusion/api/openai_api).
### 4.1 CLI Generation (sglang generate)
@@ -95,7 +95,7 @@ curl -X POST "http://0.0.0.0:30002/v1/videos" \
#### 4.3.1 Cache-DiT Acceleration
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/cache_dit.md).
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](/docs/sglang-diffusion/cache_dit).
**Basic Usage**
@@ -41,7 +41,7 @@ Qwen-Image-Edit-2511 is a 20B parameter model optimized for image editing tasks.
### 3.2 Configuration Tips
Current supported optimization all listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--vae-path`: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
- `--num-gpus`: Number of GPUs to use
@@ -52,7 +52,7 @@ Current supported optimization all listed [here](https://github.com/sgl-project/
## 4. API Usage
For complete API documentation, please refer to the [official API usage guide](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md).
For complete API documentation, please refer to the [official API usage guide](/docs/sglang-diffusion/api/openai_api).
### 4.1 Edit an Image
@@ -80,7 +80,7 @@ with open("output.png", "wb") as f:
#### 4.2.1 Cache-DiT Acceleration
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/cache_dit.md).
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](/docs/sglang-diffusion/cache_dit).
**Basic Usage**
@@ -32,7 +32,7 @@ Qwen-Image is a text-to-image model. The recommended launch configurations vary
### 3.2 Configuration Tips
Current supported optimization all listed [here](../../../docs/sglang-diffusion/attention_backends#platform-support-matrix).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--vae-path`: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
- `--num-gpus`: Number of GPUs to use
+19 -19
View File
@@ -9,7 +9,7 @@ metatags:
<div style={{display: 'flex', gap: '8px'}}>
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License" /></a>
<a href="https://github.com/sgl-project/sgl-cookbook/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
<a href="https://github.com/sgl-project/sglang/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
</div>
Create a comprehensive cookbook for diffusion models in SGLang, demonstrating SGLang's performance advantages for image and video generation workloads.
@@ -35,18 +35,18 @@ Each recipe provides step-by-step instructions to help you quickly implement SGL
The sglang diffusion cookbook directory structure are shown below:
```text Example
sgl-cookbook/docs/diffusion/
├── README.md # Main cookbook (this file)
├── Qwen-Image/ # Qwen-Image series models docs
│ ├── Qwen-Image.md
│ └── Qwen-Image-Edit.md
├── Wan/ # Wan series models docs
│ ├── Wan2.1.md
│ └── Wan2.2.md
├── Z-Image/ # Z-Image series models docs
│ └── Z-Image-Turbo.md
├── Ernie-Image/ # ERNIE-Image series models docs
│ └── Ernie-Image.md
docs_new/cookbook/diffusion/
├── README.mdx # Main cookbook (this file)
├── Qwen-Image/ # Qwen-Image series docs
│ ├── Qwen-Image.mdx
│ └── Qwen-Image-Edit.mdx
├── Wan/ # Wan series docs
│ ├── Wan2.1.mdx
│ └── Wan2.2.mdx
├── Z-Image/ # Z-Image series docs
│ └── Z-Image-Turbo.mdx
├── Ernie-Image/ # ERNIE-Image series docs
│ └── Ernie-Image.mdx
└── ...
```
@@ -66,27 +66,27 @@ We believe the best documentation comes from practitioners. Whether you've optim
```shell Command
# Fork the repo and clone locally
git clone https://github.com/YOUR_USERNAME/sglang-cookbook.git
cd sglang-cookbook
git clone https://github.com/YOUR_USERNAME/sglang.git
cd sglang
# Create a new branch
git checkout -b add-my-recipe
# Add your recipe following the template in DeepSeek-V3.2
# Add your recipe under docs_new/cookbook/diffusion/
# Submit a PR!
```
## 📖 Resources
- [SGLang GitHub](https://github.com/sgl-project/sglang)
- [SGLang Documentation](https://sgl-project.github.io)
- [SGLANG Diffusion Documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/README.md)
- [SGLang Documentation](/)
- [SGLang Diffusion Documentation](/docs/sglang-diffusion/index)
- [SLACK Channel](https://sgl-fru7574.slack.com/archives/C07GLLLESNR)
- [Community Slack/Discord](https://discord.gg/MpEEuAeb)
## 📄 License
This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/sgl-project/sgl-cookbook/blob/main/LICENSE) file for details.
This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/sgl-project/sglang/blob/main/LICENSE) file for details.
---
+3 -3
View File
@@ -39,7 +39,7 @@ The Wan2.2 series offers models in various sizes, architectures and input types,
### 3.2 Configuration Tips
Current supported optimization all listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--vae-path`: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
- `--num-gpus {NUM_GPUS}`: Number of GPUs to use
@@ -53,7 +53,7 @@ Current supported optimization all listed [here](https://github.com/sgl-project/
### 4.1 Basic Usage
For more API usage and request examples, please refer to:
[SGLang Diffusion OpenAI API](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md)
[SGLang Diffusion OpenAI API](/docs/sglang-diffusion/api/openai_api)
#### 4.1.1 Launch a server and then send requests
@@ -100,7 +100,7 @@ sglang generate "${SERVER_ARGS[@]}" "${SAMPLING_ARGS[@]}"
#### 4.2.1 Cache-DiT Acceleration
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/cache/cache_dit.md).
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](/docs/sglang-diffusion/cache_dit).
**Basic Usage**
@@ -42,7 +42,7 @@ Z-Image-Turbo is optimized for high-quality image generation with only 8 inferen
### 3.2 Configuration Tips
Current supported optimization all listed [here](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/support_matrix.md).
Currently supported optimizations are listed [here](/docs/sglang-diffusion/compatibility_matrix).
- `--vae-path`: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
- `--num-gpus`: Number of GPUs to use
@@ -55,7 +55,7 @@ Current supported optimization all listed [here](https://github.com/sgl-project/
## 4. API Usage
For complete API documentation, please refer to the [official API usage guide](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/openai_api.md).
For complete API documentation, please refer to the [official API usage guide](/docs/sglang-diffusion/api/openai_api).
### 4.1 Generate an Image
@@ -82,7 +82,7 @@ with open("output.png", "wb") as f:
#### 4.2.1 Cache-DiT Acceleration
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](https://github.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/docs/cache_dit.md).
SGLang integrates [Cache-DiT](https://github.com/vipshop/cache-dit), a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set `SGLANG_CACHE_DIT_ENABLED=True` to enable it. For more details, please refer to the SGLang Cache-DiT [documentation](/docs/sglang-diffusion/cache_dit).
**Basic Usage**
+1 -1
View File
@@ -79,7 +79,7 @@ Realtime models keep a session alive and generate chunk by chunk with causal sta
<CardGroup cols={3}>
<Card
title="LingBot World (Realtime)"
title="LingBot World"
mode="card"
href="/cookbook/diffusion/LingBot-World/LingBot-World"
img="/cards/logos/inclusionai.png"