多模态参考与提示词引用
支持同时使用图片、视频、音频等多种类型的参考素材。
多模态引用语法
在 references 数组中声明多个素材,按数组顺序编号。提示词中使用以下引用格式:
多模态请求示例
{
"model": "minimax-h3-933-2k-A",
"prompt": "@图1 作为角色外观,@视频1 作为动作参考,使用 @音频1 的节奏安排镜头切换。",
"seconds": 6,
"references": [
{
"type": "image",
"role": "reference",
"source": "https://example.com/character.jpg"
},
{
"type": "video",
"role": "reference",
"source": "https://example.com/motion.mp4"
},
{
"type": "audio",
"role": "reference",
"source": "https://example.com/music.mp3"
}
]
}完整 cURL 示例
curl https://api.maomaotoken.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-h3-933-2k-A",
"prompt": "@图1 作为角色外观,@视频1 作为动作参考,使用 @音频1 的节奏安排镜头切换。",
"seconds": 6,
"references": [
{
"type": "image",
"role": "reference",
"source": "https://example.com/character.jpg"
},
{
"type": "video",
"role": "reference",
"source": "https://example.com/motion.mp4"
},
{
"type": "audio",
"role": "reference",
"source": "https://example.com/music.mp3"
}
]
}'引用顺序与对应关系
references 数组:
[0] = character.jpg → @图1 或 @图片1
[1] = motion.mp4 → @视频1
[2] = music.mp3 → @音频1
提示词中的引用必须与数组顺序一一对应。模型能力限制
- 引用仅为定位方式,不能绕过模型的素材数量限制
- 部分模型支持有限:某些适配器仅接受
reference角色,不支持first_frame或last_frame - 具体支持情况:请查阅各模型的能力表说明
最佳实践
- 合理引用:不要引用未在提示词中使用的素材
- 清晰描述:在提示词中明确说明每个素材的用途
- 检查兼容性:确认模型支持多模态参考后再使用
- 优化提示词:补充细节以增强模型对素材的理解
常见错误
❌ 错误:声明了多个素材但未在提示词中引用
{
"prompt": "一个人在跳舞", // 未提及 @图1、@音频1
"references": [...]
}✓ 正确:在提示词中明确引用所需素材
{
"prompt": "@图1 中的人物按 @音频1 的节奏跳舞",
"references": [...]
}