Text-to-Image

Generate images from text prompts with vLLM-Omni, SGLang, or TensorRT-LLM

以 Markdown 格式查看

Choose a backend for text-to-image generation. See the Diffusion Overview for installation and shared configuration.

Text-to-image generation runs a vLLM-Omni worker with --output-modalities image.

Tested Models

ModelNotes
Qwen/Qwen-ImageDefault model
AIDC-AI/Ovis-Image-7B
zai-org/GLM-Image2-stage; see Disaggregated Serving

To run a non-default model, pass --model to the launch script:

bash examples/backends/vllm/launch/agg_omni_image.sh --model AIDC-AI/Ovis-Image-7B

Launch

Launch using the provided script with Qwen/Qwen-Image:

bash examples/backends/vllm/launch/agg_omni_image.sh

Generate an Image

Image generation is available on two endpoints: /v1/chat/completions returns base64-encoded images inline in choices[].delta.content[].image_url, while /v1/images/generations returns a URL or base64 depending on response_format.

curl -s http://localhost:8000/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen-Image",
"prompt": "A cat sitting on a windowsill",
"size": "1024x1024",
"response_format": "url"
}'

See Also