FLUX 3 Max Keyframes to Video API
blackforestlabs/flux-3-max/keyframes-to-videoFLUX 3 Max Keyframes to Video 将固定在指定帧位的 1–10 张图片生成为一条 5–20 秒、720p 或 1080p 的带原生音频视频。每张图片会出现在 24 fps 时间轴上你设定的 frame_index,让关键情节准确落在预定时刻。
拖拽文件、粘贴剪贴板素材,或输入 URL。 必填。添加 1–10 张 JPEG、PNG 或 WebP,再为每张设置 24 fps 时间轴上的 Frame Index。
3/10 个素材
每个 Frame Index 为 0–192(duration × 24)之间互不相同的整数。
REST API
快速开始
三步完成第一次 FLUX 3 Max Keyframes to Video 调用。示例把三张图片固定在 8 秒视频的第 0、96、192 帧,并返回 task_id。
连接 Vidgo API
创建 API Key,将它安全保存在服务端,并通过 Authorization 请求头以 Bearer Token 发送。
- 接口地址
- POST
https://api.vidgo.ai/api/generate/submit - 认证方式
- Authorization: Bearer VIDGO_API_KEY
提交一个生成任务
运行短示例,提供 prompt 并至少包含一个关键帧。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "blackforestlabs/flux-3-max/keyframes-to-video",
"input": {
"prompt": "A paper lantern festival on a quiet river at night, filmed as one smooth drifting shot. Follow the three keyframes in order: a single lantern being lit on the bank, the lantern floating among many others mid-river, then a wide view of hundreds of lanterns passing under a stone bridge. Keep the water calm and the lantern colours warm. Native audio: soft water lapping, faint crowd murmur, wooden boat creak. No text, no logos, no watermark.",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "auto",
"sound": true,
"keyframes": [
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-01.webp",
"frame_index": 0
},
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-02.webp",
"frame_index": 96
},
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-03.webp",
"frame_index": 192
}
]
}
}'等待并获取结果
使用返回的 task_id 查询同一个任务,直到状态变为 finished 或 failed;成功后读取 data.files[].file_url。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}当状态为 not_started 或 running 时,建议每隔数秒查询一次;到达 finished 或 failed 后停止。成功时从 data.files[].file_url 读取视频地址;生成较长视频时可逐步拉长间隔,也可在提交请求根层添加 callback_url 异步接收结果。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "PLO2R6GLU1NN669K",
"status": "not_started",
"created_time": "2026-11-05T07:04:46"
}
}{
"code": 200,
"data": {
"task_id": "PLO2R6GLU1NN669K",
"status": "finished",
"files": [
{
"file_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v2/01/output-01.mp4",
"file_type": "video"
}
],
"created_time": "2026-11-05T07:04:46",
"error_message": null,
"progress": 100
}
}完整可运行示例
理解上面的三步流程后再展开。这里把提交、轮询、终态处理和结果读取合并在一个脚本中。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "blackforestlabs/flux-3-max/keyframes-to-video",
"input": {
"prompt": "A paper lantern festival on a quiet river at night, filmed as one smooth drifting shot. Follow the three keyframes in order: a single lantern being lit on the bank, the lantern floating among many others mid-river, then a wide view of hundreds of lanterns passing under a stone bridge. Keep the water calm and the lantern colours warm. Native audio: soft water lapping, faint crowd murmur, wooden boat creak. No text, no logos, no watermark.",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "auto",
"sound": true,
"keyframes": [
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-01.webp",
"frame_index": 0
},
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-02.webp",
"frame_index": 96
},
{
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3-max/keyframes-to-video/v1/01/input-keyframe-03.webp",
"frame_index": 192
}
]
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
model 和 callback_url 位于请求根层;生成参数位于 input。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | — | 固定为 blackforestlabs/flux-3-max/keyframes-to-video。 |
| callback_url | string (URL) | 否 | — | 用于接收任务结果的公开 HTTP(S) 地址,任务结束时推送。 |
| input | object | 是 | — | 生成参数:prompt 与 1–10 个 keyframes,以及可选的 duration、resolution、aspect_ratio 与 sound。 |
| input.prompt | string | 是 | — | 镜头文本描述;开启 sound 时可写入声音提示。 |
| input.keyframes | object[] | 是 | — | 1–10 个 {image_url, frame_index};frame_index 唯一,取值 0 到 duration × 24。 |
| input.duration | integer | 否 | 5 | 整数秒,5–20。 |
| input.resolution | string | 否 | 720p | 720p 或 1080p。 |
| input.aspect_ratio | string | 否 | auto | auto、21:9、2:1、16:9、4:3、1:1、3:4、9:16。 |
| input.sound | boolean | 否 | true | 原生音频开关,不影响价格。 |
响应字段
提交响应会立即返回任务标识;随着任务推进,状态响应会补充进度、输出文件或失败信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 应用层结果码,成功响应使用 0 或 200。 |
| message | string | 存在时返回便于阅读的响应或错误信息。 |
| data.task_id | string | 任务标识,用于拼接状态查询地址。 |
| data.status | string | 当前状态:not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间,采用日期时间格式。 |
| data.progress | number | 上游提供进度时返回的完成百分比。 |
| data.files[] | array | 任务成功后返回的生成文件列表。 |
| data.files[].file_url | string | 生成视频的公开访问地址。 |
| data.files[].file_type | string | 生成文件类型,例如 video。 |
| data.files[].watermark_url | string | null | 存在水印版本时返回对应地址。 |
| data.error_message | string | null | status 为 failed 时的失败详情。 |
任务生命周期
not_started 与 running 属于非终态;finished 与 failed 是两种终态,收到任意终态后都应停止轮询。
not_started任务已被接受,正在等待排队开始。
running视频正在生成中,请保持轮询查询。
finished任务完成,从 data.files[].file_url 读取视频地址。
failed生成失败,读取 data.error_message 了解原因并停止轮询。
轮询与错误处理
- 认证失败401 表示 Bearer API Key 缺失或无效,请在控制台确认密钥后重试。
- 参数校验400 表示请求字段不合法或属于其他端点,请检查每个 keyframes 条目及其 frame_index 范围。
- 轮询间隔任务运行期间建议每隔数秒查询一次;生成较长视频时可逐步拉长间隔。
- 终态处理仅在 not_started 或 running 时继续轮询;收到 finished 或 failed 即停止。
- 回调方式在请求根层添加 callback_url,即可在任务结束时接收结果推送,无需持续轮询。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | blackforestlabs/flux-3-max/keyframes-to-video | 异步关键帧引导视频生成的模型标识。 |
| 时长 | 5–20 | 整数秒,默认 5 秒。 |
| 分辨率 | 720p | 1080p | 默认 720p。 |
| 画幅比例 | auto | 21:9 | 2:1 | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 默认 auto。 |
| 价格 | 34 / 58 credits/s | 对应 720p / 1080p,按输出秒数计费,含音频。 |
相关模型
FLUX 3 Max Keyframes to Video API 常见问题
FLUX 3 Max Keyframes to Video API 是什么?
FLUX 3 Max Keyframes to Video 是 fal 与 Black Forest Labs 合作推出、用于按定时关键帧生成视频的模型。它将固定在帧位上的 1–10 张图片生成为一条 5–20 秒、720p 或 1080p 的带原生音频视频。模型基于 FLUX 3 视频底座,在 24 fps 时间轴上让每张图片出现在指定帧,并在其间生成连续的运动与声音。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
FLUX 3 Max Keyframes to Video 的 frame_index 如何计算?
用秒数乘以 24。5 秒视频中第 0、60、120 帧分别对应开头、中间和结尾;10 秒视频的最后一帧为 240。每个取值须互不相同。
FLUX 3 Max Keyframes to Video 最多支持多少个关键帧?
可发送 1–10 个关键帧。每个条目只包含 image_url 与 frame_index,帧位可设在 duration × 24 以内的任意位置。
FLUX 3 Max 关键帧超出视频时长会怎样?
请求会返回 400 错误并指出对应关键帧。请增加 duration 或调整帧位,使 frame_index 位于 0 到 duration × 24 之间。
FLUX 3 Max Keyframes to Video 使用什么画幅?
aspect_ratio 为 auto 时输出跟随第一张关键帧图片;也可选择七种固定比例之一,为特定平台构图。
关键帧数量会影响 FLUX 3 Max 的价格吗?
不会。FLUX 3 Max Keyframes to Video 按输出秒数计费,720p 每秒 34 点数、1080p 每秒 58 点数,8 秒 720p 视频无论 1 个还是 10 个关键帧都是 272 点数。
FLUX 3 Max 关键帧与首尾帧有什么不同?
FLUX 3 Max Image to Video 只固定开头和结尾两帧;Keyframes to Video 可以在精确时刻加入中间画面,对节奏与事件顺序的控制更细。















