From b129e8a2999d465fb54d358dfbf4e612e0617bb9 Mon Sep 17 00:00:00 2001 From: Mick Date: Thu, 30 Jul 2026 21:05:54 +0800 Subject: [PATCH] [diffusion] docs: surface diffusion AR and PE guides (#32932) --- docs_new/docs.json | 2 ++ docs_new/docs/sglang-diffusion/api/cli.mdx | 4 ++-- docs_new/docs/sglang-diffusion/index.mdx | 2 ++ .../docs/sglang-diffusion/models_with_ar.mdx | 5 +++- .../docs/sglang-diffusion/models_with_pe.mdx | 23 +++++++++++-------- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/docs_new/docs.json b/docs_new/docs.json index a6a18b18d..c71d23f62 100644 --- a/docs_new/docs.json +++ b/docs_new/docs.json @@ -1326,6 +1326,8 @@ "pages": [ "docs/sglang-diffusion/api/cli", "docs/sglang-diffusion/api/openai_api", + "docs/sglang-diffusion/models_with_ar", + "docs/sglang-diffusion/models_with_pe", "docs/sglang-diffusion/api/post_processing" ] }, diff --git a/docs_new/docs/sglang-diffusion/api/cli.mdx b/docs_new/docs/sglang-diffusion/api/cli.mdx index 442deda7c..23c6b7e3d 100644 --- a/docs_new/docs/sglang-diffusion/api/cli.mdx +++ b/docs_new/docs/sglang-diffusion/api/cli.mdx @@ -92,10 +92,10 @@ Use `sglang generate --help` and `sglang serve --help` for the full argument lis - `--attention-backend {BACKEND}`: attention backend for native SGLang and diffusers pipelines - `--component-attention-backends {MAP}`: per-component attention backend overrides, for example `text_encoder=torch_sdpa,transformer=fa` - `--attention-backend-config {CONFIG}`: attention backend configuration -- `--srt-encoder-url {HTTPADDRESS}`: address of SGLang srt server with AR model for GLM-Image like models +- `--srt-encoder-url {HTTPADDRESS}`: address of SGLang srt server with AR model for GLM-Image like models. See [Models with AR Stage](../models_with_ar). - `--srt-encoder-timeout {SECONDS}`: Timeout in seconds for HTTP requests to the SGLang encoder server - `--srt-encoder-connection-timeout {SECONDS}`: TCP connection timeout in seconds for SGLang encoder server -- `--pe-server-url {HTTPADDRESS}`: url of SGLang server hosting the PE model (e.g., for ERNIE-Image) +- `--pe-server-url {HTTPADDRESS}`: url of SGLang server hosting the PE model (e.g., for ERNIE-Image). See [Models with Prompt Enhancement](../models_with_pe). ### Sampling and output diff --git a/docs_new/docs/sglang-diffusion/index.mdx b/docs_new/docs/sglang-diffusion/index.mdx index 210c07e6d..06aeafe67 100644 --- a/docs_new/docs/sglang-diffusion/index.mdx +++ b/docs_new/docs/sglang-diffusion/index.mdx @@ -41,6 +41,8 @@ sglang serve --model-path Qwen/Qwen-Image --port 30010 ## Additional Documentation - [Post-Processing](/docs/sglang-diffusion/api/post_processing): frame interpolation and upscaling +- [Models with AR Stage](/docs/sglang-diffusion/models_with_ar): run hybrid diffusion pipelines like GLM-Image with a separate AR encoder server +- [Models with Prompt Enhancement](/docs/sglang-diffusion/models_with_pe): run ERNIE-Image with either built-in PE or a separate PE server - [Deployment and Performance Modes](/docs/sglang-diffusion/deployment_cookbook): choose `--performance-mode`, offload, FSDP, CFG parallelism, SP, and TP - [Attention Backends](/docs/sglang-diffusion/attention_backends): choose the best backend for your model and hardware - [Sequence Parallelism](/docs/sglang-diffusion/ring_sp_performance): configure SP, Ulysses, and ring-based splitting for long sequences diff --git a/docs_new/docs/sglang-diffusion/models_with_ar.mdx b/docs_new/docs/sglang-diffusion/models_with_ar.mdx index 544b98bc0..bd047f3d0 100644 --- a/docs_new/docs/sglang-diffusion/models_with_ar.mdx +++ b/docs_new/docs/sglang-diffusion/models_with_ar.mdx @@ -1,5 +1,6 @@ --- title: "Diffusion models with AR stage like GLM-Image" +description: "Run diffusion pipelines that delegate an AR stage to a separate SGLang server, such as GLM-Image." --- ## Quick Start @@ -27,7 +28,9 @@ sglang serve --model-path /path/to/zai-org/GLM-Image/vision_language_encoder/ \ ``` ```bash # Terminal 2 : launch server with Diffusion model -sglang serve --model-path /path/to/zai-org/GLM-Image/ --srt-encoder-url "http://${HOST}:${AR_PORT}" +sglang serve --model-path /path/to/zai-org/GLM-Image/ \ + --srt-encoder-url "http://${HOST}:${AR_PORT}" \ + --port ${PORT} ``` ```bash # Terminal 3 : launch client diff --git a/docs_new/docs/sglang-diffusion/models_with_pe.mdx b/docs_new/docs/sglang-diffusion/models_with_pe.mdx index cce6f0351..9de6c99ca 100644 --- a/docs_new/docs/sglang-diffusion/models_with_pe.mdx +++ b/docs_new/docs/sglang-diffusion/models_with_pe.mdx @@ -1,6 +1,7 @@ ---- -title: "Diffusion Models with Prompt Enhancement (PE)" ---- +--- +title: "Diffusion Models with Prompt Enhancement (PE)" +description: "Run ERNIE-Image with built-in prompt enhancement or a separate SGLang-served PE model." +--- ## Quick Start @@ -32,10 +33,12 @@ Run the model with an SGLang-served PE model (high performance): # Terminal 1: launch SGLang PE model server sglang serve --model-path /path/to/baidu/ERNIE-Image/pe/ --port ${PE_PORT} ``` -```bash -# Terminal 2: launch diffusion model server with PE server -sglang serve --model-path /path/to/baidu/ERNIE-Image/ --pe-server-url "http://${HOST}:${PE_PORT}" -``` +```bash +# Terminal 2: launch diffusion model server with PE server +sglang serve --model-path /path/to/baidu/ERNIE-Image/ \ + --pe-server-url "http://${HOST}:${PE_PORT}" \ + --port ${PORT} +``` ```bash # Terminal 3: launch client curl -X POST http://${HOST}:${PORT}/v1/images/generations \ @@ -56,6 +59,6 @@ curl -X POST http://${HOST}:${PORT}/v1/images/generations \ |-------|-------------|------------------| | ERNIE-Image | ✅ | ✅ | -## Ascend NPU Environment - -Check here. +## Ascend NPU Environment + +See [Diffusion models with AR stage like GLM-Image](/docs/sglang-diffusion/models_with_ar#ascend-npu-env).