跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt

Use this file to discover all available pages before exploring further.

HappyHorse 1.0 Video Edit 基于参考图与文本提示对输入视频进行编辑。使用异步任务接口——提交任务后轮询直至完成。
⚠️ 必须使用 native 格式。 因为 video-edit 同时需要”视频 + 参考图”,框架统一字段无法表达,必须使用 DashScope 原生风格的请求体(input.media[] 数组)。

核心能力

  • 视频编辑 — 修改已有视频中的物体、服饰或场景
  • 分辨率 — 720P / 1080P
  • 水印控制 — 可选关闭右下角水印
⚠️ 输出视频时长由输入视频长度决定,duration 参数对 video-edit 不一定生效。

工作流

1. POST /v1/video/generations  →  task_id   (必须用 input.media[] 格式)
2. GET  /v1/video/generations/{task_id}  →  轮询直至 SUCCESS / FAILURE
3. 读取 data.result_url  (有效期 24 小时)

快速示例

curl -X POST https://www.anyfast.ai/v1/video/generations \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "happyhorse-1.0-video-edit",
    "input": {
      "prompt": "让视频中的角色穿上图片中的条纹毛衣",
      "media": [
        {"type": "video", "url": "https://example.com/source.mp4"},
        {"type": "reference_image", "url": "https://example.com/cloth.webp"}
      ]
    },
    "parameters": {
      "resolution": "720P",
      "watermark": false
    }
  }'

参数说明

参数类型必填说明
modelstring必须为 happyhorse-1.0-video-edit
input.promptstring编辑描述文本
input.mediaarray恰好 2 个元素:1 个 video + 1 个 reference_image
input.media[].typestringvideoreference_image
input.media[].urlstring视频或参考图的公开 URL
parameters.resolutionstring720P / 1080P,默认 1080P
parameters.watermarkboolean默认 true,设为 false 关闭水印
parameters.seedinteger随机种子 [0, 2147483647]

计费

分辨率档位 × 计费时长 计费。不传 duration 时默认按 5 秒计。失败任务自动退费。

API 参考

HappyHorse 1.0 Video Edit 交互式 Playground。

任务查询

轮询任务状态并获取最终视频 URL。