curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": [
"https://example.com/panda.jpg"
],
"metadata": {
"resolution": "1K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "Precisely separate the image into a base image and independent transparent PNG layers.",
"image_urls": [
"https://example.com/office-desk.png"
],
"size": "2K",
"n": 1,
"layer_decomposition": true
}'
layer_decomposition を有効にする場合、size には 1K または 2K の解像度プリセットを直接使用し、WIDTHxHEIGHT のような明示的なピクセルサイズは使用しないでください。送信に成功したら、GET /v1/images/generations/{task_id} で完全なレイヤー結果を照会します。
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 4,
"metadata": {
"resolution": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"watermark": false
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": ["https://example.com/panda.jpg"],
"metadata": {
"resolution": "1K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
metadata: {
resolution: '2K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
image_urls: ['https://example.com/panda.jpg'],
metadata: {
resolution: '1K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "doubao-seedream-5-0-pro",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
{
"completed_at": 1787128810,
"created_at": 1787128650,
"expires_at": 1787215210,
"id": "tsk_img_example_layer_decomposition",
"model": "doubao-seedream-5-0-pro",
"object": "generation.task",
"progress": 100,
"result": {
"type": "image",
"data": [
{
"url": "https://files.toapis.com/images/example/base.jpg",
"size": "1600x2848",
"output_format": "jpeg",
"z_index": 0
},
{
"url": "https://files.toapis.com/images/example/layer-1.png",
"size": "3040x955",
"output_format": "png",
"z_index": 1,
"bounding_box": {
"absolute": [0, 0, 1600, 503],
"normalized": [0, 0, 999, 176]
},
"name": "Background office equipment",
"description": "The monitor edge and file organizer extracted from the background"
},
{
"url": "https://files.toapis.com/images/example/layer-2.png",
"size": "1982x1162",
"output_format": "png",
"z_index": 2,
"bounding_box": {
"absolute": [800, 589, 1599, 1058],
"normalized": [500, 207, 999, 371]
},
"name": "Stacked white papers",
"description": "Several stacked white office papers extracted from the desk"
}
]
},
"status": "completed"
}
Seedream-5.0-Pro
Seedream-5.0-Pro 画像生成
Seedream 5.0 Pro モデルで高品質な画像を生成します。1K/2K 解像度に対応
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": [
"https://example.com/panda.jpg"
],
"metadata": {
"resolution": "1K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "Precisely separate the image into a base image and independent transparent PNG layers.",
"image_urls": [
"https://example.com/office-desk.png"
],
"size": "2K",
"n": 1,
"layer_decomposition": true
}'
layer_decomposition を有効にする場合、size には 1K または 2K の解像度プリセットを直接使用し、WIDTHxHEIGHT のような明示的なピクセルサイズは使用しないでください。送信に成功したら、GET /v1/images/generations/{task_id} で完全なレイヤー結果を照会します。
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 4,
"metadata": {
"resolution": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"watermark": false
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": ["https://example.com/panda.jpg"],
"metadata": {
"resolution": "1K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
metadata: {
resolution: '2K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
image_urls: ['https://example.com/panda.jpg'],
metadata: {
resolution: '1K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "doubao-seedream-5-0-pro",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
{
"completed_at": 1787128810,
"created_at": 1787128650,
"expires_at": 1787215210,
"id": "tsk_img_example_layer_decomposition",
"model": "doubao-seedream-5-0-pro",
"object": "generation.task",
"progress": 100,
"result": {
"type": "image",
"data": [
{
"url": "https://files.toapis.com/images/example/base.jpg",
"size": "1600x2848",
"output_format": "jpeg",
"z_index": 0
},
{
"url": "https://files.toapis.com/images/example/layer-1.png",
"size": "3040x955",
"output_format": "png",
"z_index": 1,
"bounding_box": {
"absolute": [0, 0, 1600, 503],
"normalized": [0, 0, 999, 176]
},
"name": "Background office equipment",
"description": "The monitor edge and file organizer extracted from the background"
},
{
"url": "https://files.toapis.com/images/example/layer-2.png",
"size": "1982x1162",
"output_format": "png",
"z_index": 2,
"bounding_box": {
"absolute": [800, 589, 1599, 1058],
"normalized": [500, 207, 999, 371]
},
"name": "Stacked white papers",
"description": "Several stacked white office papers extracted from the desk"
}
]
},
"status": "completed"
}
中国本土のユーザー向け: 中国本土のユーザーは
https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。- ByteDance Seed チームが開発した Seedream 5.0 Pro 高品質画像生成モデル
- model パラメータで
doubao-seedream-5-0-proモデルを選択 - パラメータは
Seedream-5.0とほぼ同じで、Pro は 1K と 2K の解像度に対応する点が異なります - テキストから画像生成、画像から画像生成、複数参考画像などの生成モードに対応
- 課金ルール:1 枚目の参考画像は無料で、2 枚目の参考画像から通常どおり課金されます
- 非同期タスク管理で、タスク ID から結果を照会
重要な変更:より良いパフォーマンスとコスト管理のため、
image_urls に base64 の画像データを直接渡すことはサポートしなくなりました。先に Upload 画像API で画像をアップロードし、URL を取得してから本エンドポイントを呼び出してください。Authorizations
string
必須
すべてのエンドポイントで Bearer Token による認証が必要ですAPI Key の取得:API Key 管理ページ から API Key を取得します使用時はリクエストヘッダーに次を追加します:
Authorization: Bearer YOUR_API_KEY
Body
string
デフォルト:"doubao-seedream-5-0-pro"
必須
画像生成モデル名例:
"doubao-seedream-5-0-pro"string
必須
画像生成のテキスト記述
string
デフォルト:"1:1"
画像のアスペクト比
layer_decomposition を有効にすると、このフィールドは解像度プリセット 1K または 2K を直接受け取ります。対応するアスペクト比:1:1- 正方形(デフォルト)4:3- 横向き 4:33:4- 縦向き 3:416:9- 横ワイド9:16- 縦長3:2- 横向き 3:22:3- 縦向き 2:321:9- 超ワイド9:21- 超縦長
integer
デフォルト:1
生成する画像の枚数範囲:1〜10(最小 1 枚、最大 10 枚)デフォルト:1注意:
- 参考画像 + 生成画像の合計枚数は 15 枚以下にしてください
- 必ず数値のみ(例:
1)を入力し、引用符を付けないでください。引用符を付けるとエラーになります
boolean
デフォルト:false
Seedream 5.0 Pro 専用のレイヤー分解機能を有効にするかどうか。
false:通常のフラットな画像を返します(デフォルト)true:ベース画像と、透明チャンネルを持つ複数の独立した PNG レイヤーを返します
result.data[] 項目に z_index も返されます。独立したレイヤーではさらに bounding_box、name、description も返されます。このパラメータは Seedream 5.0 Pro のみに対応します。string[]
画像から画像生成または画像編集に使用する参考画像の URL リスト⚠️ URL 形式のみ対応(base64 は非対応)
- 公開アクセス可能な画像 URL(http:// または https://)
- Upload 画像API でローカル画像をアップロードし、URL を取得できます
- 画像枚数:1〜10 枚
- 画像形式:jpeg、png
- アスペクト比(幅/高さ)の範囲:[1/3, 3]
- 幅と高さ(px)> 14
- サイズ:10MB 以下
- 総ピクセル数:6000×6000 px 以下
- 1 枚目の参考画像は無料
- 2 枚目の参考画像から通常どおり課金
object
チャネル固有のパラメータ。Seedream 5.0 Pro モデルの高度な設定を渡すために使用します
表示 metadata のプロパティ
表示 metadata のプロパティ
string
デフォルト:"2K"
画像の解像度対応する解像度:
1K- 基本解像度2K- 標準解像度(デフォルト)
注意: Seedream 5.0 Pro は 3K と 4K の解像度に対応していません。Pro 以外の Seedream 5.0 は 2K と 3K に対応します
string
デフォルト:"disabled"
順次画像生成モード(Doubao 専用機能)複数の画像を生成するかどうかを制御します:
disabled:順次モードを無効化。複数の参考画像があっても 1 枚のみ生成します(デフォルト)auto:順次モードを有効化。複数の画像を生成できます
- ✅
n: 3を設定するか、sequential_image_generation: "auto"+max_images: 3を使用します - ✅ テキストから複数画像の生成に対応:テキストプロンプトのみで最大 10 枚を生成
- ✅ 画像から画像生成/画像から複数画像の生成に対応:
image_urlsを指定し、参考画像に基づいて複数の画像を生成 - ⚠️
n > 1の場合、自動的にautoに設定されます
- 入力参考画像数 + 最終的な生成画像数 ≤ 15 枚
object
順次画像生成のオプション
sequential_image_generation が auto に設定されている場合に使用できますプロパティ:max_images(整数):生成する画像数を指定。範囲:1〜10
"sequential_image_generation_options": { "max_images": 3 }
boolean
デフォルト:false
生成画像にウォーターマークを追加するかどうか
true:ウォーターマークを追加false:ウォーターマークを追加しない(デフォルト)
Response
string
ステータス照会に使用するタスクの一意な識別子
string
オブジェクトタイプ。常に
generation.taskstring
使用したモデル名
string
タスクステータス
queued- 処理待ちin_progress- 処理中completed- 正常に完了failed- 失敗
integer
タスクの進捗率(0〜100)
integer
タスク作成時刻のタイムスタンプ(Unix タイムスタンプ)
object
タスクのメタデータ
integer
タスク完了時刻のタイムスタンプ(Unix タイムスタンプ)。タスク完了後にのみ返されます。
integer
結果ファイルの有効期限のタイムスタンプ(Unix タイムスタンプ)。有効期限前に結果ファイルをダウンロードまたは転送してください。
object
タスク成功後の生成結果。
status が completed の場合にのみ返されます。string
結果のタイプ。画像タスクでは常に
image。array
画像結果のリスト。レイヤー分解を有効にした場合、通常は最初の要素がベース画像で、残りの要素が透明チャンネルを持つ独立した PNG レイヤーです。
string
ベース画像または独立したレイヤーの公開アクセス URL。
integer
レイヤーの重なり順。
layer_decomposition を有効にした場合、通常はベース画像が 0 で、独立したレイヤーが順に増加します。string
現在のベース画像または独立したレイヤーのピクセルサイズ。例:
2048x2048。string
現在の結果項目のファイル形式。ベース画像はリクエストした形式、透明な独立レイヤーは
png です。object
ベース画像内での独立したレイヤーの位置。
absolute(絶対座標)と normalized(正規化座標)を含みます。array
ベース画像内でのレイヤーの絶対ピクセル座標。形式は
[x1, y1, x2, y2] で、それぞれ左上と右下の座標を表します。array
レイヤーの正規化座標。形式は
[x1, y1, x2, y2] で、座標の範囲は 0-1000 です。string
レイヤー名。
string
レイヤーの内容の説明。
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": [
"https://example.com/panda.jpg"
],
"metadata": {
"resolution": "1K"
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "Precisely separate the image into a base image and independent transparent PNG layers.",
"image_urls": [
"https://example.com/office-desk.png"
],
"size": "2K",
"n": 1,
"layer_decomposition": true
}'
layer_decomposition を有効にする場合、size には 1K または 2K の解像度プリセットを直接使用し、WIDTHxHEIGHT のような明示的なピクセルサイズは使用しないでください。送信に成功したら、GET /v1/images/generations/{task_id} で完全なレイヤー結果を照会します。curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 4,
"metadata": {
"resolution": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"watermark": false
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0-pro",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": ["https://example.com/panda.jpg"],
"metadata": {
"resolution": "1K"
}
}
)
task = response.json()
print(f"任务 ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
metadata: {
resolution: '2K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
image_urls: ['https://example.com/panda.jpg'],
metadata: {
resolution: '1K'
}
})
});
const task = await response.json();
console.log(`任务 ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "doubao-seedream-5-0-pro",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
{
"completed_at": 1787128810,
"created_at": 1787128650,
"expires_at": 1787215210,
"id": "tsk_img_example_layer_decomposition",
"model": "doubao-seedream-5-0-pro",
"object": "generation.task",
"progress": 100,
"result": {
"type": "image",
"data": [
{
"url": "https://files.toapis.com/images/example/base.jpg",
"size": "1600x2848",
"output_format": "jpeg",
"z_index": 0
},
{
"url": "https://files.toapis.com/images/example/layer-1.png",
"size": "3040x955",
"output_format": "png",
"z_index": 1,
"bounding_box": {
"absolute": [0, 0, 1600, 503],
"normalized": [0, 0, 999, 176]
},
"name": "Background office equipment",
"description": "The monitor edge and file organizer extracted from the background"
},
{
"url": "https://files.toapis.com/images/example/layer-2.png",
"size": "1982x1162",
"output_format": "png",
"z_index": 2,
"bounding_box": {
"absolute": [800, 589, 1599, 1058],
"normalized": [500, 207, 999, 371]
},
"name": "Stacked white papers",
"description": "Several stacked white office papers extracted from the desk"
}
]
},
"status": "completed"
}