取得 API 金鑰

ByteDance 出品

精確尺寸最高 4096×2304,可參考十張圖編輯

bytedance/seedream-4.0/edit5 點數起/張 · US$0.05
  • 最多 10 張參考圖
  • 生成圖片
  • 編輯圖片
A woman in a black strapless jumpsuit stands on a sunlit whitewashed terrace beside bougainvillea at golden hour.查看範例

關於 Seedream 4.0

Seedream 4.0 是 5.0 之前的那一代 Seedream:文生圖和一到十張參考圖的改圖,十六種固定尺寸,從 1024×1024 到 4096×2304。所有尺寸價格一樣,所以一開始就可以直接渲染交付尺寸。

在 POST /jobs/createTask 把模型名稱填成 bytedance/seedream-4.0/edit 就能呼叫,5 點數/張起(US$0.05)。新帳戶送 30 點數,可以先在 Playground 免費試用。

這份指南目前只有英文版。 →

請求參數

參數必填說明
image_urls是要編輯或合成的照片。在提示詞裡說明每張的用途。
prompt是Describe the image to produce from the source: subject, composition, style, and lighting.
size否Output image size in pixels, written as width*height. 2048*2048 · 1024*1024 · 2304*1728 · 1728*2304 · 2848*1600 · 1600*2848 · 2496*1664 · 1664*2496 · 3136*1344 · 3072*3072 · 3456*2592 · 2592*3456 · 4096*2304 · 2304*4096 · 2496*3744 · 3744*2496 · 預設值: 2048*2048

價格

價格以點數計,和網站上用的是同一種點數(1 點 = $0.01)。任務受理時先凍結點數,完成後依實際費用結算;失敗的任務會退還。

選項點數 /張≈ 美元
標準4.5US$0.045

每個任務會無條件進位到整數點數,所以最低檔跑一次是 5 點數/張(US$0.05)。

想在執行前知道確切金額,把相同的請求內容送到 POST /jobs/quote 即可。

API 快速上手

三步驟呼叫 Seedream 4.0 API

  1. 建立 API 金鑰. 登入 PopNow,在 API 主控台建立金鑰。金鑰以 sk-popnow- 開頭,和網站共用同一份點數。
  2. 送出請求. 對 POST /jobs/createTask 送出請求,model 填 bytedance/seedream-4.0/edit,input 依照參數表填寫。回應會立即傳回任務 ID。
  3. 取得結果. 用任務 ID 輪詢 GET /jobs/recordInfo,或帶上 callBackUrl,結果會推送到該網址。任務成功後下載輸出連結。
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "bytedance/seedream-4.0/edit",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "image_urls": [
      "https://media.popnow.ai/influencer/examples/marco.webp"
    ],
    "size": "2048*2048"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

請把提示詞和連結換成你自己的。API 頁籤裡有回應、輪詢和回呼的參考。

Seedream 4.0 API 常見問題

Seedream 4.0 API 怎麼收費?

Seedream 4.0:最便宜的任務是編輯圖片,5 點數(US$0.05)/張起。點數和網站通用(1 點數 = $0.01),新帳號贈送 30 點數,失敗的任務會退還。

Seedream 4.0 在 API 裡的模型名稱是什麼?

在 POST /jobs/createTask 的 model 欄位填 生成圖片用 bytedance/seedream-4.0/text-to-image;編輯圖片用 bytedance/seedream-4.0/edit。

Seedream 4.0 API 有哪些限制?

參考圖:10。超出這些限制的請求會在扣款之前被拒絕。

不寫程式能試 Seedream 4.0 嗎?

可以。Playground 用你的 PopNow 點數執行 Seedream 4.0,不需要 API 金鑰,每次執行都會附上對應的程式碼。

所有 Seedream 模型

Seedream 5.0 Pro 和 Lite 是較新的一代,材質細節更細;4.0 保留自己的風格和最大尺寸。

更多 Seedream 4.0 相關內容