Crea un'attività di immagini Kling Omni
Utilizza CometAPI POST /kling/v1/images/omni-image per creare attività Kling Omni Image con input Prompt e immagini di riferimento.
task_id; utilizza Ottieni un’attività immagine Kling Omni per eseguire il polling dell’attività finché gli URL delle immagini generate non saranno disponibili.
Scegli la struttura della richiesta
- Generazione di una sola immagine: invia
prompt,image_list,resolution,result_type: single,neaspect_ratio - Output con filigrana: aggiungi
watermark_info.enabled: truequando ti serve un URL del risultato con filigrana nella risposta alla query - ID del modello: ometti
model_nameper usare il valore predefinito della route, oppure invia un ID di modello Omni Image testato, comekling-image-o1okling-v3-omni
image_list con un campo image. Il Prompt può citarle in base all’indice, ad esempio <<<image_1>>> per il primo elemento e <<<image_2>>> per il secondo elemento.
Flusso dell’attività
Crea l'attività
POST /kling/v1/images/omni-image e memorizza il valore restituito data.task_id.Interroga l'attività
data.task_status non è succeed o failed.Archivia le immagini
data.task_result.images[].url nel tuo spazio di archiviazione se ti serve un accesso duraturo.Campi del risultato
Le risposte alle query riuscite restituiscono le immagini generate indata.task_result.images. Ogni elemento può includere:
Autorizzazioni
Bearer token authentication. Use your CometAPI API key.
Intestazioni
Must be application/json.
Corpo
Text prompt for the generated image. The prompt can reference images with <<<image_1>>>, <<<image_2>>>, and matching indexes from image_list. Maximum length is 2,500 characters.
Optional model ID for this Omni Image request. Omit this field to use the route default.
Reference images that the prompt can cite with <<<image_1>>>, <<<image_2>>>, and so on. Keep the total number of reference images within the provider limits for the selected model.
Requested output resolution. Use 1k, 2k, or 4k; omitted requests use 1k.
1k, 2k, 4k Use single for a single-image task.
single Number of single-image results to generate. Range: 1 to 9.
1 <= x <= 9Requested output aspect ratio in width:height format. Use auto to let the provider choose from the prompt and references.
16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto Watermark options. When enabled is true, the task can return watermarked result URLs in addition to the original result URLs.
Webhook URL that receives task status notifications when the task status changes. Omit this field to poll manually.
User-defined task ID for your own tracking. It does not replace the system-generated task_id and must be unique per account.