seedinteger
Random seed for reproducibility (0-4294967295). Omit for a random seed.
Minimum: 0
Maximum: 4294967295
sandai/magi-2/image-to-videoMAGI-2 by Sand AI animates a first frame, or a first and last frame, into a 1080p video of 4 to 30 seconds with native audio.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum
PNG, JPEG, WebP, or GIF · 20 MiB maximum
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,
"image": "https://static.sandbase.ai/examples/cf7d3354-3c3c-475c-93c0-74f31c6b084a/input/241be84a-97d7-4d77-9ca9-7fdb51507601.webp",
"prompt": "The player jumps and shoots; the ball drops through the hoop and the friends on the court cheer. Handheld camera follows the shot."
}{
"aspect_ratio": "16:9",
"duration": 5,
"image": "https://static.sandbase.ai/examples/81388b0f-07c2-454c-b3d1-b5d1cc2a8680/input/3c3a70c5-90b9-4f03-bf17-b0258d1ac71d.webp",
"prompt": "The jazz band starts playing; the camera slowly pushes in."
}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/image-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
imagestringrequiredPublic HTTPS URL of the first frame. JPEG, PNG, WebP, BMP, TIFF, GIF or HEIC, under 30 MB.
promptstringOptional. Describe the motion and sound.
durationintegerOutput video duration in seconds (4-30). Billed per second.
Default: 5
Minimum: 4
Maximum: 30
end_imagestringOptional public HTTPS URL of the last frame.
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/image-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/cf7d3354-3c3c-475c-93c0-74f31c6b084a/output/5274b15a-f84f-4090-9f51-493760578f5d.mp4"
}
]