seedinteger
Random seed for reproducibility (0-4294967295). Omit for a random seed.
최소값: 0
최대값: 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.
모델 사용해 보기
PNG, JPEG, WebP 또는 GIF · 최대 20 MiB
PNG, JPEG, WebP 또는 GIF · 최대 20 MiB
다음에 무엇을 하시겠습니까?
예시를 선택하면 입력값과 결과가 플레이그라운드에 로드됩니다.
{
"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."
}MAGI-2 image-to-video API by Sand AI: animate a first frame, or move from a first frame to a last frame, in a 1080p video of 4 to 30 seconds with native audio. Use it through SandBase with one API key, pay per second of output, and switch providers automatically if one is unavailable.
curl https://api.sandbase.ai/v1/run \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sandai/magi-2/image-to-video",
"image": "https://example.com/first-frame.jpg",
"prompt": "The woman leans toward the microphone, smiles and says: \"Welcome back to the show.\" Slow push-in. Sound: quiet room tone and her voice.",
"duration": 5,
"aspect_ratio": "16:9"
}'
The response contains an id. Poll the run every 10 seconds until status is completed, then download outputs[0].url:
curl https://api.sandbase.ai/v1/run/$RUN_ID \
-H "Authorization: Bearer $SANDBASE_API_KEY"
Stop polling when status is failed and read the error message. You can also run the same request in the Playground on this page without writing code.
| This model | MAGI-2, all inputs | |
|---|---|---|
model | sandai/magi-2/image-to-video | sandai/magi-2 |
| APIs | POST /v1/run with the fields below | POST /v1/run with the same flat fields, or the Ark compatible API (POST /api/v3/contents/generations/tasks with "model": "magi-2" and a content array) |
| Inputs | A first frame, optionally a last frame | Text, first and last frame, or references, all in one model |
| Providers | Switches to another provider if one is unavailable | One provider |
| Price | $0.08 per second | $0.08 per second |
Use this model when you want a switch to another provider if one is unavailable. Use MAGI-2 with all inputs to send every kind of input to one model on /v1/run, or if your code already calls Sand AI's API or the Ark SDK. Compare the APIs on the MAGI-2 page. |
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string | — | Optional. Describe the motion and sound. |
image | string, required | — | First frame (upload or public HTTPS URL). JPEG, PNG, WebP, BMP, TIFF, GIF or HEIC, under 30 MB. |
end_image | string | — | Optional last frame (upload or public HTTPS URL). |
duration | integer 4–30 | 5 | Output video duration in seconds (4-30). Billed per second. |
aspect_ratio | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 21:9 | 16:9 | Output aspect ratio. |
resolution | 1080p | 1080p | Output resolution. MAGI-2 renders 1080p only. |
generate_audio | boolean | true | Generate a native audio track with the video. Included in the price. |
seed | integer 0–4294967295 | random | Random seed for reproducibility (0-4294967295). Omit for a random seed. |
end_image), describe the action that connects the two frames. Frames with a similar setting, lighting and subject give the smoothest transition.aspect_ratio that matches your image to avoid cropping.Sound: line for ambience and effects.$0.08 per second of output video, with native audio included in the price. Resolution is fixed at 1080p. Failed runs are not billed.
| Output length | Price |
|---|---|
| 4s | $0.32 |
| 5s (default) | $0.40 |
| 10s | $0.80 |
| 30s | $2.40 |
Yes. Send the first frame as image and the last frame as end_image. The video starts on the first image and ends on the second. The prompt is optional.
JPEG, PNG, WebP, BMP, TIFF, GIF or HEIC under 30 MB, as an upload in the Playground or a public HTTPS URL.
Any whole number of seconds from 4 to 30, set with duration. The video is rendered at 1080p and 25 fps in one of six aspect ratios: 16:9, 9:16, 1:1, 4:3, 3:4 or 21:9.
Yes. Dialogue, sound effects, ambience and music are generated together with the picture. Set generate_audio to false for a silent video; the price is the same.
$0.08 per second of output video, from your SandBase balance. A 5-second clip costs $0.40 and a 30-second clip $2.40. Failed runs, including ones rejected by content moderation, are not billed.
Yes. If your code already calls Sand AI's API or the Ark SDK, use MAGI-2 with all inputs with "model": "magi-2" at https://api.sandbase.ai/api/v3. Compare both ways.
Browse the most-liked MAGI-2 videos on X, credited to the people who made them: MAGI-2 videos from X. Short films, ads and anime.
빌드를 시작하세요
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"SandBase API 키를 생성해 서버 환경에 설정하세요. 모든 요청에는 Bearer 인증이 사용됩니다.
export SANDBASE_API_KEY="YOUR_API_KEY"키는 서버에 보관하세요. 브라우저 코드에 노출하거나 저장소에 커밋하지 마세요.
이 모델 ID와 입력값을 사용해 /v1/run로 POST하세요. 위의 요청 예시에는 제출과 폴링이 포함되어 있습니다.
반환된 실행 ID를 사용해 상태가 completed, failed 또는 timeout이 될 때까지 폴링하세요. completed 이후에만 출력을 읽으세요.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"모델의 이미지, 비디오 또는 오디오 필드에 공개적으로 접근 가능한 파일 URL을 전달하세요. 지원 형식과 제한은 각 Playground 입력 옆에 표시됩니다.
Playground의 지원되는 이미지 필드에서 업로드 또는 교체 컨트롤을 사용하세요. 비디오 URL 필드는 호스팅된 driving video를 받으며, 비디오 업로드 지원을 의미하지는 않습니다.
seedintegerRandom seed for reproducibility (0-4294967295). Omit for a random seed.
최소값: 0
최대값: 4294967295
imagestring필수First frame (upload or public HTTPS URL). 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.
기본값: 5
최소값: 4
최대값: 30
end_imagestringOptional last frame (upload or public HTTPS URL).
resolutionstringOutput resolution. MAGI-2 renders 1080p only.
기본값: "1080p"
가능한 값: "1080p"
aspect_ratiostringOutput aspect ratio.
기본값: "16:9"
가능한 값: "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.
기본값: true
{
"model": "sandai/magi-2/image-to-video",
"duration": 5,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}완료된 실행의 결과는 출력에 표시됩니다. 아래 내용은 새 생성 결과가 아니라 모델에 저장된 예시입니다.
[
{
"url": "https://static.sandbase.ai/examples/cf7d3354-3c3c-475c-93c0-74f31c6b084a/output/5274b15a-f84f-4090-9f51-493760578f5d.mp4"
}
]