Crea un'attività di immagini Seedream
Invia un’attività di immagini Seedream asincrona tramite CometAPI e memorizza l’ID dell’attività restituito per il polling.
POST /v1/images/generations con async: true per inviare un’attività di immagini Seedream senza mantenere aperta la connessione HTTP.
Questo flusso di lavoro asincrono si applica ai seguenti ID modello:
/v1/models. Per i dettagli sui parametri del provider, consulta l’API di BytePlus per la generazione di immagini e il tutorial di Seedream 4.0-5.0.
Invia l’attività
Inviamodel, prompt e async: true. L’esempio richiede anche una risposta URL 2K con watermark: false. Il supporto delle dimensioni varia in base all’ID modello, quindi usa una dimensione supportata dal modello selezionato.
La risposta di creazione restituisce data.task_id, data.status e un array data.data vuoto mentre l’attività è in sospeso. Memorizza data.task_id; non usare il codice di risposta di primo livello come identificatore dell’attività.
Esegui il polling dell’attività
Per passare l’ID dell’attività memorizzato, usa Recupera un’attività di immagini Seedream. Continua il polling finchédata.status è pending. Interrompilo quando diventa success o failure.
Leggi l’URL dell’immagine
Autorizzazioni
Bearer token authentication. Use your CometAPI key.
Corpo
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