Skip to content

omni-fast 视频生成 ​

使用 omni-fast 模型生成视频 — 支持文生视频、图生视频、首尾帧插值、参考视频编辑

模型信息 ​

模型计费方式说明
omni-fast按次计费快速视频生成,支持多种输入模式

创建视频任务 ​

文生视频 ​

bash
curl -X POST "https://aiapi.fhddos.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast",
    "prompt": "Ocean waves gently rolling onto a sandy beach at golden hour, cinematic",
    "seconds": "8",
    "aspect_ratio": "16:9"
  }'

图生视频 (I2V) ​

通过 first_image_url 提供首帧参考图:

bash
curl -X POST "https://aiapi.fhddos.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast",
    "prompt": "The scene comes alive with gentle wind and drifting clouds",
    "first_image_url": "https://example.com/start_frame.jpg",
    "seconds": "8"
  }'

支持 data:image/jpeg;base64,... 格式直接上传图片。

首尾帧插值 ​

同时提供首帧和尾帧,生成平滑过渡视频:

bash
curl -X POST "https://aiapi.fhddos.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast",
    "prompt": "Smooth cinematic transition between the two frames",
    "first_image_url": "data:image/jpeg;base64,...",
    "last_image_url": "data:image/jpeg;base64,...",
    "seconds": "8",
    "aspect_ratio": "16:9"
  }'

多参考图视频 (R2V) ​

通过 images[] 传入多张参考图(最多 5 张):

bash
curl -X POST "https://aiapi.fhddos.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast",
    "prompt": "Use the first image as character reference, second as style reference. Create a cozy cafe scene.",
    "images": [
      "data:image/jpeg;base64,...",
      "data:image/jpeg;base64,..."
    ],
    "seconds": "8"
  }'

参考视频编辑 ​

通过 video 字段上传参考视频(data URI,最大 10MB):

bash
curl -X POST "https://aiapi.fhddos.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast",
    "prompt": "Edit the attached video: add rainy cinematic night look with neon reflections. Output a newly generated video.",
    "video": "data:video/mp4;base64,...",
    "seconds": "8"
  }'

创建响应 ​

json
{
  "id": "video_01KSDCPG3ZXAA2FD4NT3919V5P",
  "object": "video",
  "model": "omni-fast",
  "status": "queued",
  "progress": 0,
  "created_at": 1779639730
}

查询任务状态 ​

bash
curl "https://aiapi.fhddos.com/v1/videos/$VIDEO_ID" \
  -H "Authorization: Bearer $TOKEN"

状态流转 ​

queued → in_progress → completed / failed
状态说明
queued排队中,等待处理
in_progress生成中
completed已完成,可下载
failed生成失败

完成响应 ​

json
{
  "id": "video_01KSDCPG3ZXAA2FD4NT3919V5P",
  "object": "video",
  "model": "omni-fast",
  "status": "completed",
  "progress": 100,
  "video_url": "https://...",
  "seconds": "5",
  "size": "1280x720",
  "completed_at": 1779639794
}

下载视频 ​

任务完成后,通过 content 端点下载 MP4:

bash
curl -L "https://aiapi.fhddos.com/v1/videos/$VIDEO_ID/content" \
  -H "Authorization: Bearer $TOKEN" \
  --output video.mp4

TIP

推荐始终使用 /v1/videos/{id}/content 下载视频,无需解析响应中的 video_url 字段。

参数说明 ​

参数类型必填说明
modelstring是固定为 omni-fast
promptstring是文本提示词
secondsstring否视频时长,建议传字符串。可选值:"4"、"8"、"10"
durationstring否seconds 的别名;同时传时建议保持一致
aspect_ratiostring否画面比例(见下表)
sizestring否aspect_ratio 的别名。支持:landscape、portrait、square、1920x1080、1080x1920、1280x720、720x1280
orientationstring否aspect_ratio 的别名。支持:landscape、portrait
resolutionstring否分辨率偏好。支持:720p、1080p、2k、4k
fpsnumber/string否帧率偏好(实测返回 24fps)
n_framesnumber/string否帧数偏好(fps 的别名)
nnumber/string否帧数偏好(fps 的别名)
first_image_urlstring否首帧参考图(URL 或 data URI)→ 自动切换 I2V 模式
last_image_urlstring否尾帧参考图(URL 或 data URI)→ 配合 first_image_url 做首尾帧插值
imagesstring[]否多参考图数组(最多 5 张,URL 或 data URI)→ 自动切换 R2V 模式
videostring否参考视频(data URI 或 URL,最大约 100MB)
video_urlstring否video 的别名

画面比例 aspect_ratio ​

值实际输出说明
16:91280×720横屏(推荐)
9:16720×1280竖屏(推荐)
1:1落到横/竖屏档接口接收但不保证正方形输出
4:3落到横屏档接口接收但不保证 4:3 输出
3:4落到竖屏档接口接收但不保证 3:4 输出

参数别名关系 ​

seconds ←→ duration
aspect_ratio ←→ size ←→ orientation
fps ←→ n_frames ←→ n
video ←→ video_url

生成模式自动切换 ​

模式触发条件说明
T2V(文生视频)仅传 prompt纯文本描述生成视频
I2V(图生视频)传 first_image_url首帧图驱动生成
首尾帧插值传 first_image_url + last_image_url在首尾帧之间生成过渡视频
R2V(多参考图视频)传 images[]最多 5 张参考图,角色/风格参考
视频延长/编辑传 video 或 video_url基于已有视频延续或参考生成

最佳实践 ​

  • 时长参数:建议传字符串格式,如 "8" 而非数字 8
  • 提示词:描述具体场景、镜头运动、光线氛围,效果更佳
  • 轮询间隔:建议 8-15 秒,服务端会自动轮询上游并更新状态
  • 参考图格式:支持 URL 和 data:image/...;base64,... 两种格式
  • 参考视频:data URI 上传最大 10MB,建议使用短片段
  • 不要重复提交:任务提交后保持轮询同一个 task_id,不要并发重提

Fhddos AI 用户文档