Tạo tác vụ hình ảnh Seedream
Gửi một tác vụ hình ảnh Seedream bất đồng bộ qua CometAPI và lưu ID tác vụ được trả về để thăm dò.
POST /v1/images/generations với async: true để gửi một tác vụ hình ảnh Seedream mà không cần giữ kết nối HTTP mở.
Quy trình bất đồng bộ này áp dụng cho các ID model sau:
/v1/models. Để biết chi tiết về tham số của nhà cung cấp, hãy xem BytePlus API tạo hình ảnh và hướng dẫn Seedream 4.0-5.0.
Gửi tác vụ
Gửimodel, prompt và async: true. Ví dụ cũng yêu cầu phản hồi URL 2K với watermark: false. Khả năng hỗ trợ kích thước khác nhau tùy theo ID model, vì vậy hãy dùng kích thước được model đã chọn hỗ trợ.
Phản hồi tạo trả về data.task_id, data.status và một mảng data.data trống trong khi tác vụ đang chờ. Lưu data.task_id; không dùng mã phản hồi cấp cao nhất làm mã định danh tác vụ.
Thăm dò tác vụ
Truyền ID tác vụ đã lưu vào Truy xuất một tác vụ hình ảnh Seedream. Tiếp tục thăm dò khidata.status là pending. Dừng khi giá trị này trở thành success hoặc failure.
Đọc URL hình ảnh
Ủy quyền
Bearer token authentication. Use your CometAPI key.
Nội dung
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