创建 Flux 3 视频
通过文本、参考图像或首尾帧创建 Flux 3 视频,并使用 720p 或 1080p 尺寸预设。
id,以轮询任务并下载完成的视频。
POST /v1/videos 使用 multipart/form-data。将控制参数作为表单字段发送。对于图像输入,请使用参考图像 URL 或起始帧和结束帧。
将 input_reference 与 first_frame 和 last_frame 分开。
选择输入模式
使用参考图像
input_reference 字段仅接受可公开访问的 HTTPS 图像 URL。对于单张图像,发送一次该字段;对于多张图像,则按照关键帧顺序重复发送。每个字段使用一个 URL,最多共 10 个 URL。
描述生成的视频应从参考图像中保留的运动、相机行为和视觉细节。
本页顶部的请求示例展示了单图和多图输入。以下请求按提交顺序使用两张图像:
设置首尾帧
发送first_frame 以设置起始图像。要同时设置结束图像,请包含 last_frame,并在 prompt 中描述两帧之间的运动。
如果仅设置起始帧,请省略 last_frame。结束帧需要同时提供 first_frame 和 last_frame。
每个字段接受一个可公开访问的 HTTPS URL 或一个 PNG 或 JPEG 文件。每个字段仅发送一次,使用 URL 或文件之一。每个文件大小不得超过 20 MiB (20 × 1024 × 1024 字节).
本页顶部的帧示例展示了 URL 输入和文件上传,并显式设置了 seconds 和 size。
设置时长和尺寸
将seconds 显式设置为从 5 到 20 的整数。
将 size 设置为以下精确的 WxH 预设值之一:
任务流程
创建任务
id。轮询任务
status 为 completed 或 failed。下载结果
completed 状态时,调用 下载 Flux 3 视频内容 以保存 MP4 文件。授权
Bearer authentication. Use your CometAPI API key.
请求体
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://响应
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.