Skip to main content
SGLang Diffusion supports two AR execution paths. Qwen Image Layered and LongCat-Image use the native Qwen2.5-VL component in process. GLM-Image can use its bundled Transformers implementation or delegate AR inference to a separate SGLang server.

GLM-Image Quick Start

Run GLM-Image with its bundled Transformers implementation (default):
Run GLM-Image with a separate SGLang server for its AR stage:

Support matrix

ModelTransformers backendSGLang backend
GLM-ImageT2I, I2I, V2IT2I
Qwen Image LayeredNot usedI2I, in-process native Qwen2.5-VL
LongCat-ImageNot usedT2I, in-process native Qwen2.5-VL

Deployment Assumptions & Limitations

:::warning Network Latency & Timeouts: In SGLang backend mode, the Diffusion server sends an HTTP request to --srt-encoder-url for every auto-regressive (AR) step.
  • To prevent requests from breaking during long model generations, increase --srt-encoder-timeout (e.g., set to 100 seconds).
  • To protect the system against temporary network delays or brief drops in connection, use --srt-encoder-connection-timeout. :::
  • Recommended Setup: Run both servers on the same machine or inside the same fast local network.
  • Cross-Region Warning: Running the Diffusion server and the AR server in different geographic regions will slow down token generation and heavily reduce performance.
  • Startup Connection Check: SGLang automatically checks the connection to --srt-encoder-url when starting up. The server will stop immediately if the remote AR host is offline.

Ascend NPU ENV

To run 2 servers on same group of NPU you need to specify env variables https://www.hiascend.com/document/detail/zh/canncommercial/850/maintenref/envvar/envref_07_0144.html Example:

Best practices

GLM-Image example for Ascend A3 2 cards (4 devices)
Second terminal with diffusion server:
Result: