影象(Image)
Seedream 5.0 Pro 圖像生成 API
支援功能
Seedream 5.0 Pro 支援文字生成圖片與圖片生成圖片,採用與 OpenAI Images API 相容的格式。
模型代碼為 doubao-seedream-5-0-pro。
介面與驗證
介面基礎網址:https://api.88api.ai
Authorization: Bearer $API_KEY
Content-Type: application/json| 情境 | 請求方法 | 端點 |
|---|---|---|
| 文字生成圖片 | POST | /v1/images/generations |
| 公開網址參考圖編輯 | POST | /v1/images/generations |
| 本機圖片編輯 | POST | /v1/images/edits |
文字生成圖片
curl https://api.88api.ai/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-pro",
"prompt": "一隻穿著紅色唐裝的小柴犬,國潮插畫風格,喜慶溫馨",
"n": 1,
"size": "1K",
"quality": "1K",
"response_format": "url"
}'圖片生成圖片
公開網址參考圖
單張參考圖請使用 image,多張參考圖請使用 images。參考圖必須是可公開存取的 HTTP(S) URL,
兩者合計最多 14 張。
curl https://api.88api.ai/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-pro",
"prompt": "保留人物主體與構圖,將服裝改成藍色戶外夾克",
"image": "https://example.com/reference.jpg",
"size": "2K",
"quality": "2K",
"response_format": "url"
}'多張參考圖範例:
{
"model": "doubao-seedream-5-0-pro",
"prompt": "融合參考圖中的主體與色彩",
"images": [
"https://example.com/reference-1.jpg",
"https://example.com/reference-2.jpg"
],
"size": "2K",
"quality": "2K"
}本機圖片
本機圖片請使用 multipart 請求,每次上傳一張:
curl https://api.88api.ai/v1/images/edits \
-H "Authorization: Bearer $API_KEY" \
-F "model=doubao-seedream-5-0-pro" \
-F "prompt=把背景改成淺色攝影棚" \
-F "image=@reference.png" \
-F "size=2K" \
-F "quality=2K" \
-F "response_format=url"請求參數
| 參數 | 類型 | 必填 | 預設值 | 說明 |
|---|---|---|---|---|
model | string | 是 | — | doubao-seedream-5-0-pro |
prompt | string | 是 | — | 文字生成圖片的描述,或圖片生成圖片的編輯指令 |
n | integer | 否 | 1 | 1 到 4 |
size | string | 否 | — | 1K 或 2K |
quality | string | 否 | — | 1K 或 2K |
response_format | string | 否 | url | url 或 b64_json |
image | string / file | 否 | — | 單張公開參考圖 URL,或編輯端點中的上傳檔案 |
images | array[string] | 否 | — | 公開參考圖 URL 陣列,最多 14 張 |
回應格式
{
"created": 1760000000,
"data": [
{
"url": "https://..."
}
],
"model": "doubao-seedream-5-0-pro"
}response_format 為 url 時請讀取 data[].url;為 b64_json 時請讀取
data[].b64_json。