From c94ce4d85fe3db56e07fb4c7a9e64c87ce80d7e4 Mon Sep 17 00:00:00 2001 From: Zeyu Huang <11222265+fhfuih@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:34:02 +0800 Subject: [PATCH] [Doc] complete the clarification on batch image generation (#567) Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com> --- .../offline_inference/text_to_image.md | 17 +++++++++++++++++ .../offline_inference/text_to_image/README.md | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/user_guide/examples/offline_inference/text_to_image.md b/docs/user_guide/examples/offline_inference/text_to_image.md index fbc62526b..cf5cdf860 100644 --- a/docs/user_guide/examples/offline_inference/text_to_image.md +++ b/docs/user_guide/examples/offline_inference/text_to_image.md @@ -23,6 +23,23 @@ if __name__ == "__main__": images[0].save("coffee.png") ``` +Or put more than one prompt in a request, processing them sequentially. + +```python +from vllm_omni.entrypoints.omni import Omni + +if __name__ == "__main__": + omni = Omni(model="Qwen/Qwen-Image") + prompts = [ + "a cup of coffee on a table", + "a toy dinosaur on a sandy beach", + "a fox waking up in bed and yawning", + ] + outputs = omni.generate(prompts) + for i, output in enumerate(outputs): + image = output.request_output[0]["images"][0].save(f"{i}.jpg") +``` + ## Local CLI Usage ```bash diff --git a/examples/offline_inference/text_to_image/README.md b/examples/offline_inference/text_to_image/README.md index 21358f333..2403c4139 100644 --- a/examples/offline_inference/text_to_image/README.md +++ b/examples/offline_inference/text_to_image/README.md @@ -5,6 +5,8 @@ This folder provides several entrypoints for experimenting with `Qwen/Qwen-Image - `text_to_image.py`: command-line script for single image generation with advanced options. - `web_demo.py`: lightweight Gradio UI for interactive prompt/seed/CFG exploration. +Note that when you pass in multiple independent prompts, they will be processed sequentially. Batching requests is currently not supported. + ## Basic Usage ```python @@ -18,6 +20,23 @@ if __name__ == "__main__": images[0].save("coffee.png") ``` +Or put more than one prompt in a request, processing them sequentially. + +```python +from vllm_omni.entrypoints.omni import Omni + +if __name__ == "__main__": + omni = Omni(model="Qwen/Qwen-Image") + prompts = [ + "a cup of coffee on a table", + "a toy dinosaur on a sandy beach", + "a fox waking up in bed and yawning", + ] + outputs = omni.generate(prompts) + for i, output in enumerate(outputs): + image = output.request_output[0]["images"][0].save(f"{i}.jpg") +``` + ## Local CLI Usage ```bash