Skip to main content
POST
cURL
Usa questo endpoint per animare un’immagine sorgente in un video Kling.

Prima di chiamarlo

  • Fornisci un URL pubblico di immagine oppure una stringa immagine base64
  • Usa un’immagine che soddisfi i requisiti di pixel di Kling; le miniature molto piccole vengono rifiutate dal task di generazione
  • Inizia con l’esempio predefinito kling-v2-6, poi scegli un altro model_name dall’enum OpenAPI quando ti serve un diverso percorso di modello
  • Mantieni semplice la prima richiesta: un’immagine di input, un prompt, nessun fotogramma finale, nessuna motion mask
  • Usa dynamic_masks come array di oggetti mask-and-trajectory quando ti serve un movimento locale controllato
  • Usa sound: off per una prima richiesta deterministica senza audio sui percorsi di modello che supportano il suono generato

Nomi dei modelli

Usa i normali model ID dei modelli video Kling su questo endpoint. Riserva i model ID dei modelli Omni per Omni Video.

Flusso del task

1

Invia la richiesta da immagine a video

Crea il task e memorizza il task_id di Kling restituito.
2

Interroga il task

Prosegui con Ottenere un task Kling per seguire lo stato del task finché l’output non è pronto.
3

Salva il risultato

Persisti l’asset completato se hai bisogno di conservarlo oltre l’URL di consegna del provider.
Per il riferimento completo dei parametri, consulta la documentazione ufficiale di Kling.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Corpo

application/json
image
string
obbligatorio

Source image URL or base64 image string. Use an image that meets Kling pixel requirements; very small thumbnails are rejected. For base64 input, send the encoded image string as the field value.

prompt
string

Text prompt describing the desired motion. Maximum 500 characters.

negative_prompt
string

Elements to exclude from the video. Maximum 200 characters.

callback_url
string

Webhook URL to receive task status updates when the task completes.

mode
enum<string>
predefinito:std

Generation mode. std for standard (faster), pro for professional (higher quality).

Opzioni disponibili:
std,
pro
model_name
enum<string>
predefinito:kling-v1

Model ID for this image-to-video request. Use kling-v3 for new requests. Use Omni model IDs only with the Omni Video endpoint.

Opzioni disponibili:
kling-v1,
kling-v1-5,
kling-v1-6,
kling-v2-master,
kling-v2-1,
kling-v2-1-master,
kling-v2-5-turbo,
kling-v2-6,
kling-v3
image_tail
string

Tail-frame reference image as a Base64 string or public URL. Same format requirements as image. Controls the last frame of the generated video.

cfg_scale
number

Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.

duration
string
predefinito:5

Output video length in seconds. Use 5 or 10; omit to use 5.

static_mask
string

Static brush mask image as a Base64 string or public URL. White areas are frozen in place during video generation. Must match the aspect ratio and resolution of the input image.

dynamic_masks
object[]

Optional motion masks. Each entry contains a mask image and an ordered trajectory list.

external_task_id
string

Custom task id for your own tracking. Does not replace the system-generated task id but can be used to query tasks. Must be unique per user.

sound
enum<string>

Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.

Opzioni disponibili:
on,
off

Risposta

200 - application/json

Task accepted.

code
integer
obbligatorio

Error code; specifically define the error code

message
string
obbligatorio

error message

data
object
obbligatorio