Tạo video Flux 3
Tạo video Flux 3 từ văn bản, hình ảnh tham chiếu hoặc khung hình đầu và cuối với preset kích thước 720p hoặc 1080p.
id được trả về để thăm dò tác vụ và tải video đã hoàn tất xuống.
POST /v1/videos sử dụng multipart/form-data. Gửi các tùy chọn điều khiển dưới dạng trường biểu mẫu. Đối với dữ liệu đầu vào hình ảnh, hãy dùng URL hình ảnh tham chiếu hoặc khung hình mở đầu và kết thúc.
Giữ input_reference tách biệt với first_frame và last_frame.
Chọn chế độ đầu vào
Sử dụng hình ảnh tham chiếu
Trườnginput_reference chỉ chấp nhận các URL hình ảnh HTTPS có thể truy cập công khai. Gửi trường này một lần cho một hình ảnh hoặc lặp lại theo thứ tự keyframe cho nhiều hình ảnh. Dùng một URL cho mỗi trường, tối đa 10 URL.
Mô tả chuyển động, hành vi của camera và các chi tiết trực quan mà video được tạo cần giữ lại từ hình ảnh tham chiếu.
Các mẫu yêu cầu ở đầu trang này minh họa dữ liệu đầu vào một hình ảnh và nhiều hình ảnh. Yêu cầu sau đây sử dụng hai hình ảnh theo thứ tự đã gửi:
Đặt khung hình đầu và cuối
Gửifirst_frame để đặt hình ảnh mở đầu. Để đồng thời đặt hình ảnh kết thúc, hãy thêm last_frame và mô tả chuyển động giữa hai khung hình trong prompt.
Đối với chỉ khung hình mở đầu, hãy bỏ qua last_frame. Khung hình kết thúc yêu cầu cả first_frame và last_frame.
Mỗi trường chấp nhận một URL HTTPS có thể truy cập công khai hoặc một tệp PNG hoặc JPEG. Gửi mỗi trường một lần, bằng URL hoặc tệp. Giữ mỗi tệp ở mức không quá 20 MiB (20 × 1024 × 1024 byte).
Các ví dụ về khung hình ở đầu trang này minh họa dữ liệu đầu vào bằng URL và tải tệp lên, với seconds và size được đặt tường minh.
Đặt thời lượng và kích thước
Đặtseconds một cách tường minh thành số nguyên từ 5 đến 20.
Đặt size thành một trong các giá trị preset WxH chính xác sau đây:
Luồng tác vụ
Tạo tác vụ
id được trả về.Thăm dò tác vụ
status là completed hoặc failed.Tải kết quả xuống
completed, hãy gọi Tải nội dung video Flux 3 xuống để lưu tệp MP4.Ủy quyền
Bearer authentication. Use your CometAPI API key.
Nội dung
Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.
Model ID for this route. Use flux-3.
"flux-3"Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.
1Requested clip duration in whole seconds. Set seconds explicitly to an integer from 5 through 20.
5 <= x <= 20Resolution 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.
1280x720, 1920x1080 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://Phản hồi
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
Task ID. Use this value as task_id in retrieve and content requests.
"<task_id>"
Object type for the asynchronous video task.
"video"Model ID that the task uses.
"flux-3"Task lifecycle status. Poll until the value is completed or failed.
queued, in_progress, completed, failed Task progress as a coarse percentage.
0 <= x <= 100Task creation time as a Unix timestamp in seconds.
Compatibility alias for id. This field can be omitted from retrieve responses.
"<task_id>"
Task completion time as a Unix timestamp in seconds when the task provides one.
Result expiration time as a Unix timestamp in seconds when the task provides one.
Video delivery URL. This field appears on completed tasks.
"https://media.example.com/flux-3-result.mp4"
Failure details. This field appears when the task fails.