MiniMax H3(首尾帧视频)
任务进度与结果查询见 使用说明。
说明
异步任务接口,用于提交 MiniMax H3 首尾帧视频任务。请求需传入首帧图片,可选传入尾帧图片,具体生成进度与结果请通过任务查询接口获取。
请求地址
http
POST /open/v1/ai_creation/task/submitHeader
http
access_token: {{access_token}}
Content-Type: application/json请求参数 Body
json
{
"start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
"end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
"ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
"creation_type": 4,
"aspect_ratio": "auto",
"clarity": 768,
"resolution_mode": "native",
"video_duration": 5,
"number_of_images": 1,
"model_code": "minmax-h3-first-last-to-video"
}参数说明
| 字段 | 类型 | 是否必传 | 示例 | 说明 |
|---|---|---|---|---|
| start_frame | string | 条件必传 | https://.../start.jpg | 首帧图片 URL;参考图片总数至少 1 张,建议传入首帧 |
| end_frame | string | 否 | https://.../end.jpg | 尾帧图片 URL;参考图片总数最多 2 张 |
| ref_img_url | array<string> | 条件必传 | ["https://.../start.jpg", "https://.../end.jpg"] | 兼容参考图 URL 列表,可替代 start_frame、end_frame |
| ref_resources | array<object> | 条件必传 | [{"url":"https://.../start.jpg","file_type":"image"}] | 参考图片列表,可替代 start_frame、end_frame |
| ref_resources.url | string | 是 | https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg | 参考图片 URL |
| ref_resources.file_type | string | 是 | image | 该模式固定传 image |
| ref_prompt | string | 是 | 镜头从首帧自然过渡到尾帧 | 视频生成提示词,最多 7000 个字符 |
| creation_type | int | 是 | 4 | 创作类型,视频生成为 4 |
| aspect_ratio | string | 是 | auto | 输出视频宽高比,支持 auto、16:9、4:3、1:1、3:4、9:16、3:2、2:3、21:9、9:21 |
| clarity | int/string | 否 | 768 | 支持 480、768、1080、1440、2160,或字符串 2K、4K;不传默认 1440(2K 官方生成) |
| resolution_mode | string | 否 | native | 分辨率模式:native 表示加速版,direct 表示官方生成,super 表示生成后超分 |
| video_duration | int | 是 | 5 | 视频时长(秒),支持 5-15 |
| number_of_images | int | 否 | 1 | 生成数量,固定为 1;不传按 1 处理 |
| model_code | string | 是 | minmax-h3-first-last-to-video | 模型编码,固定为 minmax-h3-first-last-to-video |
支持的分辨率组合:
| 输出规格 | clarity | resolution_mode | 说明 |
|---|---|---|---|
| 480P 加速 | 480 | native,可省略 | ComfyUI 加速生成 |
| 768P 加速 | 768 | native,可省略 | ComfyUI 加速生成 |
| 768P 官方生成 | 768 | direct | MiniMax H3 官方生成 |
| 1080P 超分 | 1080 | super,可省略 | 由 768P 加速结果超分 |
| 2K 官方生成 | 1440 或 2K | direct,可省略 | 默认兼容模式,使用 MiniMax H3 官方生成 |
| 2K 超分 | 1440 或 2K | super | 由 768P 官方生成结果超分 |
| 4K 超分 | 2160 或 4K | super,可省略 | 由 2K 官方生成结果超分 |
clarity和resolution_mode都不传时,默认使用1440 + direct。start_frame、end_frame、ref_img_url和ref_resources中的参考图片会合并去重,总数必须为 1-2 张。该模式不使用quality_mode。
响应示例
json
{
"trace_id": "96afa792520b0e6a86d72e89435bc0a7",
"code": 0,
"msg": "success",
"data": "a60747d7-dc05-4afc-b2ef-ee4370ed53c6"
}响应字段说明
| 字段 | 说明 |
|---|---|
| code | 响应状态码 |
| msg | 响应信息 |
| trace_id | 请求链路追踪 ID |
| data | 创作任务唯一 ID(unique_id) |
响应状态码说明
| code | 说明 |
|---|---|
| 0 | 响应成功 |
| 400 | 传入参数格式错误 |
| 10400 | AccessToken 验证失败 |
| 40000 | 参数错误 |
| 40001 | 超出 QPS 限制 |
| 50000 | 系统内部错误 |
示例代码
shell
curl --location --request POST 'https://open-api.chanjing.cc/open/v1/ai_creation/task/submit' \
--header 'access_token: {{access_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
"end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
"ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
"creation_type": 4,
"aspect_ratio": "auto",
"clarity": 768,
"resolution_mode": "native",
"video_duration": 5,
"number_of_images": 1,
"model_code": "minmax-h3-first-last-to-video"
}'go
payload := strings.NewReader(`{
"start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
"end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
"ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
"creation_type": 4,
"aspect_ratio": "auto",
"clarity": 768,
"resolution_mode": "native",
"video_duration": 5,
"number_of_images": 1,
"model_code": "minmax-h3-first-last-to-video"
}`)java
RequestBody body = RequestBody.create(mediaType, "{\n \"start_frame\": \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg\",\n \"end_frame\": \"https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg\",\n \"ref_prompt\": \"镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑\",\n \"creation_type\": 4,\n \"aspect_ratio\": \"auto\",\n \"clarity\": 768,\n \"resolution_mode\": \"native\",\n \"video_duration\": 5,\n \"number_of_images\": 1,\n \"model_code\": \"minmax-h3-first-last-to-video\"\n}");py
payload = json.dumps({
"start_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg",
"end_frame": "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg",
"ref_prompt": "镜头从首帧自然过渡到尾帧,主体动作连贯,光影变化平滑",
"creation_type": 4,
"aspect_ratio": "auto",
"clarity": 768,
"resolution_mode": "native",
"video_duration": 5,
"number_of_images": 1,
"model_code": "minmax-h3-first-last-to-video"
})