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张 |
前提条件
您需要获取与配置 API Key,并配置API Key到环境变量。
HTTP同步调用
新加坡地域:POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
北京地域:POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
调用时请将{WorkspaceId}替换为真实的业务空间ID。
请求参数请求头(Headers)Content-Typestring(必选)请求内容类型。此参数必须设置为application/json。Authorizationstring(必选)请求身份认证。接口使用阿里云百炼API Key进行身份认证。示例值:Bearer sk-xxxx。请求体(Request Body)modelstring (必选)模型名称。必须为:z-image-turbo。input object (必选)输入的基本信息。
属性 messages array (必选)请求内容数组。当前仅支持单轮对话,即传入一组role、content参数,不支持多轮对话。
属性 role string (必选)消息的角色。此参数必须设置为user。contentarray (必选)消息内容数组。必须包含且仅包含1 个 text 对象。
属性 text string(必选)正向提示词用于描述期望生成的图像内容、风格和构图。支持中英文,长度不超过800个字符,每个汉字、字母、数字或符号计为一个字符,超过部分会自动截断。示例值:一只坐着的橘黄色的猫,表情愉悦,活泼可爱,逼真准确。注意:仅支持传入一个text,不传或传入多个将报错。object (可选)图像处理参数。
属性 size string (可选)输出图像的分辨率,格式为宽*高。
总像素为1024*1024的推荐分辨率:
总像素为1280*1280的推荐分辨率:
总像素为1536*1536的推荐分辨率:
bool (可选)是否启用智能提示词(text)改写。开启后,将使用大模型优化提示词,并输出思考过程。
integer (可选)随机数种子,取值范围[0,2147483647]。使用相同的seed参数值可使生成内容保持相对稳定。若不提供,算法将自动使用随机数种子。注意:模型生成过程具有概率性,即使使用相同的seed,也不能保证每次生成结果完全一致。 |
以下示例直接返回图片,响应速度较快。若想开启“智能思考”能力,请设置 prompt_extend=true 。开启后,系统将在返回图片的同时,返回优化后的提示词及其推理过程,但会增加响应时间。 |
响应参数outputobject任务输出信息。
属性 choices array模型生成的输出内容。此数组仅包含1个元素。
属性 finish_reason string任务停止原因,正常完成时为 stop。message object模型返回的消息。
属性 role string消息的角色,固定为assistant。contentarray
属性 image string生成图像的 URL,图像格式为PNG。链接有效期为24小时,请及时下载并保存图像。text string
string模型的思考过程,仅在prompt_extend=true时返回思考文本。object输出信息统计。只对成功的结果计数。
属性 width integer生成图像的宽度(像素)。height integer生成图像的高度(像素)。image_count integer生成图像的数量,固定为1。input_tokens integer输入token数量,prompt_extend=false时固定为0。output_tokens integer输出token数量,prompt_extend=false时固定为0。output_tokens_detailsobject输出 token 详情,仅当prompt_extend=true时返回。
属性 reasoning_tokens integer推理思考使用的 token 数量。integer总token数量,prompt_extend=false时固定为0。string请求唯一标识。可用于请求明细溯源和问题排查。codestring请求失败的错误码。请求成功时不会返回此参数,详情请参见错误码。messagestring请求失败的详细信息。请求成功时不会返回此参数,详情请参见错误码。 |
任务数据(如任务状态、图像URL等)仅保留24小时,超时后会被自动清除。请您务必及时保存生成的图像。 |
使用限制
- 图像
url均只保留 24 小时,请及时下载。 - 内容审核:输入的
prompt和输出的图像均会经过内容安全审核,包含违规内容的请求将报错“IPInfringementSuspect”或“DataInspectionFailed”,具体参见错误码。
