创建 MiniMax H3 视频
通过 CometAPI 使用文本、参考媒体或首尾帧创建 MiniMax H3 或 H3-Max 视频任务
id,以轮询任务并下载已完成的视频。
POST /v1/videos 使用 multipart/form-data。将控制参数作为表单字段发送,并为每个媒体输入分别重复一次参考字段。
选择模型
将model 设置为以下模型 ID 之一。从以下内容中的匹配模型表选择请求尺寸: 设置时长和尺寸.
选择输入模式
两个模型均使用以下字段。将model 设置为您选择的模型 ID。
使用参考图像
通过input_reference 以可公开访问的 HTTPS URL 或上传文件形式发送参考图像。对于多张图像,按照图像顺序重复该字段,每个字段包含一个 URL 或文件。
在此字段中仅使用全部 URL 或全部文件。请分别发送每个 URL,不要将多个 URL 合并为逗号分隔的值。
无论使用 URL 还是上传文件,最多可发送九张 PNG 或 JPEG 参考图像。每个上传图像不得超过 20 MiB。
在 Prompt 中,描述生成视频应保留的视觉细节。
使用参考视频和音频
将reference_videos 和 reference_audios 作为 multipart 文本值或上传的文件发送,并使用以下格式。
每个输入均重复发送一次相应字段,并且在同一字段内仅使用文本值或仅使用文件。请勿将输入合并为逗号分隔的值。
不同字段可以使用不同的输入类型,例如图像 URL 与上传的音频文件搭配使用。
若要组合图像、视频和音频参考,请在同一请求中发送 input_reference、reference_videos 和 reference_audios。
input_reference 将参考音频与至少一张图像配对。
描述生成的视频应遵循的动作、时序或声音。
每个上传的 MP4 不得超过 50 MiB,每个上传的 MP3 不得超过 15 MiB。一个 MiB 等于 1024 × 1024 字节。
本页顶部的请求示例展示了与图像配对的 MP4 URL、MP4 数据 URI 和 MP3 URL。
上传参考视频
上传 MP4 文件以引导镜头结构和动作:上传带图像的参考音频
将参考图像 URL 与上传的 MP3 文件配对:设置首帧和尾帧
为开始图像发送first_frame,并可选择为结束图像发送一个 last_frame。
每个字段接受一个可直接访问的公开 HTTPS PNG URL 或一个上传的 PNG 文件。每个上传的 PNG 不得超过 20 MiB(20 × 1024 × 1024 字节).
请勿将帧字段与参考图像、视频或音频字段组合使用。请使用单独的请求进行基于帧的生成。
使用帧输入时,size 选择分辨率层级。服务可以根据提供的帧规范化最终输出尺寸。
继续以 size 形式发送 WxH。
id。轮询任务,直到 status 为 completed 或
failed。任务完成后,下载视频内容。设置时长和尺寸
对于这两种模型,将seconds 设为介于 5 到 15 之间的整数。默认值为 5 秒。
从表格中为您的模型选择分辨率和宽高比,然后发送相应的 请求尺寸 值,并将其作为 size 以 WxH 格式传入。
对于文本和参考媒体请求,size 用于选择分辨率层级和画面宽高比。
服务可根据请求的尺寸和提供的参考媒体规范化最终输出尺寸。
minimax-h3 的尺寸
将以下请求尺寸与 model=minimax-h3 配合使用:
minimax-h3-max 的尺寸
将以下请求尺寸与 model=minimax-h3-max 配合使用:
任务流程
创建任务
id。轮询任务
status 为 completed 或 failed。下载结果
completed 状态时,调用 下载 MiniMax H3 视频内容 以保存 MP4 文件。授权
Bearer authentication. Use your CometAPI API key.
请求体
Model ID for the video task. Use minimax-h3 for 768P or 2K, or minimax-h3-max for 480P or 768P. Choose size from the matching model table.
minimax-h3, minimax-h3-max Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.
1Requested clip duration in whole seconds. Use an integer from 5 through 15. The default is 5.
5 <= x <= 15Requested size in WxH form. For text and reference-media requests, size selects the resolution tier and framing aspect ratio. With first or last frames, size selects the resolution tier. Use the matching model table: minimax-h3 uses 768P or 2K; minimax-h3-max uses 480P or 768P. For example, use 1344x768 for H3 at 768P, 864x480 for H3-Max at 480P, or 1360x768 for H3-Max at 768P. The service can normalize the final output dimensions.
^[1-9][0-9]*x[1-9][0-9]*$"1536x672"
"1344x768"
"1024x768"
"768x768"
"768x1024"
"768x1344"
"2912x1280"
"2544x1456"
"1920x1440"
"1440x1440"
"1440x1920"
"1440x2560"
"1120x480"
"864x480"
"640x480"
"480x480"
"480x640"
"480x864"
"1792x768"
"1360x768"
"768x1360"
PNG or JPEG reference images. Repeat input_reference with one publicly accessible HTTPS image URL or uploaded image file per field. Send up to nine reference images, whether you use URLs or uploaded files. Use all URLs or all files within this field. Do not combine URLs into a comma-separated value. Keep each uploaded image at or below 20 MiB. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each. Submit images in the order you want to reference them in the prompt.
^https://Reference video inputs. Repeat reference_videos with a direct publicly accessible HTTPS MP4 URL or an uploaded MP4 file. Use only text values or only files within this field. Each uploaded file can be up to 50 MiB. Send no more than three video inputs. A complete data:video/mp4;base64,... URI is also accepted as a text value. Use MP4 with H.264 video; an AAC audio track is optional. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each.
1 - 3 elements^(https://|data:video/mp4;base64,)"https://your-media-host/reference.mp4"
Reference audio inputs. Repeat reference_audios with a direct publicly accessible HTTPS MP3 URL or an uploaded MP3 file. Use only text values or only files within this field. Each uploaded file can be up to 15 MiB. Send no more than three audio inputs. Pair reference audio with at least one reference image. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each.
1 - 3 elements^https://"https://your-media-host/reference.mp3"
Opening frame input as one direct publicly accessible HTTPS PNG URL or one uploaded PNG file at or below 20 MiB (20 x 1024 x 1024 bytes). Do not combine frame fields with reference media fields.
^https://"https://your-image-host/first-frame.png"
Optional ending frame input, used with first_frame, as one direct publicly accessible HTTPS PNG URL or one uploaded PNG file at or below 20 MiB (20 x 1024 x 1024 bytes). Do not combine frame fields with reference media fields.
^https://"https://your-image-host/last-frame.png"
响应
Task created. Store the returned id and use it in retrieve and content requests.
Task ID. Use this value as task_id in retrieve and content requests.
"<task_id>"
Object type for the asynchronous video task.
"video"Model ID that the task uses.
minimax-h3, minimax-h3-max Task lifecycle status. Poll until the value is completed or failed.
queued, in_progress, completed, failed Task progress as a coarse percentage.
0 <= x <= 100Task creation time as a Unix timestamp in seconds.
Compatibility alias for id. This field can be omitted from retrieve responses.
"<task_id>"
Unix timestamp returned by the platform. Use status, not this field, to decide when polling can stop.
Result expiration time as a Unix timestamp in seconds when the task provides one.
Video delivery URL. This field appears on completed tasks.
"https://your-media-host/result.mp4"
Failure details. This field appears when the task fails.