Przejdź do głównej treści
POST
Utwórz wideo Flux 3 z tekstu, obrazów referencyjnych albo pierwszej i ostatniej klatki. Zapisz zwrócony id, aby odpytywać zadanie i pobrać ukończone wideo. POST /v1/videos używa multipart/form-data. Przesyłaj sterowanie jako pola formularza. W przypadku danych wejściowych obrazów używaj adresów URL obrazów referencyjnych albo klatek początkowych i końcowych. Trzymaj input_reference oddzielnie od first_frame i last_frame.

Wybierz tryb wejściowy

Użyj obrazów referencyjnych

Pole input_reference akceptuje wyłącznie publicznie dostępne adresy URL obrazów HTTPS. Wyślij je raz w przypadku pojedynczego obrazu albo powtórz w kolejności klatek kluczowych w przypadku wielu obrazów. Użyj jednego adresu URL na pole, maksymalnie 10 adresów URL łącznie. Opisz ruch, zachowanie kamery oraz szczegóły wizualne, które wygenerowane wideo powinno zachować z obrazu referencyjnego. Przykłady żądań u góry tej strony przedstawiają dane wejściowe z jednym i wieloma obrazami. Poniższe żądanie używa dwóch obrazów w przesłanej kolejności:

Ustaw pierwszą i ostatnią klatkę

Wyślij first_frame, aby ustawić obraz początkowy. Aby ustawić również obraz końcowy, uwzględnij last_frame i opisz ruch między tymi dwiema klatkami w prompt. W przypadku samej klatki początkowej pomiń last_frame. Klatka końcowa wymaga zarówno first_frame, jak i last_frame. Każde pole akceptuje jeden publicznie dostępny adres URL HTTPS albo jeden plik PNG lub JPEG. Wyślij każde pole raz, używając adresu URL albo pliku. Każdy plik nie może przekraczać 20 MiB (20 × 1024 × 1024 bajtów). Przykłady klatek u góry tej strony przedstawiają dane wejściowe URL i przesyłanie plików, z seconds i size ustawionymi jawnie.

Ustaw czas trwania i rozmiar

Ustaw seconds jawnie jako liczbę całkowitą od 5 do 20. Ustaw size na jedną z poniższych dokładnych wartości predefiniowanych WxH: Wartość rozmiaru wybiera poziom rozdzielczości wyjściowej. W przypadku generowania wideo z tekstu zakodowane wymiary mogą zostać dostosowane w celu wyrównania do kodeka. W przypadku generowania wideo z obrazu obraz referencyjny może również określać końcowe kadrowanie i współczynnik proporcji.

Przepływ zadania

1

Utwórz zadanie

Wyślij żądanie formularza multipart i zapisz zwrócony id.
2

Odpytuj zadanie

Wywołuj Pobieranie wideo Flux 3 aż status będzie mieć wartość completed albo failed.
3

Pobierz wynik

Gdy zadanie ma wartość completed, wywołaj Pobieranie zawartości wideo Flux 3 aby zapisać plik MP4.

Autoryzacje

Authorization
string
header
wymagane

Bearer authentication. Use your CometAPI API key.

Treść

multipart/form-data

Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.

model
string
domyślnie:flux-3
wymagane

Model ID for this route. Use flux-3.

Allowed value: "flux-3"
prompt
string
domyślnie:A paper boat glides across a still pond while the camera moves forward.
wymagane

Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.

Minimum string length: 1
seconds
integer

Requested clip duration in whole seconds. Set seconds explicitly to an integer from 5 through 20.

Wymagany zakres: 5 <= x <= 20
size
enum<string>
domyślnie:1280x720

Resolution preset in exact WxH form. Use 1280x720 for the 720p tier or 1920x1080 for the 1080p tier. Encoded dimensions can be codec-aligned; image-to-video framing can follow the reference image.

Dostępne opcje:
1280x720,
1920x1080
input_reference

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.

Pattern: ^https://
first_frame
wymagane if last_frame is set

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.

Pattern: ^https://
last_frame

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.

Pattern: ^https://

Odpowiedź

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
wymagane

Task ID. Use this value as task_id in retrieve and content requests.

Przykład:

"<task_id>"

object
string
wymagane

Object type for the asynchronous video task.

Allowed value: "video"
model
string
wymagane

Model ID that the task uses.

Allowed value: "flux-3"
status
enum<string>
wymagane

Task lifecycle status. Poll until the value is completed or failed.

Dostępne opcje:
queued,
in_progress,
completed,
failed
progress
integer
wymagane

Task progress as a coarse percentage.

Wymagany zakres: 0 <= x <= 100
created_at
integer<int64>
wymagane

Task creation time as a Unix timestamp in seconds.

task_id
string

Compatibility alias for id. This field can be omitted from retrieve responses.

Przykład:

"<task_id>"

completed_at
integer<int64>

Task completion time as a Unix timestamp in seconds when the task provides one.

expires_at
integer<int64>

Result expiration time as a Unix timestamp in seconds when the task provides one.

video_url
string<uri>

Video delivery URL. This field appears on completed tasks.

Przykład:

"https://media.example.com/flux-3-result.mp4"

error
object

Failure details. This field appears when the task fails.

Ostatnia modyfikacja 9 września 2026