aliyun-zimage-turbo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCategory: provider
Category: provider
Model Studio Z-Image Turbo
模型工作室 Z-Image Turbo
Use Z-Image Turbo for fast text-to-image generation via the DashScope multimodal-generation API.
通过DashScope多模态生成API使用Z-Image Turbo实现快速文生图生成。
Critical model name
关键模型名称
Use ONLY this exact model string:
z-image-turbo
仅使用以下精确模型字符串:
z-image-turbo
Prerequisites
前置条件
- Set in your environment, or add
DASHSCOPE_API_KEYtodashscope_api_key(env takes precedence).~/.alibabacloud/credentials - Choose region endpoint (Beijing or Singapore). If unsure, pick the most reasonable region or ask the user.
- 在你的环境中设置,或者在
DASHSCOPE_API_KEY中添加~/.alibabacloud/credentials(环境变量优先级更高)。dashscope_api_key - 选择区域端点(北京或新加坡)。如果不确定,选择最合理的区域或者询问用户。
Normalized interface (image.generate)
标准化接口(image.generate)
Request
请求参数
- (string, required)
prompt - (string, optional) e.g.
size1024*1024 - (int, optional)
seed - (bool, optional; default false)
prompt_extend - (string, optional) override API endpoint
base_url
- (字符串,必填)
prompt - (字符串,选填)例如
size1024*1024 - (整数,选填)
seed - (布尔值,选填;默认值false)
prompt_extend - (字符串,选填)覆盖API端点
base_url
Response
响应参数
- (string)
image_url - (int)
width - (int)
height - (string)
prompt - (string, optional)
rewritten_prompt - (string, optional)
reasoning - (string)
request_id
- (字符串)
image_url - (整数)
width - (整数)
height - (字符串)
prompt - (字符串,选填)
rewritten_prompt - (字符串,选填)
reasoning - (字符串)
request_id
Quick start (curl)
快速开始(curl)
bash
curl -sS 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-d '{
"model": "z-image-turbo",
"input": {
"messages": [
{
"role": "user",
"content": [{"text": "A calm lake at dawn, a lone angler casting a line, cinematic lighting"}]
}
]
},
"parameters": {
"size": "1024*1024",
"prompt_extend": false
}
}'bash
curl -sS 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-d '{
"model": "z-image-turbo",
"input": {
"messages": [
{
"role": "user",
"content": [{"text": "A calm lake at dawn, a lone angler casting a line, cinematic lighting"}]
}
]
},
"parameters": {
"size": "1024*1024",
"prompt_extend": false
}
}'Local helper script
本地辅助脚本
bash
python skills/ai/image/aliyun-zimage-turbo/scripts/generate_image.py \
--request '{"prompt":"a fishing scene at dawn, cinematic, realistic","size":"1024*1024"}' \
--output output/ai-image-zimage-turbo/images/fishing.png \
--print-responsebash
python skills/ai/image/aliyun-zimage-turbo/scripts/generate_image.py \
--request '{"prompt":"a fishing scene at dawn, cinematic, realistic","size":"1024*1024"}' \
--output output/ai-image-zimage-turbo/images/fishing.png \
--print-responseSize notes
尺寸说明
- Total pixels must be between and
512*512.2048*2048 - Prefer common sizes like ,
1024*1024,1280*720.1536*864
- 总像素必须在和
512*512之间。2048*2048 - 推荐使用常用尺寸如、
1024*1024、1280*720。1536*864
Cost note
费用说明
- is billed higher than
prompt_extend=true. Only enable when you need rewritten prompts.false
- 的计费高于
prompt_extend=true。仅当你需要重写提示词时才启用该参数。false
Output location
输出位置
- Default output:
output/ai-image-zimage-turbo/images/ - Override base dir with .
OUTPUT_DIR
- 默认输出路径:
output/ai-image-zimage-turbo/images/ - 可通过覆盖基础目录。
OUTPUT_DIR
Validation
校验
bash
mkdir -p output/aliyun-zimage-turbo
for f in skills/ai/image/aliyun-zimage-turbo/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/aliyun-zimage-turbo/validate.txtPass criteria: command exits 0 and is generated.
output/aliyun-zimage-turbo/validate.txtbash
mkdir -p output/aliyun-zimage-turbo
for f in skills/ai/image/aliyun-zimage-turbo/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/aliyun-zimage-turbo/validate.txt通过标准:命令退出码为0且生成了文件。
output/aliyun-zimage-turbo/validate.txtOutput And Evidence
输出与凭证
- Save artifacts, command outputs, and API response summaries under .
output/aliyun-zimage-turbo/ - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
- 将产物、命令输出和API响应摘要保存在目录下。
output/aliyun-zimage-turbo/ - 在凭证文件中包含关键参数(区域/资源ID/时间范围)以便复现。
Workflow
工作流程
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
- 确认用户意图、区域、标识符,以及操作是只读还是修改性质。
- 先运行一个最小化的只读查询,验证连通性和权限。
- 使用明确的参数和有限范围执行目标操作。
- 验证结果并保存输出/凭证文件。
References
参考
- for request/response schema and regional endpoints.
references/api_reference.md - for official docs.
references/sources.md
- 查看请求/响应schema和区域端点。
references/api_reference.md - 查看官方文档。
references/sources.md