Skip to content

happyhorse-1.0-r2v(多参考图生视频)

任务进度与结果查询见 使用说明

说明

异步任务接口,用于提交 HappyHorse 参考图生视频任务,需传入 1 张或多张参考图片,具体生成进度与结果请通过任务查询接口获取。

请求地址

http
POST /open/v1/ai_creation/task/submit
http
access_token: {{access_token}}
Content-Type: application/json

请求参数 Body

json
{
  "ref_img_url": [
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref1.jpg",
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref2.jpg"
  ],
  "ref_prompt": "保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感",
  "creation_type": 4,
  "aspect_ratio": "16:9",
  "clarity": 1080,
  "video_duration": 5,
  "model_code": "happyhorse-1.0-r2v"
}

参数说明

字段类型是否必传示例说明
ref_img_urlarray<string>["https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref1.jpg"]参考图片 URL 列表,支持传入 1 张或多张图片
ref_promptstring保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感视频生成提示词
creation_typeint4创作类型,视频生成为 4
aspect_ratiostring16:9输出视频宽高比,常用 9:1616:91:1
clarityint1080输出清晰度,常用 7201080
video_durationint5视频时长(秒)(如 510
model_codestringhappyhorse-1.0-r2v模型编码,固定为 happyhorse-1.0-r2v

响应示例

json
{
  "trace_id": "96afa792520b0e6a86d72e89435bc0a7",
  "code": 0,
  "msg": "success",
  "data": "a60747d7-dc05-4afc-b2ef-ee4370ed53c6"
}

响应字段说明

字段说明
code响应状态码
msg响应信息
trace_id请求链路追踪 ID
data提交的创作 ID

响应状态码说明

code说明
0响应成功
400传入参数格式错误
10400AccessToken 验证失败
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/photo/ref1.jpg",
        "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref2.jpg"
    ],
    "ref_prompt": "保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感",
    "creation_type": 4,
    "aspect_ratio": "16:9",
    "clarity": 1080,
    "video_duration": 5,
    "model_code": "happyhorse-1.0-r2v"
}'
go
payload := strings.NewReader(`{
  "ref_img_url": [
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref1.jpg",
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref2.jpg"
  ],
  "ref_prompt": "保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感",
  "creation_type": 4,
  "aspect_ratio": "16:9",
  "clarity": 1080,
  "video_duration": 5,
  "model_code": "happyhorse-1.0-r2v"
}`)
java
RequestBody body = RequestBody.create(mediaType, "{\n  \"ref_img_url\": [\n    \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref1.jpg\",\n    \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref2.jpg\"\n  ],\n  \"ref_prompt\": \"保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感\",\n  \"creation_type\": 4,\n  \"aspect_ratio\": \"16:9\",\n  \"clarity\": 1080,\n  \"video_duration\": 5,\n  \"model_code\": \"happyhorse-1.0-r2v\"\n}");
py
payload = json.dumps({
  "ref_img_url": [
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref1.jpg",
    "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/ref2.jpg"
  ],
  "ref_prompt": "保持马匹主体特征一致,让它在草原上迎风奔跑,镜头平稳推进,画面具有电影感",
  "creation_type": 4,
  "aspect_ratio": "16:9",
  "clarity": 1080,
  "video_duration": 5,
  "model_code": "happyhorse-1.0-r2v"
})