seedinteger
Random seed for reproducibility (0-4294967295). Omit for a random seed.
Minimum: 0
Maximum: 4294967295
sandai/magi-2/reference-to-videoMAGI-2 by Sand AI creates a 1080p video of 4 to 30 seconds with native audio, guided by up to 10 reference images, 5 video clips and 5 audio clips.
Try the model
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"aspect_ratio": "16:9",
"duration": 5,
"images": [
"https://static.sandbase.ai/examples/eeb92b90-3c1a-4979-9860-1c508e732417/input/776a14fa-b948-478b-bae6-a45c68da5ac7.jpg",
"https://static.sandbase.ai/examples/eeb92b90-3c1a-4979-9860-1c508e732417/input/e53fed62-fd62-44db-a206-3cf944d6d8e8.webp"
],
"prompt": "The pink-haired basketball player in the blue jersey from image 2 walks into the jazz bar from image 1 and dances in front of the band while the camera tracks alongside."
}{
"aspect_ratio": "16:9",
"duration": 5,
"prompt": "Use the slow forward camera move from video 1 at a frozen mountain lake at sunrise, thin mist drifting over the ice and snowy peaks behind.",
"videos": [
"https://static.sandbase.ai/examples/a91d9da4-241c-4080-a7ba-61d429dc5561/input/20fe7b20-b825-40c4-b777-b37f2a70589e.mp4"
]
}Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "sandai/magi-2/reference-to-video",
"duration": 5,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
seedintegerRandom seed for reproducibility (0-4294967295). Omit for a random seed.
Minimum: 0
Maximum: 4294967295
audiosarrayUp to 5 WAV/MP3 URLs, 2-30 s each and 30 s in total, up to 15 MB each.
imagesarrayUp to 10 public HTTPS image URLs, each under 30 MB.
promptstringrequiredDescribe how to use the references, the scene, motion and sound.
videosarrayUp to 5 MP4/MOV URLs, 2-30 s each and 30 s in total, up to 200 MB each.
durationintegerOutput video duration in seconds (4-30). Billed per second.
Default: 5
Minimum: 4
Maximum: 30
resolutionstringOutput resolution. MAGI-2 renders 1080p only.
Default: "1080p"
Possible values: "1080p"
aspect_ratiostringOutput aspect ratio.
Default: "16:9"
Possible values: "16:9", "9:16", "1:1", "4:3", "3:4", "21:9"
generate_audiobooleanGenerate a native audio track with the video. Included in the price.
Default: true
{
"model": "sandai/magi-2/reference-to-video",
"duration": 5,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"url": "https://static.sandbase.ai/examples/eeb92b90-3c1a-4979-9860-1c508e732417/output/d2d4c16f-12c5-4149-9204-87f8ceb701cb.mp4"
}
]