Seamless 5-second sequence connecting the three key poses: the skater crouches and pops the board, rises into a level ollie, then lands and rolls away. Camera: low tracking shot at board height, steady lateral move. Lighting: late afternoon plaza sun. Native audio: board pop, wheels on concrete, a soft landing. No logos, no readable text, no products, no packaging, no prices, no CTA, no advertising, no watermark, no brand marks.
FLUX 3 Keyframes to Video API
blackforestlabs/flux-3/keyframes-to-videoFLUX 3 Keyframes to Video 支持在 24 fps 时间轴上定点放置多达 10 张关键帧,结合文本提示词生成 5–20 秒连贯动态过渡与可选原生同步音频。以时间序列多视觉锚点严密指导多镜头调度、姿态转折与转场演进,实现专业导演级分镜控制。
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。
1/1 个素材
示例
REST API
快速开始
完成 API 认证,提交时间轴关键帧与调度指令,再通过任务 ID 获取视频结果。
连接 Vidgo API
创建 API Key,仅保存在服务端,并在请求头中发送 Authorization: Bearer VIDGO_API_KEY。
- 接口
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交一次生成任务
按请求示例填写 24 fps 时间轴关键帧与对应描述,提交后保存 task_id,用于查询进度与结果。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "blackforestlabs/flux-3/keyframes-to-video",
"input": {
"prompt": "Seamless 5-second sequence connecting the three key poses: the skater crouches and pops the board, rises into a level ollie, then lands and rolls away. Camera: low tracking shot at board height, steady lateral move. Lighting: late afternoon plaza sun. Native audio: board pop, wheels on concrete, a soft landing. No logos, no readable text, no products, no packaging, no prices, no CTA, no advertising, no watermark, no brand marks.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"sound": true,
"keyframes": [
{
"frame_index": 0,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-0.webp"
},
{
"frame_index": 60,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-60.webp"
},
{
"frame_index": 120,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-120.webp"
}
]
}
}
JSON
)
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")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"等待结果
用 task_id 查询状态,not_started 或 running 继续,finished 或 failed 停止。成功后读取 data.files[].file_url。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}以 2 秒为基准间隔轮询状态,长时间任务可适当拉长间隔。仅在 not_started 或 running 时继续,遇到 finished 或 failed 立即停止。也可以在同一请求中配置 callback_url 接收回调通知。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-flux3-k2v-...",
"status": "running",
"created_time": "2026-09-16T10:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}完整可运行示例
展开后可查看包含 HTTP 与业务码检查、task_id 校验、轮询、终态处理和超时边界的完整脚本。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "blackforestlabs/flux-3/keyframes-to-video",
"input": {
"prompt": "Seamless 5-second sequence connecting the three key poses: the skater crouches and pops the board, rises into a level ollie, then lands and rolls away. Camera: low tracking shot at board height, steady lateral move. Lighting: late afternoon plaza sun. Native audio: board pop, wheels on concrete, a soft landing. No logos, no readable text, no products, no packaging, no prices, no CTA, no advertising, no watermark, no brand marks.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"sound": true,
"keyframes": [
{
"frame_index": 0,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-0.webp"
},
{
"frame_index": 60,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-60.webp"
},
{
"frame_index": 120,
"image_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-3/keyframes-to-video/v1/01/input-keyframe-120.webp"
}
]
}
}
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')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
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')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
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 "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneinput 参数
下表列出 input 对象的可用参数、类型与默认值;请求示例同时展示顶层必填字段 model。按当前任务准备时间轴关键帧并配置输出规格。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| prompt | string | 是 | — | 描述连接各关键帧的运动过渡、运镜轨迹与原生声音。 |
| keyframes | object[] | 是 | — | 1 至 10 个关键帧对象。每项包含公开图片 URL 和唯一的整数 frame_index,范围为 0 到 duration × 24(含两端)。 |
| keyframes[].frame_index | integer | 是 | — | 在 24 fps 时间轴上的整数帧序号(0–480)。 |
| keyframes[].image_url | string | 是 | — | 当前关键帧的公开图片 URL。 |
| duration | integer | 否 | 5 | 输出视频时长,取值范围为 5 至 20 秒。 |
| resolution | string | 否 | 720p | 输出分辨率,可选 720p 或 1080p。 |
| aspect_ratio | string | 否 | auto | 输出画幅比例,支持 auto、21:9、2:1、16:9、4:3、1:1、3:4、9:16。 |
| sound | boolean | 否 | true | 是否生成原生音频,可选 true 或 false。 |
响应字段
提交成功后返回任务 ID;状态查询提供任务进度、输出文件,以及任务失败时的错误详情。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务结果码;成功响应使用 0 或 200。 |
| message | string | 可读说明或错误详情。 |
| data.task_id | string | 用于状态查询路径的任务 ID。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间,date-time 格式。 |
| data.progress | integer | 任务进度(0–100),以查询结果为准。 |
| data.files[] | array | 成功任务的全部输出文件,按响应顺序返回。 |
| data.files[].file_url | string | 生成视频的公开 URL。 |
| data.files[].file_type | string | 文件类型,例如 video。 |
| data.error_message | string | null | 状态为 failed 时的失败详情。 |
任务生命周期
在 not_started 或 running 状态下继续查询;收到 finished 或 failed 后结束轮询,并分别处理输出文件或错误详情。
not_started任务已接受,等待开始。
running正在生成。继续使用同一 task_id 轮询。
finished生成成功。从 data.files[].file_url 读取视频地址。
failed生成失败。读取 data.error_message 并停止轮询。
轮询与错误
- 认证收到 401 时,检查 Authorization 中的 Bearer API Key,更新凭据后重试。
- 校验收到 400 时,检查关键帧数量为 1–10、帧索引为唯一整数且位于 0 到 duration × 24 范围内。
- 网络与超时状态查询遇到网络错误或超时时,保留原 task_id 并重试查询,再根据返回的任务状态处理结果。
- 轮询间隔以 2 秒为基准间隔发起状态查询;如任务耗时较长,可逐步增加查询间隔。
- 终态仅在 not_started 或 running 时继续。遇到 finished 或 failed 立即停止。
- 回调选项可在请求顶层提供 callback_url 接收终态任务对象;投递失败时仍可轮询。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 输入模式 | 1–10 张关键帧 + 提示词 | 在 24 fps 时间轴上定点标注帧序号与图片链接。 |
| 输出 | 带原生音频的视频 | 提交后返回异步任务 ID,生成标准 MP4 视频。 |
| 时长 | 5–20 秒 | 整数取值,默认 5 秒。 |
| 分辨率 | 720p / 1080p | 默认 720p。 |
| 画幅比例 | 8 种比例(含 auto) | auto、21:9、2:1、16:9、4:3、1:1、3:4、9:16,默认 auto。 |
| 计费依据 | 输出秒数 × 分辨率费率 | 720p 为 34 积分/秒,1080p 为 58 积分/秒。 |
相关端点
FLUX 3 Keyframes to Video API 常见问题
FLUX 3 Keyframes to Video API 是什么?
FLUX 3 Keyframes to Video 是 Black Forest Labs 用于在指定时间轴上依多张关键帧插值生成连续视频的模型。它支持创作者在 24 fps 的时间轴基准上自由布置多达 10 张静帧图片,结合文本提示词生成 5 至 20 秒、最高 1080p 分辨率并包含可选原生同步音频的高保真电影级视频。依托高精度多锚点时空生成网络,模型能够精准缝合多镜头之间的姿态演进、运镜调度与光影流动,实现专业导演级的复杂分镜编排。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
FLUX 3 Keyframes to Video 的时间轴帧率与帧索引如何换算?
时间轴固定按 24 fps 运行。frame_index 为整数,换算公式为:秒数 × 24。例如 0 秒为 0,1 秒为 24,2.5 秒为 60,5 秒为 120,20 秒为 480。所有关键帧的 frame_index 都必须处于 0 到 duration × 24 范围内。
首个关键帧的索引必须为 0 吗?
不必。首项与其他项遵循相同规则:frame_index 必须是 0 到 duration × 24 范围内的整数,且不能与其他关键帧重复。
最多可以提供多少张关键帧?如何安排间隔最合理?
keyframes 数组支持传入 1 至 10 个关键帧对象。为了给物理引擎预留平滑加减速的计算空间,建议任意两个相邻关键帧之间的帧索引间隔不少于 12 帧(即 0.5 秒以上)。
如何在提示词中配合多个关键帧展开叙事?
建议在 prompt 中按时序描述各关键帧之间的衔接动作与运镜轨迹。例如“从首帧平滑推进至特写姿态,随后镜头向右旋转至最终构图”,引导模型精准衔接各个静止锚点。
关键帧之间的原生音频是如何随画面生成的?
当 sound 设为 true 时,模型会解析全时间轴上关键帧的内容变化及提示词中的动作声音细节,自动生成与各时间节点精准对齐的同步多轨音频,使声画节奏契合。
如果仅需要控制视频的起始与结束两帧,应该使用哪个端点?
若仅需控制起点与终点两个静帧,建议使用 FLUX 3 First Last Frame to Video 端点,仅需传入包含两张图片 URL 的数组即可,无需单独计算 24 fps 的 frame_index 帧序号。















