MAGI-2 Image to Video API

by Sand.ai

MAGI-2 image to video API: animate an opening frame or bridge two keyframes at 1080p, 4 to 30 s with sound, aspect ratio auto from the image.

sand-ai/magi-2/image-to-video
MAGI-2 AI Video Generator online
  • 4–30s clips
  • Sound included
  • Start and end frames
  • 6 aspect ratios
  • Create Video
  • Image to Video
  • Reference to Video

About MAGI-2

image_url is the only required field. Add last_image_url when the clip must end on a specific composition, such as a product reveal or a transformation.

Call it with the model name sand-ai/magi-2/image-to-video on POST /jobs/createTask, from $0.48.

Introduction

Overview

MAGI-2 Image to Video brings a single opening photograph to life or stages a smooth transition between an opening image and a closing image. Clips run from 4 to 30 whole seconds at 25 fps with 44.1 kHz stereo AAC audio enabled by default.

Leave aspect_ratio on auto to follow the opening image automatically: MAGI-2 selects the closest of its six supported ratios (for example, a 2:3 portrait snaps cleanly to 3:4 at 1248x1664).

Practical tips

  • Single-frame motion: Keep the prompt focused on expression, head turn, lighting sweep, and subtle camera motion.
  • First-to-last frame: Describe the transition beat connecting the two images (such as a shoulder turn and backdrop dissolve) plus matching ambience.
  • Optional prompt: You can omit the prompt to let MAGI-2 infer natural motion from the supplied frame(s).

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. auto · 16:9 · 9:16 · 1:1 · 4:3 · 3:4 · 21:9 · Default: auto
duration_secondsNoLength of the generated clip. ≥ 4 · ≤ 30 · Default: 5
generate_audioNoAdds sound made to match the picture: voices, ambience and effects. Default: true
image_urlYesThe picture to start from.
last_image_urlNoReference image to guide the final frame.
promptNoDescribe what you want to make.
seedNoUse the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647

Pricing

Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

OptionUSD per second
Standard$0.096

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

API quick start

Call the MAGI-2 API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
  2. Send the request. POST /jobs/createTask with model sand-ai/magi-2/image-to-video and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "sand-ai/magi-2/image-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "aspect_ratio": "auto",
    "duration_seconds": 5
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

About the MAGI-2 Image to Video endpoint

Keep the two keyframes in the same framing and lighting; describe the change between them in the prompt and leave the look to the images.

aspect_ratio auto snaps to the nearest supported ratio of the opening image, so crop uploads to the ratio you want before sending.

Read width, height and frame rate from the returned file instead of hard-coding them. Our 1920x1072 opening frame came back as a 1928x1076 clip on auto, and frame rates varied between 24 and 30 fps across our jobs.

With image_url alone, motion stays close to the still: our underwater ballroom drifted gently instead of following the stronger upward kick written in the prompt. When a feature needs a decisive change, send a closing frame too.

Make the closing frame by editing the opening frame with an image model rather than generating it from scratch, so framing, light and the subject line up. An edited closing frame gave us a clean five-second transformation with the same person throughout.

Sound still follows the prompt in this mode. Describe the sounds explicitly or the model may lay music under the scene.

MAGI-2 API questions

How much does the MAGI-2 API cost?

MAGI-2 starts at $0.48 for a 5-second clip with Image to Video, its lowest-priced task. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

What are the limits of the MAGI-2 · Image to Video API?

Clip length: 4–30 s; Aspect ratios: auto · 16:9 · 9:16 · 1:1 · 4:3 · 3:4 · 21:9; Prompt length (characters): 15,000; Largest upload: 10 MB. Requests outside these limits are rejected before anything is charged.

More about MAGI-2