Seedream圖像生成

OpenAI 相容:POST /v1/images/generations。原生路徑:/api/v3/images/generations。Seedream 5.5 官方文件 · Image Generation API

[!IMPORTANT] 模型能力核心差異:

  • Seedream 5.5 (doubao-seedream-5-5-261028)【最新旗艦】:全面升級多輪編輯一致性、文生 / 多圖原生 RGBA 透明圖片(最多 10 張普通參考圖,無需帶透明通道)、精細圖層拆分(1 底圖 + 最多 99 圖層,支援 layer_decomposition_options.max_images 控數)及富文本 OCR(text_recognition: true);預設 output_format: "png"、background: "auto"。不支援組圖(單圖 n=1)、聯網搜尋與串流。
  • Seedream 5.0 Flash (doubao-seedream-5-0-flash-260915)【極速首選】 / 5.0 Pro (doubao-seedream-5-0-pro-260628):支援單圖、互動編輯、圖層拆分(1 底圖 + 最多 16 圖層)與單圖透明背景(輸入圖須為帶透明通道 PNG);預設 output_format: "jpeg"、background: "opaque"。不支援組圖(n=1)、富文本 OCR、聯網搜尋與串流。
  • Seedream 5.0 Lite (doubao-seedream-5-0-260128) / 4.5 (doubao-seedream-4-5-251128)【組圖首選】:支援組圖生成(n: 2~15)、聯網搜尋(僅 5.0 Lite)與串流輸出;不支援圖層拆分、透明背景、富文本 OCR 與互動編輯。

1. 請求範例 (POST)

  • 路徑: https://llm.artsapi.ai/v1/images/generations
  • 驗證: Authorization: Bearer sk-your_token

A. 文生單圖(推薦 Seedream 5.5 / 5.0 Flash)

單圖生成,n 必須為 1 或省略。旗艦推薦 5.5,極速高性價比推薦 5.0 Flash。

curl -X POST https://llm.artsapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-5-261028",
    "prompt": "一隻穿著紅色唐裝的小柴犬,坐在大門紅燈籠下拜年,國潮插畫風格,喜慶溫馨",
    "size": "2K",
    "watermark": false
  }'

B. 文生組圖(僅 5.0 Lite / 4.5 支援)

一次生成一組連貫圖片。直接傳 OpenAI 標準參數 n(2–15),閘道自動轉換為官方 sequential_image_generation: "auto" 與 sequential_image_generation_options: {"max_images": n}(亦可直接傳官方原生參數)。5.5 / 5.0 Flash / 5.0 Pro 均不支援組圖。

curl -X POST https://llm.artsapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "一組四格連環漫畫,講述小貓探索奇幻森林的冒險旅程,治癒溫暖插畫風格",
    "size": "2K",
    "n": 4,
    "watermark": false
  }'

C. 圖生圖 / 多圖參考與多輪一致性編輯

5.5 / 5.0 Flash / 5.0 Pro 支援 1–10 張參考圖(單圖輸出,支援 <bbox>x1 y1 x2 y2</bbox> 座標互動重繪);5.0 Lite / 4.5 支援 1–14 張參考圖(可組圖輸出)。Seedream 5.5 重點強化多輪編輯一致性:每輪以上一輪輸出圖作為 image,建議基於 RGB 圖並設 background: "opaque" 以保持主體與未編輯區域穩定。

curl -X POST https://llm.artsapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-5-261028",
    "prompt": "讓人物戴上一副復古圓框太陽眼鏡,保持人物面部特徵、髮型、服裝、背景與畫面構圖不變",
    "image": [
      "https://example.com/assets/portrait_round1.png"
    ],
    "size": "2K",
    "output_format": "png",
    "background": "opaque",
    "watermark": false
  }'

D. 原生 RGBA 透明背景圖片(background: "transparent")

  • Seedream 5.5:支援文生圖直接生成 RGBA,以及圖生圖(1–10 張普通參考圖,無需帶透明通道),適用於貼紙、圖示、商品素材等場景。
  • Seedream 5.0 Flash / Pro:僅支援圖生圖且限輸入 1 張帶透明通道的 PNG 圖片。
  • 設 background: "transparent" 時,output_format 必須為 png(傳 jpeg 會報錯)。
curl -X POST https://llm.artsapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-5-261028",
    "prompt": "透明壓克力立牌,聖誕主題手帳拼貼風,四周白色細描邊,設為透明背景",
    "size": "2K",
    "output_format": "png",
    "background": "transparent",
    "watermark": false
  }'

E. 精細圖層拆分與富文本 OCR(layer_decomposition)

  • Seedream 5.5:輸入 1 張圖,最多輸出 1 張底圖(z_index=0)+ 99 個透明 PNG 圖層;可透過 layer_decomposition_options.max_images(2–100,預設 30)控制輸出上限與精細度,並開啟 text_recognition: true 提取規整文字圖層的富文本 OCR(內容、逐行座標與樣式)。
  • Seedream 5.0 Flash / Pro:最多輸出 1 張底圖 + 16 個透明 PNG 圖層,不支援 layer_decomposition_options 與富文本 OCR。
  • 注意:圖層拆分場景不可傳入 background(傳入報錯);output_format 僅控制底圖格式,圖層恆為透明 PNG;size 預設 auto。
{
  "model": "doubao-seedream-5-5-261028",
  "prompt": "將海報中的標題文字、主體插畫與裝飾元素分別拆分為獨立圖層,底圖自然補全",
  "image": "https://example.com/poster.png",
  "layer_decomposition": true,
  "layer_decomposition_options": {
    "max_images": 30,
    "text_recognition": true
  },
  "size": "auto",
  "output_format": "png",
  "watermark": false
}

2. 完整參數字典

參數型別必填預設值描述與取值範圍
modelstring是-doubao-seedream-5-5-261028(最新旗艦)、doubao-seedream-5-0-flash-260915(極速)、doubao-seedream-5-0-pro-260628(5.0 高精)或 doubao-seedream-5-0-260128(組圖/聯網)
promptstring條件-畫面描述或編輯指令(支援中英等多語言;圖層拆分可留空自動全圖拆分)
image / image_urlsstring / array否-參考圖 URL 或小寫格式 Base64(data:image/png;base64,...)。5.5 / 5.0 Flash / Pro 圖片生成支援 1–10 張(≤30 MB,寬高比 [1/16, 16],總像素 [196, 6000×6000]);圖層拆分僅限單張 png/jpeg(總像素 [512×512, 6000×6000]);Lite/4.5 支援 1–14 張
size / resolutionstring否"2K"(拆層 "auto")兩種方式不可混用:①檔位:5.5 / 5.0 Flash / Pro 生圖支援 1K / 1.5K / 2K,拆層支援 1K / 1.5K / 2K / auto;Lite 支援 2K / 3K / 4K。②精確像素 寬x高(僅生圖,如 "2880x1440"):5.5 / 5.0 Flash / Pro 總像素 [1280×720, 2048×2048×1.1025](921600–4624220),寬高比 [1/16, 16]
ninteger否1生成張數(1–15)。傳 n > 1 時閘道自動轉為官方組圖參數 sequential_image_generation: "auto" 與 max_images: n。僅 5.0 Lite / 4.5 支援組圖;5.5 / 5.0 Flash / Pro 僅支援 n=1
sequential_image_generationstring否"disabled"官方組圖開關:"auto" / "disabled"(與 n 等價,僅 Lite / 4.5 支援;5.5 / 5.0 Flash / Pro 嚴禁配置)
sequential_image_generation_optionsobject否-官方組圖選項,如 {"max_images": 4}(僅 Lite / 4.5 支援;5.5 / 5.0 Flash / Pro 嚴禁配置)
layer_decompositionboolean否false圖層拆分開關:5.5 輸出 1 底圖 + ≤99 圖層;5.0 Flash / Pro 輸出 1 底圖 + ≤16 圖層
layer_decomposition_optionsobject否-僅 Seedream 5.5 支援。max_images(integer,[2, 100],預設 30,含底圖與圖層;值越大拆分越細);text_recognition(boolean,預設 false,開啟富文本 OCR)
backgroundstring否5.5:"auto"
5.0:"opaque"
透明背景控制:auto(5.5 自動判斷)/ transparent(RGBA)/ opaque(RGB)。僅圖片生成場景有效(圖層拆分傳入報錯);transparent 須搭配 output_format: "png"
output_formatstring否5.5:"png"
5.0:"jpeg"
輸出格式:png / jpeg。圖層拆分時僅控制底圖格式,圖層恆為透明 PNG
response_formatstring否"url"回傳方式:url(連結 24 小時有效,請及時轉存) / b64_json(Base64 資料)
watermarkboolean否true是否加入右下角「AI 生成」浮水印(設為 false 關閉)
web_searchboolean否false聯網搜尋開關(僅 5.0 Lite 支援;5.5 / 5.0 Flash / Pro 不支援)
streamboolean否false串流輸出開關(僅 5.0 Lite / 4.5 支援;5.5 / 5.0 Flash / Pro 不支援)
seedinteger否-隨機數種子,用於結果重現

3. 回傳結果與富文本 OCR 說明

  • 普通生圖:回傳 data[].url(24 小時有效)或 data[].b64_json。
  • 圖層拆分:回傳按 z_index 由底層至頂層排列的陣列,z_index=0 為補全底圖,其餘為透明 PNG 圖層,附帶 bounding_box(含 absolute 絕對像素 [left, top, right, bottom] 與 normalized [0, 1000] 歸一化座標)。
  • 富文本 OCR(Seedream 5.5 獨占):當 layer_decomposition: true 且 layer_decomposition_options.text_recognition: true 時,規整文字圖層會額外回傳 data[].text_recognition(底圖、非文字圖層及藝術字/手寫體不回傳):
    • text:當前圖層完整純文字(行間以 \n 分隔);
    • lines[]:逐行文字列表,含 bounding_box(absolute / normalized)與 runs[] 樣式片段;
    • runs[].style:8 項近似視覺樣式——similar_font_family(最相似字體,無法辨識回傳 unknown)、foreground_color(#RRGGBB)、bold、italic、underline、strikethrough、shadow、translucent。
{
  "size": "1166x899",
  "z_index": 6,
  "bounding_box": {
    "absolute": [1142, 528, 1474, 784],
    "normalized": [643, 529, 830, 786]
  },
  "text_recognition": {
    "text": "Presented By :\nAnna Katrina Marchesi",
    "lines": [
      {
        "bounding_box": {
          "absolute": [1196, 629, 1358, 658],
          "normalized": [673, 630, 765, 659]
        },
        "runs": [
          {
            "text": "Presented By :",
            "style": {
              "similar_font_family": "Helvetica Neue",
              "foreground_color": "#193366",
              "bold": true,
              "italic": false,
              "underline": false,
              "strikethrough": false,
              "shadow": false,
              "translucent": false
            }
          }
        ]
      }
    ]
  },
  "background": "transparent"
}

4. 模型特性對比矩陣

特性 / 能力Seedream 5.5 (最新旗艦)Seedream 5.0 Flash (極速)Seedream 5.0 ProSeedream 5.0 LiteSeedream 4.5
推薦 Model IDdoubao-seedream-5-5-261028doubao-seedream-5-0-flash-260915doubao-seedream-5-0-pro-260628doubao-seedream-5-0-260128doubao-seedream-4-5-251128
核心定位多輪一致 / 文生 RGBA / 99 層拆解 + OCR極速低延時 / 高性價比商業高精畫質連貫組圖 / 即時聯網經典穩定版
文生 / 圖生單圖✅ 支援✅ 支援✅ 支援✅ 支援✅ 支援
生成組圖 (n > 1)❌ 不支援(n=1)❌ 不支援(n=1)❌ 不支援(n=1)✅ 支援(≤15 張)✅ 支援(≤15 張)
參考圖上限1–10 張1–10 張1–10 張1–14 張1–14 張
原生 RGBA(文生圖)✅ 支援❌ 不支援❌ 不支援❌ 不支援❌ 不支援
原生 RGBA(圖生圖)✅ ≤10 張(無需透明底)⚠️ 僅 1 張透明 PNG⚠️ 僅 1 張透明 PNG❌ 不支援❌ 不支援
圖層拆分 (layer_decomposition)✅ 1 底圖 + ≤99 圖層✅ 1 底圖 + ≤16 圖層✅ 1 底圖 + ≤16 圖層❌ 不支援❌ 不支援
拆層控數 (max_images)✅ 支援(2–100,預設 30)❌ 不支援❌ 不支援❌ 不支援❌ 不支援
富文本 OCR (text_recognition)✅ 支援(規整文字圖層)❌ 不支援❌ 不支援❌ 不支援❌ 不支援
互動編輯 (<bbox>)✅ 支援✅ 支援✅ 支援❌ 不支援❌ 不支援
聯網搜尋 (web_search)❌ 不支援❌ 不支援❌ 不支援✅ 支援❌ 不支援
串流輸出 (stream)❌ 不支援❌ 不支援❌ 不支援✅ 支援✅ 支援
解析度範圍1K/1.5K/2K(拆層 auto)或像素1K/1.5K/2K(拆層 auto)或像素1K/1.5K/2K(拆層 auto)或像素2K/3K/4K2K/4K
預設格式 / 預設背景png / autojpeg / opaquejpeg / opaquejpeg / —jpeg / —

5. 常見錯誤碼與問題排解

HTTP 狀態碼、錯誤主體格式及分情境排解已 統一維護 於專頁,避免與各呼叫範例重複導致不同步。

👉 閘道常見錯誤碼與排解

速記(詳情見專頁):

碼含義
400參數無效 / 內容風控或版權攔截
402帳戶餘額不足(不是 429)
429權杖 RPS/RPM 頻率限制,或低餘額在途任務過多
403權杖/IP/模型權限(餘額見 402;內容攔截見 400)
200 + status: failed非同步影片等長任務的業務失敗(輪詢時常見)

HTTP 回應碼與控制台呼叫日誌 status_code 一致,可依 log_id 追溯。

維護約定:新增或調整錯誤說明時,請只更新專頁 error-codes;本附錄透過連結自動指向最新內容。

Raw Markdown (.md) · llms.txt