Crea un video Flux 3
Crea un video Flux 3 da testo, immagini di riferimento oppure fotogrammi iniziale e finale con una preimpostazione di dimensioni 720p o 1080p.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=A paper boat glides across a still pond while the camera moves forward.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id restituito per interrogare l’attività e scaricare il video completato.
POST /v1/videos usa multipart/form-data. Invia i controlli come campi del modulo. Per gli input di immagini, usa URL di immagini di riferimento oppure fotogrammi iniziale e finale.
Mantieni input_reference separato da first_frame e last_frame.
Scegli una modalità di input
| Obiettivo | Campi obbligatori | Campi facoltativi |
|---|---|---|
| Da testo a video | model=flux-3, prompt | seconds, size |
| Da immagine HTTPS a video | model=flux-3, prompt, un URL input_reference | seconds, size |
| Fotogrammi chiave ordinati | model=flux-3, prompt, URL input_reference ripetuti | seconds, size |
| Fotogramma iniziale caricato | model=flux-3, prompt, un file first_frame | seconds, size |
| Video con primo e ultimo fotogramma | model=flux-3, prompt, first_frame, last_frame | seconds, size |
Usa immagini di riferimento
Il campoinput_reference accetta solo URL di immagini HTTPS accessibili pubblicamente. Invialo una volta per una singola immagine oppure ripetilo nell’ordine dei fotogrammi chiave per più immagini. Usa un URL per campo, fino a un massimo di 10 URL in totale.
Descrivi il movimento, il comportamento della videocamera e i dettagli visivi che il video generato deve preservare dall’immagine di riferimento.
Gli esempi di richiesta nella parte superiore di questa pagina mostrano input con una singola immagine e con più immagini. La richiesta seguente usa due immagini nell’ordine in cui sono state inviate:
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=Move smoothly through the supplied reference images in their given order. Preserve recognizable subjects and visual details as the scene changes. Keep the camera movement gentle.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'input_reference=https://apidoc.cometapi.com/images/image/gemini/6100640_569429.png' \
--form-string 'input_reference=https://apidoc.cometapi.com/images/image/gemini/6100640_569420.png'
Imposta il primo e l’ultimo fotogramma
Inviafirst_frame per impostare l’immagine iniziale. Per impostare anche l’immagine finale, includi last_frame e descrivi il movimento tra i due fotogrammi in prompt.
Per il solo fotogramma iniziale, ometti last_frame. Un fotogramma finale richiede sia first_frame sia last_frame.
Ogni campo accetta un URL HTTPS accessibile pubblicamente oppure un file PNG o JPEG. Invia ogni campo una volta, usando un URL o un file. Mantieni ogni file pari o inferiore a 20 MiB (20 × 1024 × 1024 byte).
Gli esempi dei fotogrammi nella parte superiore di questa pagina mostrano input URL e caricamenti di file, con seconds e size impostati esplicitamente.
Imposta durata e dimensioni
Imposta esplicitamenteseconds su un numero intero da 5 a 20.
Imposta size su uno di questi valori preimpostati WxH esatti:
| Livello di risoluzione | Dimensioni |
|---|---|
720p | 1280x720 |
1080p | 1920x1080 |
Flusso dell’attività
Crea l'attività
id restituito.Interroga l'attività
status non è completed o failed.Scarica il risultato
completed, chiama Scarica il contenuto video Flux 3 per salvare il file MP4.Autorizzazioni
Corpo
Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.
Reference image URLs. Send one publicly accessible HTTPS image URL per input_reference field. For multiple images, repeat the field in keyframe order, up to 10 URLs. This field accepts URLs only. Keep it separate from first_frame and last_frame.
^https://Opening-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. Pair with last_frame to set both boundaries. Keep frame inputs separate from input_reference.
^https://Closing-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. To specify the closing image through this endpoint, send last_frame together with first_frame. Keep frame inputs separate from input_reference.
^https://Risposta
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=flux-3' \
--form-string 'prompt=A paper boat glides across a still pond while the camera moves forward.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "flux-3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}