用通义团队 Tongyi-MAI 的 Z-Image 根据文字生成图片,在网页或通过 API 探索写实场景和中英文文字设计。


Generate a photorealistic image of a cafe terrace in the Marais district of Paris on a Wednesday morning in March 2025. It is a crisp, cool spring morning with clear skies. Locals are drinking coffee. In sharp focus should be a young woman with a pixie cut wearing a scarf, stirring a cappuccino and looking thoughtfully to the side; the waiter and street traffic behind her are blurred. The photo should have the candid, natural morning light feel of an iPhone image.

A realistic, high-resolution night photograph mimicking the aesthetic of flash photography, featuring a stylish young couple posing closely together on an elegant stone balcony with a classic white balustrade. The young woman, positioned on the left with her body angled slightly away, has long, voluminous honey-blonde wavy hair cascading down her back and is wearing a black spaghetti-strap mini dress featuring intricate lace detailing on the bodice and a tiered, ruffled skirt; she looks back over her shoulder at the camera with a soft, pleasant smile while resting one hand on the man's shoulder. Beside her stands a handsome young man with tan skin, dark curly hair styled with a fade, and a confident expression, dressed in a crisp black button-down shirt tucked into black dress pants with a visible leather belt, his arm wrapped affectionately around her waist. The setting is nighttime with a pitch-black sky and distant, out-of-focus city lights visible in the background, contrasting with the bright, direct lighting on the subjects and the white architectural column on the right, capturing a candid, trendy "date night" or homecoming social media vibe.
Z-Image 是通义团队 Tongyi-MAI 的图片生成模型。Tongyi-MAI 的介绍强调写实效果、双语文字呈现,以及对细致场景描述的理解。
在 UniRoute 上,z-image 版本接受文字提示词和宽高比选项。工作区列出了目录中开放的画幅,每次请求会在生成前报价。
本页介绍当前可调用的 z-image 版本。Tongyi-MAI 的介绍强调产品图片、双语设计和知识类场景;下方规格表列出了 UniRoute 当前开放的控制项。
目前通过 UniRoute 使用 Z-Image 可以做什么。
描述主体、光照、构图以及需要呈现的中英文文案,选择宽高比后根据提示词生成新图片。

Z-Image 的其他模式(参考图编辑)暂未在 UniRoute 开放。
可调用的版本,以及各自的选项和价格。
| 版本 | 模型 ID | 模式 | 输入 | 输出 | 价格 |
|---|---|---|---|---|---|
| Z-Image | z-image | 文生图 | 文字提示词和宽高比选项 | 宽高比:1:1、16:9、9:16 | $0.005 / 次请求 |
按请求计价,所选规格决定价格。
| Z-Image | |
|---|---|
| 1:1 | $0.005 |
| 16:9 | $0.005 |
| 9:16 | $0.005 |
金额四舍五入到分;工作区中的实时报价显示精确金额。价格更新于 2026-11-25。
按用量计费,统一使用一个美元钱包余额。每次请求前都会先看到报价。
用媒体 API 在你自己的代码里调用 Z-Image。
# Requires bash, curl and jq. Set API_KEY to your own unified UniRoute Key.set -euo pipefail: "${API_KEY:?Set API_KEY first}"BASE='https://api.uniroute.app/v1/media'MODEL='z-image'OPTION='1:1'PROMPT='A calm sunrise over a mountain lake'curl -fsS --max-time 60 "$BASE/catalog" -H "Authorization: Bearer $API_KEY" | jq -e '.data.models'BODY=$(jq -n --arg model "$MODEL" --arg option "$OPTION" --arg prompt "$PROMPT" '{model:$model,option:$option,prompt:$prompt}')QUOTE_BODY=$(printf '%s' "$BODY" | jq '{model,option}')QUOTE=$(curl -fsS --max-time 60 "$BASE/quote" -H "Authorization: Bearer $API_KEY" -H 'Content-Type: application/json' -d "$QUOTE_BODY")CAP=$(printf '%s' "$QUOTE" | jq -er '.data.quoted_usd')BODY=$(printf '%s' "$BODY" | jq --arg cap "$CAP" '. + {max_cost_usd:$cap}')IDEMPOTENCY="example-$(date +%s)-$$"create() { curl -fsS --max-time 60 "$BASE/tasks" -H "Authorization: Bearer $API_KEY" -H "Idempotency-Key: $IDEMPOTENCY" -H 'Content-Type: application/json' -d "$BODY"; }TASK_ID=$(create | jq -er '.data.task_id')# The same request and idempotency key must return the original task without charging again.REPLAY_ID=$(create | jq -er '.data.task_id')[ "$TASK_ID" = "$REPLAY_ID" ]for attempt in $(seq 1 120); do TASK=$(curl -fsS --max-time 60 "$BASE/tasks/$TASK_ID" -H "Authorization: Bearer $API_KEY") printf '%s' "$TASK" | jq -e '.data | {task_id,status,billing}' if printf '%s' "$TASK" | jq -e '.data.status == "success" and .data.billing.state == "charged"' >/dev/null; then index=0 while IFS= read -r url; do index=$((index+1)) curl -fL --max-time 120 "$url" -o "$TASK_ID-$index.bin" done < <(printf '%s' "$TASK" | jq -er '.data.urls[].url') break fi if printf '%s' "$TASK" | jq -e '.data.status == "failed" and .data.billing.state == "released"' >/dev/null; then exit 1; fi if [ "$attempt" = 120 ]; then echo "Polling limit reached. Keep task ID $TASK_ID and query it later; do not create a new task." >&2 exit 1 fi sleep 5donecurl -fsS --max-time 60 "$BASE/tasks?limit=20" -H "Authorization: Bearer $API_KEY" | jq -e '.data'# Check this task and the caller Key in Console usage; billing.charged_usd is the actual USD charge.| 名称 | 位置 | 说明 |
|---|---|---|
model | 请求体 | 要运行的模型 ID。 |
option | 请求体 | 该模型提供的规格之一:1:1, 16:9, 9:16。 |
prompt | 请求体 | 描述要生成内容的文字提示词。 |
max_cost_usd | 请求体 | 本次任务的最高费用(美元),取自报价。 |
Idempotency-Key | 请求头 | 每个任务唯一的键;重复请求会返回原任务,不会重复扣费。 |
Z-Image 的常见用法。
描述物体、材质和环境,探索产品配图和生活场景。
指定中英文文案、间距和版式,起草海报或推广配图。
描述地标、文化场景或讲解概念,起草可供检查和调整的插图。
关于 Z-Image 的常见问题。
Z-Image 是通义团队 Tongyi-MAI 的图片生成模型。Tongyi-MAI 的介绍强调写实效果、双语文字呈现,以及对细致场景描述的理解。
可以在工作区选择宽高比。当前目录条目没有开放独立的分辨率设置或参考图输入。
$0.005 起 / 张。每次请求按所选版本和规格报价。完整价格表见“价格”一节(价格更新于 2026-11-25)。
本页列出的版本均根据文字提示词生成新图片,工作区只展示当前目录开放的规格。
使用媒体 API:先对所选模型和规格请求报价,再带上 Idempotency-Key 和最高费用创建任务,然后轮询任务直到结果就绪。“API”一节给出了完整示例和参数说明。
没有。生成费用从你的钱包余额中扣除。你可以直接打开工作区查看价格,注册账号后可看到针对当前设置的实时报价,只有被接受的请求才会计费。