curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sand-ai/magi-2/reference-to-video",
"input": {
"prompt": "The musician from the reference image walks along a sunlit boardwalk playing the melody from the reference audio.",
"reference_image_urls": [
"https://example.com/character.jpg"
],
"reference_audio_urls": [
"https://example.com/melody.mp3"
],
"duration": 8,
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-29T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Sand AI
MAGI-2 参考生视频
MAGI-2 参考生视频 API 结合最多 10 张参考图、5 段参考视频和 5 段参考音频,生成 4–30 秒带同步音频的 1080p 视频。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sand-ai/magi-2/reference-to-video",
"input": {
"prompt": "The musician from the reference image walks along a sunlit boardwalk playing the melody from the reference audio.",
"reference_image_urls": [
"https://example.com/character.jpg"
],
"reference_audio_urls": [
"https://example.com/melody.mp3"
],
"duration": 8,
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-29T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
prompt 中说明每类参考素材如何控制角色外观、动作、音色或配乐。
如需纯文本生成,请使用 MAGI-2 文生视频;如需首尾帧控制,请使用 MAGI-2 图生视频。
模型
- sand-ai/magi-2/reference-to-video — 多模态参考 1080p 视频生成,4–30 秒,支持同步音频。
功能
- 单任务最多支持 10 张参考图、5 段参考视频和 5 段参考音频。
- 三类参考素材可任意组合,也支持仅传入参考音频。
- 单次生成 4–30 秒 1080p 视频,支持六种宽高比(
16:9、9:16、1:1、4:3、3:4、21:9)。 - 提示词最长 15,000 个字符,同步生成对白、音效和环境音。
必填参数
prompt(string):描述各参考素材的用途以及场景、动作、运镜和声音,最多 15,000 个字符。reference_image_urls、reference_video_urls、reference_audio_urls至少提供一项非空数组。
可选参数
reference_image_urls(string[]):最多 10 个公开 HTTP(S) 参考图 URL(JPG、PNG 或 WEBP)。reference_video_urls(string[]):最多 5 个公开 HTTP(S) MP4 或 MOV 视频 URL(单段 2–30 秒,总时长不超过 30 秒)。reference_audio_urls(string[]):最多 5 个公开 HTTP(S) MP3 或 WAV 音频 URL(单段 2–30 秒,总时长不超过 30 秒)。duration(integer):视频时长(整秒),范围4到30,默认5。resolution(string):固定1080p。aspect_ratio(string):16:9(默认)、9:16、1:1、4:3、3:4或21:9。generate_audio(boolean):true(默认)生成同步音频;false仅输出无声视频。seed(integer):随机种子,0到2147483647。
输出
任务完成后返回单个 MP4 文件:25 fps 的 H.264 视频;当generate_audio 为 true 时附带 AAC 立体声音轨。
示例
- 角色图 + 音频参考:保持参考图中的角色形象,并配合参考音频旋律生成 8 秒画面。
- 纯音频参考:仅通过
reference_audio_urls驱动 5 秒音乐表演视频。
注意事项
reference_image_urls、reference_video_urls、reference_audio_urls至少需传入一项;本接口不接受image_urls(会返回 400)。- 所有媒体 URL 必须公开可访问且可直接下载。
- 积分按
duration秒数计费(1080p),参考素材数量与generate_audio开关不额外加价。任务失败全额退还。当前价格见定价页。
请求体
application/json