MAGI-2 Reference to Video API

by Sand.ai

MAGI-2 reference to video API: combine up to 10 images, 5 clips and 5 audio files in one 1080p shot of 4 to 30 s, tagged in the prompt with @tokens.

sand-ai/magi-2/reference-to-video
MAGI-2 AI Video Generator online
  • 4–30s clips
  • Sound included
  • Up to 10 reference images
  • 6 aspect ratios
  • Create Video
  • Image to Video
  • Reference to Video

About MAGI-2

prompt is required and should assign every reference a role, written as @image_1, @video_1 or @audio_1 in array order.

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

Introduction

Overview

MAGI-2 Reference to Video unifies up to 10 reference images, 5 reference videos, and 5 reference audio clips into one 4–30 second 1080p shot at 25 fps. Use it when you want subject identity from photos, camera movement or choreography from clips, and rhythm or voice texture from audio in a single call.

Reference clip limits

  • Images: up to 10 files.
  • Videos: up to 5 clips, 2–30 seconds each, 30 seconds combined (longer inputs are trimmed).
  • Audio: up to 5 clips, 2–30 seconds each, 30 seconds combined (longer inputs are trimmed).

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. 16:9 · 9:16 · 1:1 · 4:3 · 3:4 · 21:9 · Default: 16:9
duration_secondsNoLength of the generated clip. ≥ 4 · ≤ 30 · Default: 5
generate_audioNoAdds sound made to match the picture: voices, ambience and effects. Default: true
promptYesDescribe what you want to make.
reference_audio_urlsNoAudio to match: a voice, music or a rhythm.
reference_image_urlsNoPictures of the people, outfits or places the result should keep.
reference_video_urlsNoClips whose motion, camera or style the result should follow.
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/reference-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/reference-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "16:9",
    "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 Reference to Video endpoint

Use reference_video_urls for camera movement or pacing and reference_audio_urls for voice, music or rhythm; images carry identity, wardrobe, props and sets.

Validate durations before upload: each clip or audio file must be 2 to 30 seconds, and anything past 30 seconds combined per type is trimmed.

Store references as an ordered list and generate the @tokens from that order at submit time. In our three-image test (character, location, prop), giving every token a role in the first sentence kept all three consistent for the whole clip.

Voice references work for new lines: a 6.5-second text-to-speech clip passed as @audio_1 let a character say a sentence that never appears in that clip, in the same voice. Keep voice references free of music.

Prompts with several beats are followed in order, but small late beats can be dropped. Put the essential action first and treat anything after it as optional when you check results automatically.

References do not change the price: a request with ten images, five clips and five audio files costs the same per second as a text-only call, so there is no billing reason to strip them.

Trim video references to the part that carries the camera move or choreography you want copied; anything past 30 seconds combined is cut off without warning.

Images carry identity best when each one shows a single subject on a plain or relevant background: a full-length wardrobe shot for a person, an empty location plate for a set, a product shot on a dark backdrop for a prop. Cluttered composites make it harder for the model to tell which part of an image a token refers to.

MAGI-2 API questions

How much does the MAGI-2 API cost?

MAGI-2 starts at $0.48 for a 5-second clip with Reference 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 · Reference to Video API?

Clip length: 4–30 s; Aspect ratios: 16:9 · 9:16 · 1:1 · 4:3 · 3:4 · 21:9; Reference audio: 5; Reference images: 10; Reference videos: 5. Requests outside these limits are rejected before anything is charged.

More about MAGI-2