[Misc] Keep model-specific curl recipes
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
b9572edb81
commit
39e1c70aea
4 files changed
+27
-57
No files matched your search
@@ -1,9 +1,9 @@
|
||||
# Text-To-Image
|
||||
|
||||
This shared example demonstrates online text-to-image generation with vLLM-Omni.
|
||||
The startup script defaults to Qwen-Image, but `MODEL` can select any supported
|
||||
text-to-image model. Clients send the canonical Images API request; the server
|
||||
side owns model-specific prompt processing.
|
||||
This example demonstrates online text-to-image generation with vLLM-Omni. The
|
||||
startup script and Python clients default to Qwen-Image, but `MODEL` can select
|
||||
any supported text-to-image model. The existing curl helper remains a concrete
|
||||
Qwen-Image request, while the server side owns model-specific prompt processing.
|
||||
|
||||
## Start Server
|
||||
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Shared text-to-image curl example
|
||||
# Qwen-Image text-to-image curl example
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${BASE_URL:-http://localhost:8091}"
|
||||
PROMPT="${PROMPT:-a dragon laying over the spine of the Green Mountains of Vermont}"
|
||||
SIZE="${SIZE:-}"
|
||||
SEED="${SEED:-}"
|
||||
OUTPUT_PATH="${OUTPUT_PATH:-text_to_image_output.png}"
|
||||
|
||||
curl -sS -X POST "${BASE_URL}/v1/images/generations" \
|
||||
curl -X POST http://localhost:8091/v1/images/generations \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg prompt "${PROMPT}" --arg size "${SIZE}" --arg seed "${SEED}" \
|
||||
'{prompt: $prompt}
|
||||
+ (if $size == "" then {} else {size: $size} end)
|
||||
+ (if $seed == "" then {} else {seed: ($seed | tonumber)} end)')" \
|
||||
| jq -r '.data[0].b64_json' \
|
||||
| base64 -d > "${OUTPUT_PATH}"
|
||||
|
||||
echo "Saved image to ${OUTPUT_PATH}"
|
||||
-d '{
|
||||
"prompt": "a dragon laying over the spine of the Green Mountains of Vermont",
|
||||
"size": "1024x1024",
|
||||
"seed": 42
|
||||
}' | jq -r '.data[0].b64_json' | base64 -d > dragon.png
|
||||
Reference in new issue
Block a user