Seedream
取得 Seedream 圖像任務
使用 CometAPI GET /v1/images/generations/ 輪詢非同步 Seedream 圖像生成任務,並取得最終圖像資料。
GET
cURL
在你使用
POST /v1/images/generations 和 async: true 建立 Seedream 圖像後,請使用此端點。建立請求會回傳 data.task_id,而當任務成功時,此端點會回傳任務狀態以及最終圖像資料。
輪詢 Seedream 圖像任務
1
建立任務
傳送
POST /v1/images/generations 並設定 async: true,然後儲存 data.task_id。2
輪詢任務
使用已儲存的 task ID 呼叫此端點,直到
data.status 為 success 或 failure。3
讀取圖像資料
當
data.status 為 success 時,讀取 data.data 中的第一個項目。Seedream 非同步結果可能包含 url、b64_json 和 revised_prompt。狀態值
pending:任務正在佇列中或生成中。success:任務已完成,且data.data包含生成的圖像資料。failure:任務失敗。若有回傳data.fail_reason,請檢查其內容。
授權
Bearer token authentication. Use your CometAPI key.
路徑參數
Task ID returned in data.task_id by the async create request.