Category: provider
Model Studio Z-Image Turbo
Use Z-Image Turbo for fast text-to-image generation via the DashScope multimodal-generation API.
Critical model name
Use ONLY this exact model string:
Prerequisites
- - Set
DASHSCOPE_API_KEY in your environment, or add dashscope_api_key to ~/.alibabacloud/credentials (env takes precedence). - Choose region endpoint (Beijing or Singapore). If unsure, pick the most reasonable region or ask the user.
Normalized interface (image.generate)
Request
- -
prompt (string, required) - INLINECODE5 (string, optional) e.g. INLINECODE6
- INLINECODE7 (int, optional)
- INLINECODE8 (bool, optional; default false)
- INLINECODE9 (string, optional) override API endpoint
Response
- -
image_url (string) - INLINECODE11 (int)
- INLINECODE12 (int)
- INLINECODE13 (string)
- INLINECODE14 (string, optional)
- INLINECODE15 (string, optional)
- INLINECODE16 (string)
Quick start (curl)
CODEBLOCK0
Local helper script
CODEBLOCK1
Size notes
- - Total pixels must be between
512*512 and 2048*2048. - Prefer common sizes like
1024*1024, 1280*720, 1536*864.
Cost note
- -
prompt_extend=true is billed higher than false. Only enable when you need rewritten prompts.
Output location
- - Default output: INLINECODE24
- Override base dir with
OUTPUT_DIR.
Validation
CODEBLOCK2
Pass criteria: command exits 0 and output/alicloud-ai-image-zimage-turbo/validate.txt is generated.
Output And Evidence
- - Save artifacts, command outputs, and API response summaries under
output/alicloud-ai-image-zimage-turbo/. - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
Workflow
1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
2) Run one minimal read-only query first to verify connectivity and permissions.
3) Execute the target operation with explicit parameters and bounded scope.
4) Verify results and save output/evidence files.
References
- -
references/api_reference.md for request/response schema and regional endpoints. - INLINECODE29 for official docs.
技能名称: alicloud-ai-image-zimage-turbo
详细描述:
类别: 提供商
模型工作室 Z-Image Turbo
通过DashScope多模态生成API,使用Z-Image Turbo实现快速文本到图像生成。
关键模型名称
仅使用以下精确模型字符串:
前提条件
- - 在环境中设置DASHSCOPEAPIKEY,或将dashscopeapikey添加到~/.alibabacloud/credentials(环境变量优先)。
- 选择区域端点(北京或新加坡)。如果不确定,请选择最合理的区域或询问用户。
标准化接口(image.generate)
请求
- - prompt(字符串,必填)
- size(字符串,可选)例如 1024*1024
- seed(整数,可选)
- promptextend(布尔值,可选;默认值为false)
- baseurl(字符串,可选)覆盖API端点
响应
- - imageurl(字符串)
- width(整数)
- height(整数)
- prompt(字符串)
- rewrittenprompt(字符串,可选)
- reasoning(字符串,可选)
- request_id(字符串)
快速开始(curl)
bash
curl -sS https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation \
-H Content-Type: application/json \
-H Authorization: Bearer $DASHSCOPEAPIKEY \
-d {
model: z-image-turbo,
input: {
messages: [
{
role: user,
content: [{text: 黎明时分的宁静湖泊,一位孤独的垂钓者正在抛竿,电影级光影}]
}
]
},
parameters: {
size: 1024*1024,
prompt_extend: false
}
}
本地辅助脚本
bash
python skills/ai/image/alicloud-ai-image-zimage-turbo/scripts/generate_image.py \
--request {prompt:黎明时分的钓鱼场景,电影级,逼真,size:1024*1024} \
--output output/ai-image-zimage-turbo/images/fishing.png \
--print-response
尺寸说明
- - 总像素必须在512512到20482048之间。
- 优先使用常见尺寸,如10241024、1280720、1536*864。
费用说明
- - prompt_extend=true的计费高于false。仅在需要重写提示词时启用。
输出位置
- - 默认输出:output/ai-image-zimage-turbo/images/
- 使用OUTPUT_DIR覆盖基础目录。
验证
bash
mkdir -p output/alicloud-ai-image-zimage-turbo
for f in skills/ai/image/alicloud-ai-image-zimage-turbo/scripts/*.py; do
python3 -m py_compile $f
done
echo pycompileok > output/alicloud-ai-image-zimage-turbo/validate.txt
通过标准:命令退出码为0,且生成output/alicloud-ai-image-zimage-turbo/validate.txt文件。
输出与证据
- - 将工件、命令输出和API响应摘要保存到output/alicloud-ai-image-zimage-turbo/目录下。
- 在证据文件中包含关键参数(区域/资源ID/时间范围),以确保可复现性。
工作流程
1) 确认用户意图、区域、标识符,以及操作是只读还是变更操作。
2) 首先运行一个最小的只读查询,以验证连接和权限。
3) 使用明确的参数和限定范围执行目标操作。
4) 验证结果并保存输出/证据文件。
参考资料
- - references/api_reference.md:请求/响应模式和区域端点。
- references/sources.md:官方文档。