Seedream 画像タスクを作成
CometAPI を介して非同期 Seedream 画像タスクを送信し、ポーリング用に返されたタスク ID を保存します。
POST /v1/images/generations を async: true とともに使用します。
この非同期ワークフローは、次のモデル ID に適用されます。
/v1/models を照会してください。プロバイダーのパラメータの詳細については、BytePlus の 画像生成 API および Seedream 4.0-5.0 チュートリアル.
タスクを送信
model、prompt、async: true を送信します。例では、2K URL レスポンスを watermark: false でリクエストします。サイズのサポートはモデル ID ごとに異なるため、選択したモデルでサポートされるサイズを使用してください。
作成レスポンスでは data.task_id、data.status、および空の data.data 配列が返されます。タスクが保留中の場合は data.task_id を保存してください。最上位のレスポンスコードをタスク識別子として使用しないでください。
タスクをポーリング
保存したタスク ID を Seedream 画像タスクを取得に渡します。data.status が pending である間はポーリングを続けます。success または failure になったら停止します。
画像 URL を読み取る
承認
Bearer token authentication. Use your CometAPI key.
ボディ
Seedream model ID. This async workflow is documented for doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, doubao-seedream-5-0-260128, and seedream-5-0-pro-260628. Query /v1/models or open the Models page for account availability.
"doubao-seedream-5-0-260128"
Text prompt describing the image to generate.
"A clean studio photograph of a small red ceramic teapot on a pale blue table, soft window light, no text."
Asynchronous task mode. Set this to true, store data.task_id, and poll the task endpoint.
Requested output size. Use a value supported by the selected model.
"2K"
Response workflow for this async request. The example uses url and retrieves the URL from the completed task.
"url"
Whether to request a visible watermark on the generated image.
false