通义-文生图-Z-Image 是一款轻量级文生图模型,可快速生成图像,支持中英文字渲染,并灵活适配多种分辨率与宽高比例。
快速入口:技术博客
前提条件
效果展示
输入提示词 | 输出图像 |
Photo of a stylish young woman with short black hair standing confidently in front of a vibrant cartoon-style mural wall. She wears an all-black outfit: a puffed bomber jacket with a ruffled collar, cargo shorts, fishnet tights, and chunky black Doc Martens, with a gold chain dangling from her waist. The background features four colorful comic-style panels: one reads “GRAND STAGE” and includes sneakers and a Gatorade bottle; another displays green Nike sneakers and a slice of pizza; the third reads “HARAJUKU st” with floating shoes; and the fourth shows a blue mouse riding a skateboard with the text “Takeshita WELCOME.” Dominant bright colors include yellow, teal, orange, pink, and green. Speech bubbles, halftone patterns, and playful characters enhance the urban street-art aesthetic. Daylight evenly illuminates the scene, and the ground beneath her feet is white tiled pavement. Full-body portrait, centered composition, slightly tilted stance, direct eye contact with the camera. High detail, sharp focus, dynamic framing. |
|
模型概览
模型名称 | 模型简介 | 输出图像规格 |
z-image-turbo | 轻量模型,快速生图 | 图像分辨率:总像素在[512*512, 2048*2048]之间,推荐分辨率请参见size参数设置 图像格式:png 图像张数:固定1张 |
调用前,请查阅各地域支持的模型列表。
HTTP同步调用
新加坡地域:POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
北京地域:POST https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
请求参数 | 文生图以下示例直接返回图片,响应速度较快。 若想开启“智能思考”能力,请设置 以下为国际(新加坡)地域base_url,若使用中国大陆(北京)地域的模型,需将base_url替换为 |
请求头(Headers) | |
Content-Type 请求内容类型。此参数必须设置为 | |
Authorization 请求身份认证。接口使用阿里云百炼API-Key进行身份认证。示例值:Bearer sk-xxxx。 | |
请求体(Request Body) | |
model 模型名称。 示例值:z-image-turbo。 | |
input 输入的基本信息。 | |
parameters 图像处理参数。 |
响应参数 | 任务执行成功任务数据(如任务状态、图像URL等)仅保留24小时,超时后会被自动清除。请您务必及时保存生成的图像。 任务执行异常如果因为某种原因导致任务执行失败,将返回相关信息,可以通过code和message字段明确指示错误原因。请参见错误信息进行解决。 |
output 任务输出信息。 | |
usage 输出信息统计。只对成功的结果计数。 | |
request_id 请求唯一标识。可用于请求明细溯源和问题排查。 | |
code 请求失败的错误码。请求成功时不会返回此参数,详情请参见错误信息。 | |
message 请求失败的详细信息。请求成功时不会返回此参数,详情请参见错误信息。 |
使用限制
数据时效:任务
task_id和 图像url均只保留 24 小时,过期后将无法查询或下载。内容审核:输入的
prompt和输出的图像均会经过内容安全审核,包含违规内容的请求将报错“IPInfringementSuspect”或“DataInspectionFailed”,具体参见错误信息。网络访问配置:图像链接存储于阿里云 OSS,如果业务系统因安全策略无法访问外部OSS链接,请将以下 OSS 域名加入网络访问白名单。
# OSS域名列表 dashscope-result-bj.oss-cn-beijing.aliyuncs.com dashscope-result-hz.oss-cn-hangzhou.aliyuncs.com dashscope-result-sh.oss-cn-shanghai.aliyuncs.com dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com dashscope-result-zjk.oss-cn-zhangjiakou.aliyuncs.com dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com dashscope-result-hy.oss-cn-heyuan.aliyuncs.com dashscope-result-cd.oss-cn-chengdu.aliyuncs.com dashscope-result-gz.oss-cn-guangzhou.aliyuncs.com dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com
计费与限流
模型免费额度和计费单价请参见模型价格。
模型限流请参见通义-文生图-Z-Image。
计费说明:
根据是否开启智能按成功生成的 图像张数 计费。仅当查询结果接口返回
task_status为SUCCEEDED并成功生成图像后,才会计费。模型调用失败或处理错误不产生任何费用,也不消耗免费额度。
错误码
如果模型调用失败并返回报错信息,请参见错误信息进行解决。
常见问题
Q: 如何查看模型调用量?
A: 模型调用完一小时后,请在模型观测(新加坡)或模型观测(北京)页面,查看模型的调用次数、成功率等指标。如何查看模型调用记录?
