coming-soon
MODEL IDsandai:magi@2

MAGI-2

Sand AI
by

MAGI-2 is Sand AI's flagship video model, generating 1080p clips of 4 to 30 seconds with synchronized audio, including dialogue with lip sync, sound effects, ambience and music, in a single pass. It starts from a text prompt, from a first frame with an optional last frame, or from up to 10 reference images, 5 reference videos and 5 reference audio clips, in six aspect ratios from 21:9 to 9:16. It suits dialogue scenes, narrative shots and reference-driven work that needs consistent subjects and sound in one generation.

MAGI-2

First and last frame

How to animate a first frame or connect a first and last frame with MAGI-2: what to write about the frame, building a matching pair, and ordering the motion between them.

Introduction

Frame images start MAGI-2 from stills you already have. Send one and it becomes the opening frame of the clip. Send two and both ends of the clip are fixed, with the model generating the motion that connects them.

Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.

Built from 2 references
  • First frame
  • Last frame

The two frames share the bowl, the counter and the camera because the last one was edited from the first, the method Choosing a frame pair walks through.

Request shape

inputs.frameImages takes one or two items, each an image and its position, first or last. This is the hero request:

Try in Playground
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'sandai:magi@2',
  positivePrompt: 'Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.',
  width: 1920,
  height: 1080,
  duration: 8,
  inputs: {
    frameImages: [
      {
        image: 'https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-first.jpg',
        frame: 'first'
      },
      {
        image: 'https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-last.jpg',
        frame: 'last'
      }
    ]
  }
})
import asyncio
import os

from runware import Runware


async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "sandai:magi@2",
            "positivePrompt": "Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.",
            "width": 1920,
            "height": 1080,
            "duration": 8,
            "inputs": {
                "frameImages": [
                    {
                        "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-first.jpg",
                        "frame": "first"
                    },
                    {
                        "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-last.jpg",
                        "frame": "last"
                    }
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "videoInference",
      "taskUUID": "3cfe2e65-5440-456a-b554-ecab71448ed2",
      "model": "sandai:magi@2",
      "positivePrompt": "Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.",
      "width": 1920,
      "height": 1080,
      "duration": 8,
      "inputs": {
        "frameImages": [
          {
            "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-first.jpg",
            "frame": "first"
          },
          {
            "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-last.jpg",
            "frame": "last"
          }
        ]
      }
    }
  ]'
runware run sandai:magi@2 \
  positivePrompt="Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text." \
  width=1920 \
  height=1080 \
  duration=8 \
  inputs.frameImages.0.image=https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-first.jpg \
  inputs.frameImages.0.frame=first \
  inputs.frameImages.1.image=https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-last.jpg \
  inputs.frameImages.1.frame=last
{
  "taskType": "videoInference",
  "taskUUID": "3cfe2e65-5440-456a-b554-ecab71448ed2",
  "model": "sandai:magi@2",
  "positivePrompt": "Open on the first frame and end exactly on the last frame. Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks: the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last. Locked-off top-down camera, single continuous shot, no cuts. Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.",
  "width": 1920,
  "height": 1080,
  "duration": 8,
  "inputs": {
    "frameImages": [
      {
        "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-first.jpg",
        "frame": "first"
      },
      {
        "image": "https://assets.runware.ai/guides/sandai-magi-2/first-and-last-frame/source-hero-last.jpg",
        "frame": "last"
      }
    ]
  }
}
Response
[
  {
    "taskType": "videoInference",
    "taskUUID": "3cfe2e65-5440-456a-b554-ecab71448ed2",
    "videoUUID": "7b98a3b8-4909-40bc-8edf-10fb7cad8d72",
    "videoURL": "https://vm.runware.ai/video/os/a14d18/ws/2/vi/7b98a3b8-4909-40bc-8edf-10fb7cad8d72.mp4"
  }
]

A few rules come with frames:

  • A last frame needs a first frame. A request with only a last item is rejected.
  • Frames don't mix with references. Reference images, videos or audio in the same request as inputs.frameImages are rejected.
  • The prompt is still required, and it carries all of the motion the frames cannot show.
  • Generate the frames in the shape you request. width and height take the same six 1080p pairs as text-to-video, and each frame can be up to 30 MB.

Animating one frame

A single frame tells the model where the clip starts, and everything after it comes from the prompt.

The bright living room from the listing photo, with its gray sofa, oak coffee table and large window with sheer curtains. A light breeze moves the curtains, the leaves of the trees outside sway, and the patch of sunlight on the floor shifts softly. The camera pushes in slowly from the doorway toward the window and ends on the view of the garden. Soft morning light. Audio: a gentle breeze, distant birdsong, quiet room tone, no music, no voices.

Built from 1 reference
  • First frame
The bright living room from the listing photo, with its gray sofa, oak coffee table and large window with sheer curtains., A light breeze moves the curtains, the leaves of the trees outside sway, and the patch of sunlight on the floor shifts softly., The camera pushes in slowly from the doorway toward the window and ends on the view of the garden., Soft morning light. Audio: a gentle breeze, distant birdsong, quiet room tone, no music, no voices.
What the frame showsWhat movesCameraLight and audio

Open with one sentence on what the frame already shows, then spend the rest of the prompt on what moves. A prompt that describes a different scene from the image can pull the clip away from it, so the first sentence keeps the prompt and the frame in agreement.

Move what the photo already holds. The curtains, the trees outside and the patch of sunlight are all in the frame, so everything that moves in the clip comes from the photo. The push-in ends on the garden view, so the camera has somewhere to arrive.

Choosing a frame pair

A pair works when the only difference between the frames is the change the clip shows. Match the person, the setting, the light and the lens, and the model has one thing to animate. With two unrelated photos, it has to invent a way to get from one shot to another.

The reliable way to get there is to build the last frame from the first with an image edit. Send the first frame to an image model as a reference, name the one change, list what stays the same, and request the edit at the first frame's size:

A brush-wipe transition between the two frames

A makeup transformation reel. Open on the first frame and end exactly on the last frame. She smiles at the camera, lifts a large fluffy makeup brush and sweeps it across the lens, and as the brush clears the frame her finished look and loose hair are revealed in a single instant. She settles back into the same pose and smiles. Static camera, single continuous shot, no cuts. Audio: a soft whoosh as the brush passes the lens, a bright pop beat that drops on the reveal. No voices, no on-screen text.

Built from 2 references
  • First frame
  • Last frame

The video prompt never describes the makeup, since the last frame carries it. It spends its words on when the change happens: behind the brush as it sweeps across the lens, which hides the switch inside a single motion.

Describing the transition

The two frames fix the ends of the clip, and the prompt sets the route between them: what changes, and in what order.

Open on the first frame and end exactly on the last frame., Two hands, the only hands in the shot, build the poke bowl one topping at a time with the chopsticks:, the salmon goes on first, then the avocado, the edamame, the cucumber and the carrot, and a pinch of sesame seeds and the nori strips land last., Locked-off top-down camera, single continuous shot, no cuts., Audio: the soft tap of the chopsticks on the dishes, each topping settling on the rice, quiet kitchen room tone, a light lo-fi beat underneath. No voices, no on-screen text.
FramesWho actsOrderCameraAudio

Put the changes in a sequence. "The salmon goes on first" and "the nori strips land last" give seven changes an order, so the bowl fills the way a cook would build it. Lock the camera when both frames share a framing, because any move would have to end exactly where the last frame already is.

Tips

  1. Open a single-frame prompt with what the frame shows. One sentence that matches the image, then the motion and the camera.

  2. Keep both frames in one setting. Same person, set, light and lens, with one change between them.

  3. Build the last frame from the first. An image edit with one named change keeps everything else identical.

  4. Put the changes in order. Say what happens first and what lands last.

  5. Lock the camera when both frames share a framing. Spend the prompt on the motion inside the frame instead.

  6. Generate frames in the shape you request. Use the same aspect ratio for the frames and for width and height.