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和輸出的映像均會經過Alibaba Content Security Service審核,包含違規內容的請求將報錯“IPInfringementSuspect”或“DataInspectionFailed”,具體參見錯誤碼。
