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/image-to-video",
"input": {
"prompt": "Slow dolly-in as warm sunlight drifts across the table and coffee steam rises gently.",
"image_urls": [
"https://example.com/opening-frame.jpg"
],
"duration": 5
}
}
'{
"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 根据单张首帧或首尾帧图片生成 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/image-to-video",
"input": {
"prompt": "Slow dolly-in as warm sunlight drifts across the table and coffee steam rises gently.",
"image_urls": [
"https://example.com/opening-frame.jpg"
],
"duration": 5
}
}
'{
"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,都可以通过统一的查询任务状态接口获取结果。
模型
- sand-ai/magi-2/image-to-video — 首帧与首尾帧 1080p 图生视频,4–30 秒,支持同步音频。
功能
- 支持单张首帧或首尾两帧控制(
image_urls传1–2张图片)。 - 单次生成 4–30 秒 1080p 视频。
- 自动跟随首帧宽高比。
- 同步生成对白、音效和环境音,可按需关闭音频。
- 提示词最长 15,000 个字符,并支持可选
seed。
必填参数
prompt(string):描述动作、运镜、剧情与声音,最多 15,000 个字符。对白请放在引号内。image_urls(string[]):1 或 2 个公开可访问的 HTTP(S) 图片 URL(JPG、PNG 或 WEBP)。第 1 张为首帧,可选第 2 张为尾帧。
可选参数
duration(integer):视频时长(整秒),范围4到30,默认5。resolution(string):固定1080p。aspect_ratio(string):仅支持auto(默认),自动跟随首帧宽高比。generate_audio(boolean):true(默认)生成同步音频;false仅输出无声视频。seed(integer):随机种子,0到2147483647。
输出
任务完成后返回单个 MP4 文件:25 fps 的 H.264 视频;当generate_audio 为 true 时附带 AAC 立体声音轨。
示例
- 首帧动画:以单张起始帧生成 5 秒镜头运动与环境音。
- 首尾帧过渡:在 6 秒内实现首帧到尾帧的自然运镜过渡。
注意事项
image_urls需传入 1 或 2 个公开可访问的 HTTP(S) URL;aspect_ratio仅接受auto或省略。参考字段(reference_*)在本接口会返回 400。- 积分按
duration秒数计费(1080p),generate_audio开关不改变价格。任务失败全额退还。当前价格见定价页。
请求体
application/json