happyhorse-1.0-video-edit(视频编辑)
任务进度与结果查询见 使用说明。
说明
异步任务接口,用于提交 HappyHorse 视频编辑任务。支持上传参考视频,并可选传入参考图片辅助编辑,具体生成进度与结果请通过任务查询接口获取。
请求地址
http
POST /open/v1/ai_creation/task/submitHeader
http
access_token: {{access_token}}
Content-Type: application/json请求参数 Body
json
{
"ref_img_url": [
"https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4",
"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg"
],
"ref_prompt": "保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感",
"creation_type": 4,
"clarity": 1080,
"model_code": "happyhorse-1.0-video-edit"
}参数说明
| 字段 | 类型 | 是否必传 | 示例 | 说明 |
|---|---|---|---|---|
| ref_img_url | array<string> | 是 | ["https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4"] | 参考资源 URL 列表,至少包含 1 个视频 URL(mp4、mov),也可附带参考图片 URL |
| ref_prompt | string | 是 | 保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感 | 视频编辑提示词 |
| creation_type | int | 是 | 4 | 创作类型,视频生成为 4 |
| clarity | int | 否 | 1080 | 输出清晰度,常用 720 或 1080 |
| model_code | string | 是 | happyhorse-1.0-video-edit | 模型编码,固定为 happyhorse-1.0-video-edit |
happyhorse-1.0-video-edit可不传video_duration,服务端会基于源视频内容处理。
响应示例
json
{
"trace_id": "96afa792520b0e6a86d72e89435bc0a7",
"code": 0,
"msg": "success",
"data": "a60747d7-dc05-4afc-b2ef-ee4370ed53c6"
}响应字段说明
| 字段 | 说明 |
|---|---|
| code | 响应状态码 |
| msg | 响应信息 |
| trace_id | 请求链路追踪 ID |
| data | 提交的创作 ID |
响应状态码说明
| code | 说明 |
|---|---|
| 0 | 响应成功 |
| 400 | 传入参数格式错误 |
| 10400 | AccessToken 验证失败 |
| 40000 | 参数错误 |
| 40001 | 超出 QPS 限制 |
| 50000 | 系统内部错误 |
示例代码
shell
curl --location --request POST 'https://www.chanjing.cc/open/v1/ai_creation/task/submit' \
--header 'access_token: {{access_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"ref_img_url": [
"https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4",
"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg"
],
"ref_prompt": "保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感",
"creation_type": 4,
"clarity": 1080,
"model_code": "happyhorse-1.0-video-edit"
}'go
payload := strings.NewReader(`{
"ref_img_url": [
"https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4",
"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg"
],
"ref_prompt": "保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 1080,
"model_code": "happyhorse-1.0-video-edit"
}`)java
RequestBody body = RequestBody.create(mediaType, "{\n \"ref_img_url\": [\n \"https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4\",\n \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg\"\n ],\n \"ref_prompt\": \"保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感\",\n \"creation_type\": 4,\n \"aspect_ratio\": \"16:9\",\n \"clarity\": 1080,\n \"model_code\": \"happyhorse-1.0-video-edit\"\n}");py
payload = json.dumps({
"ref_img_url": [
"https://res.chanjing.cc/chanjing/res/aigc_creation/video/source.mp4",
"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref.jpg"
],
"ref_prompt": "保持主体动作连续性,将原视频调整为电影级光影与更强的奔跑动感",
"creation_type": 4,
"aspect_ratio": "16:9",
"clarity": 1080,
"model_code": "happyhorse-1.0-video-edit"
})