Hailuo 视频模型
Hailuo 视频模型
使用 POST /videos 创建 Hailuo 视频生成任务。示例包含可选的 route 和 route_mode 字段;移除它们即可使用默认可用路由。
文生视频示例:
curl -s https://api.getopenmodels.com/v1/videos \-H "Authorization: Bearer $OM_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "MiniMax/MiniMax-Hailuo-2.3","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","prompt": "Generate a video of a carp leaping over the Dragon Gate.","prompt_optimizer": true,"fast_pretreatment": false,"duration": 6,"resolution": "1080P","aigc_watermark": false}'
图生视频示例:
curl -s https://api.getopenmodels.com/v1/videos \-H "Authorization: Bearer $OM_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "MiniMax/MiniMax-Hailuo-2.3","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg","prompt": "Generate a video of a carp leaping over the Dragon Gate.","prompt_optimizer": true,"fast_pretreatment": false,"duration": 6,"resolution": "1080P","aigc_watermark": false}'
使用返回的 ID 检索任务状态和生成的视频结果。
curl "https://api.getopenmodels.com/v1/videos/{id}" \-H "Content-Type: application/json" \-H "Authorization: Bearer $OM_API_KEY"
对于 MiniMax Hailuo 模型,请在请求体中设置生成选项。
| 字段 | 类型 | 备注 |
|---|---|---|
model | string | 模型名称。使用 MiniMax/MiniMax-Hailuo-2.3。 |
first_frame_image | string | 图生视频必填。使用公开图片 URL 或 data:image/jpeg;base64,... 这样的 base64 Data URL。支持格式:JPG、JPEG、PNG、WebP。文件大小必须低于 20 MB,短边必须大于 300 px,宽高比必须在 2:5 和 5:2 之间。 |
prompt | string | 视频的文本描述。文生视频必填。最大长度:2000 个字符。支持方括号中的镜头控制指令。 |
prompt_optimizer | boolean | 是否自动优化提示词。默认值:true。设置为 false 可获得更直接的提示词控制。 |
fast_pretreatment | boolean | 是否减少提示词优化器预处理时间。默认值:false。 |
duration | integer | 视频时长,单位为秒。默认值:6。768P 支持 6 或 10;1080P 支持 6。 |
resolution | string | 视频分辨率。6 秒视频支持 768P 或 1080P;10 秒视频支持 768P。默认值:768P。 |
callback_url | string | 用于任务状态回调的可选 URL。如果省略,请轮询 GET https://api.getopenmodels.com/v1/videos/{id}。 |
aigc_watermark | boolean | 是否添加 AI 生成内容水印。默认值:false。 |