---
title: Video and audio references — MAGI-2 | Runware Docs
url: https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references
description: "How to drive MAGI-2 with reference videos and audio: borrowing a routine or a camera path, giving a speaker a voice from a clip, and cutting a montage to a music track."
---
### [Introduction](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#introduction)

Reference videos and audio clips give MAGI-2 **what a still image cannot**: a movement, a camera path, a voice or a piece of music. A request takes **up to five videos and five audio clips** alongside up to ten images, and the prompt refers to them as Video 1 and Audio 1 the same way it refers to Image 1.

[Watch video](https://runware.ai/docs/assets/hero.Dqr56qPf.mp4)

*The routine from the video, a new person, a new place*

> **Prompt**: Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles.

**Video 1**:

[Watch video](https://runware.ai/docs/assets/source-routine.D9BW1OtY.mp4)

> **Prompt**: A fitness instructor in a plain gray T-shirt and black joggers performs a short routine facing the camera in a plain white studio: one jumping jack, a deep squat with her arms reaching forward, a torso twist to each side, and she finishes with a clap above her head. Full-body framing, static camera, even light.

**Image 1**:

![Full-length portrait of a woman with short platinum hair in a red cropped training top, black bike shorts and white trainers against light gray](https://runware.ai/docs/assets/source-athlete.DDhyfKhX_yxKbO.jpg)

> **Prompt**: Full-length portrait of a young woman with short platinum hair, in a red cropped training top, black bike shorts and white trainers, standing straight against a plain light gray studio background. Even soft light, photoreal. No text, no logos.

**Image 2**:

![An empty rooftop basketball court at sunset with a blue and orange surface, a chain-link fence and a city skyline](https://runware.ai/docs/assets/source-court.NVwwci2E_2ezEv5.jpg)

> **Prompt**: An empty outdoor basketball court on a city rooftop at sunset, a blue and orange painted surface, a chain-link fence and the skyline behind it. Eye-level photo, photoreal, no people, no readable text.

**The prompt gives each input one job**: the routine and its timing from the video, the person and the place from the two images. It names each input without describing it, so the same prompt runs again with a new athlete or a new location by swapping one image.

### [Request shape](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#request-shape)

Videos go in `inputs.referenceVideos` and audio in `inputs.referenceAudios`, each a URL or a UUID (a previous generation's, or one uploaded via Media Storage). **Each type keeps its own numbering**, so `Video 1` is the first item in `inputs.referenceVideos` and `Image 1` the first in `inputs.referenceImages`:

**TypeScript**:

```typescript
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: 'Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles.',
  width: 1080,
  height: 1920,
  duration: 6,
  inputs: {
    referenceVideos: [
      'https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-routine.mp4'
    ],
    referenceImages: [
      'https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-athlete.jpg',
      'https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-court.jpg'
    ]
  }
})
```

**Python**:

```python
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": "Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles.",
            "width": 1080,
            "height": 1920,
            "duration": 6,
            "inputs": {
                "referenceVideos": [
                    "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-routine.mp4"
                ],
                "referenceImages": [
                    "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-athlete.jpg",
                    "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-court.jpg"
                ]
            }
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "videoInference",
      "taskUUID": "8c063ead-187b-4d4d-a87f-2b422b1d5447",
      "model": "sandai:magi@2",
      "positivePrompt": "Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles.",
      "width": 1080,
      "height": 1920,
      "duration": 6,
      "inputs": {
        "referenceVideos": [
          "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-routine.mp4"
        ],
        "referenceImages": [
          "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-athlete.jpg",
          "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-court.jpg"
        ]
      }
    }
  ]'
```

**CLI**:

```bash
runware run sandai:magi@2 \
  positivePrompt="Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles." \
  width=1080 \
  height=1920 \
  duration=6 \
  inputs.referenceVideos.0=https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-routine.mp4 \
  inputs.referenceImages.0=https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-athlete.jpg \
  inputs.referenceImages.1=https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-court.jpg
```

**JSON**:

```json
{
  "taskType": "videoInference",
  "taskUUID": "8c063ead-187b-4d4d-a87f-2b422b1d5447",
  "model": "sandai:magi@2",
  "positivePrompt": "Take the routine, its timing and the full-body framing from Video 1. The person is the woman in Image 1, and the place is the rooftop court in Image 2. Keep her face, hair and outfit from Image 1. Static camera, warm sunset light. Audio: her sneakers on the court, her breathing, light wind, no music, no subtitles.",
  "width": 1080,
  "height": 1920,
  "duration": 6,
  "inputs": {
    "referenceVideos": [
      "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-routine.mp4"
    ],
    "referenceImages": [
      "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-athlete.jpg",
      "https://assets.runware.ai/guides/sandai-magi-2/video-and-audio-references/source-court.jpg"
    ]
  }
}
```

Every video and every audio clip runs **2 to 30 seconds**, and the clips of one type share **a 30-second budget**, so two 15-second videos fill it. Trim each reference to the part you want to borrow. Videos can be up to 200 MB each and audio clips up to 15 MB. The prompt is required, and frame images cannot join a request that carries references.

### [Borrowing a camera path](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#borrowing-a-camera-path)

A plain object on an empty table is enough to **define a camera move**. Take the path from the clip and give the subject and the set to images:

[Watch video](https://runware.ai/docs/assets/output-camera.BUbwIeDM.mp4)

*The camera move of the box clip, applied to a speaker*

> **Prompt**: Take only the camera path and its pacing from Video 1. Replace the box with the smart speaker in Image 1, standing on the kitchen counter in Image 2. Keep the shape, the fabric and the light ring of the speaker from Image 1. Audio: quiet kitchen room tone, a soft chime as the light ring glows, no music, no voices.

**Video 1**:

[Watch video](https://runware.ai/docs/assets/source-camera-move.CGUivQyc.mp4)

> **Prompt**: The camera starts on a wide shot of a plain white cardboard box on a gray table in an empty studio, pushes in to a close-up of the box, then arcs ninety degrees around it to a side view. The box never moves. Soft even light, nothing else in the frame.

**Image 1**:

![A charcoal gray fabric smart speaker with a white light ring on top, on white](https://runware.ai/docs/assets/source-speaker.BluhcKtj_N57is.jpg)

> **Prompt**: A smart speaker covered in charcoal gray fabric, a short cylinder with a soft white light ring on top, on a plain white background. Product packshot, soft even light, photoreal. No text, no logos.

**Image 2**:

![An empty white marble counter in a bright modern kitchen with a bowl of lemons at the far end](https://runware.ai/docs/assets/source-counter.CNO8SNFt_1XGfTF.jpg)

> **Prompt**: An empty white marble kitchen counter in a bright modern kitchen, a bowl of lemons at the far end, soft morning light from a window on the left. Photoreal interior photography, no people, no text.

The prompt **names the camera path without describing it**, and "replace the box" says what changes. The push-in and the arc come from the box clip, which makes one simple reference a template for every product in a catalog.

### [Giving a speaker a voice](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#giving-a-speaker-a-voice)

An audio reference can supply **the voice a character speaks in**. Pair it with a portrait, and say in the prompt whose voice it is and what it says:

[Watch video](https://runware.ai/docs/assets/output-voice.D1F06les.mp4)

*The founder speaking in the reference voice*

> **Prompt**: The man in Image 1 stands in his plant shop and speaks to the camera in the voice of Audio 1. He says: "We started this shop on a windowsill. Now we ship plants to every state, and every one is still packed by hand." Keep his face, hair and shirt from Image 1. Locked-off camera at chest height, soft daylight. Audio: his voice from Audio 1, quiet shop ambience, no music, no subtitles.

**Image 1**:

![Waist-up portrait of a man with short dreadlocks in a denim shirt in front of shelves of potted plants](https://runware.ai/docs/assets/source-founder.Bc_j5Zns_4e1ID.jpg)

> **Prompt**: Waist-up portrait of the founder of a small plant shop, a man in his thirties with short dreadlocks and a denim shirt, standing in front of wooden shelves of potted plants and looking into the camera with a warm, closed-mouth smile. Soft daylight, real skin texture, photoreal. No text, no logos.

**Audio 1**:

[Listen to audio](https://runware.ai/docs/assets/voice-founder.BQQaIrig.mp3)

> **Prompt**: We started this shop on a windowsill. Now we ship plants to every state, and every one is still packed by hand.

**Quote the clip's words exactly** in the prompt, so the lip sync and the voice describe the same speech. **Match the length to the clip** as well: the voice clip runs 8 seconds, and `duration` is set to 8 so the whole line fits.

### [Scoring to a track](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#scoring-to-a-track)

A music reference **scores the clip with a track you already have**. Name it as the soundtrack and lay the cuts out against its tempo:

[Watch video](https://runware.ai/docs/assets/output-music.C-OhKvIa.mp4)

*Four shots cut to the beat of the reference track*

> **Prompt**: A 10-second product montage for the running sneaker in Image 1, scored with Audio 1 and cut to its beat. Four shots joined by hard cuts at 2.5, 5 and 7.5 seconds, each cut landing on a beat: a close-up of the laces, the sneaker turning on a white pedestal, a runner's foot in the sneaker striking wet pavement in slow motion, and the sneaker centered on the pedestal under a spotlight. Keep the shape and colors of the sneaker from Image 1. Clean studio light. Audio: Audio 1 as the soundtrack, a soft splash on the pavement shot, no voices.

**Image 1**:

![A white and lime-green knit running sneaker with a chunky foam sole on white](https://runware.ai/docs/assets/source-sneaker.BkwoooWJ_20PKmP.jpg)

> **Prompt**: A single white and lime-green running sneaker with a knit upper and a chunky foam sole, three-quarter view on a plain white background. Product packshot, soft even light, photoreal. No text, no logos.

**Audio 1**:

[Listen to audio](https://runware.ai/docs/assets/music-sneaker.Dn5ZQYgR.mp3)

> **Prompt**: An instrumental upbeat electronic track at exactly 120 beats per minute, with a punchy kick drum on every beat, crisp claps on the second and fourth beat, a driving synth bass and a bright lead melody. The groove starts immediately with no intro. No vocals.

**Time the cuts from the tempo.** At 120 beats per minute a beat falls every half second, so cuts at 2.5, 5 and 7.5 seconds each sit on one, and the clip cuts at 2.48, 4.96 and 7.52 seconds. A track with a steady, known tempo is what makes that arithmetic possible.

### [Tips](https://runware.ai/docs/models/sandai-magi-2/guides/video-and-audio-references#tips)

1. **Give every input one job.** Say what to take from each video, image and clip, and leave the details to the reference.
    
2. **Count each type separately.** `Video 1`, `Image 1` and `Audio 1` are each the first item of their own array.
    
3. **Trim references to what you borrow.** Each type has a 30-second budget across its clips.
    
4. **Use a plain subject for a camera reference.** An empty table and a box leave the move as the only thing worth copying.
    
5. **Quote a voice clip's words in the prompt.** The spoken line and the clip should be the same speech.
    
6. **Cut to the tempo of the track.** Work out where the beats fall and put the cut times on them.