Skip to main content
POST
通过文本、参考图像或首尾帧创建 Flux 3 视频。保存返回的 id,以轮询任务并下载完成的视频。 POST /v1/videos 使用 multipart/form-data。将控制参数作为表单字段发送。对于图像输入,请使用参考图像 URL 或起始帧和结束帧。 input_referencefirst_framelast_frame 分开。

选择输入模式

使用参考图像

input_reference 字段仅接受可公开访问的 HTTPS 图像 URL。对于单张图像,发送一次该字段;对于多张图像,则按照关键帧顺序重复发送。每个字段使用一个 URL,最多共 10 个 URL。 描述生成的视频应从参考图像中保留的运动、相机行为和视觉细节。 本页顶部的请求示例展示了单图和多图输入。以下请求按提交顺序使用两张图像:

设置首尾帧

发送 first_frame 以设置起始图像。要同时设置结束图像,请包含 last_frame,并在 prompt 中描述两帧之间的运动。 如果仅设置起始帧,请省略 last_frame。结束帧需要同时提供 first_framelast_frame 每个字段接受一个可公开访问的 HTTPS URL 或一个 PNG 或 JPEG 文件。每个字段仅发送一次,使用 URL 或文件之一。每个文件大小不得超过 20 MiB (20 × 1024 × 1024 字节). 本页顶部的帧示例展示了 URL 输入和文件上传,并显式设置了 secondssize

设置时长和尺寸

seconds 显式设置为从 520 的整数。 size 设置为以下精确的 WxH 预设值之一: 尺寸值用于选择输出分辨率档位。对于文生视频,编码尺寸可为编解码器对齐而调整。对于图生视频,参考图像也可决定最终构图和宽高比。

任务流程

1

创建任务

发送 multipart 表单请求,并保存返回的 id
2

轮询任务

调用 获取 Flux 3 视频 直到 statuscompletedfailed
3

下载结果

当任务处于 completed 状态时,调用 下载 Flux 3 视频内容 以保存 MP4 文件。

授权

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

请求体

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
默认值:flux-3
必填

Model ID for this route. Use flux-3.

Allowed value: "flux-3"
prompt
string
默认值:A paper boat glides across a still pond while the camera moves forward.
必填

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.

必填范围: 5 <= x <= 20
size
enum<string>
默认值: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.

可用选项:
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

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://

响应

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

id
string
必填

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

示例:

"<task_id>"

object
string
必填

Object type for the asynchronous video task.

Allowed value: "video"
model
string
必填

Model ID that the task uses.

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

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

可用选项:
queued,
in_progress,
completed,
failed
progress
integer
必填

Task progress as a coarse percentage.

必填范围: 0 <= x <= 100
created_at
integer<int64>
必填

Task creation time as a Unix timestamp in seconds.

task_id
string

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

示例:

"<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.

示例:

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

error
object

Failure details. This field appears when the task fails.

最后修改于 2026年9月9日