> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# MAGI-2 Reference to Video - ComfyUI Built-in Node Documentation

> Generates a video from a text prompt and reference images, videos, or audio with the MAGI-2 model.

Generates a video from a text prompt and reference images, videos, or audio with the MAGI-2 model. Reference media keeps characters, locations, camera moves, or voices consistent, and is referred to in the prompt as @Image1, @Video1, and @Audio1. The node uploads the references, submits the request to the MAGI API, and returns a 1080p video of 4 to 30 seconds with native audio when `generate_audio` is enabled. At least one reference input is required.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `prompt` | Text description of the video. Refer to the connected references as @Image1, @Video1, and @Audio1, numbered per type in input order; every image of a batch counts. Must contain at least one non-whitespace character. Default: empty. | STRING | Yes | Multiline text, up to 15,000 characters |
| `reference_images` | Growable slot: connect up to 10 reference images. Each slot holds one image, and every image of a batch counts toward the limit. | IMAGE | No | 0 to 10 images |
| `reference_videos` | Growable slot: connect up to 5 reference videos. Clips longer than 30 s are trimmed to their first 30 s, and each type is trimmed to 30 s in total; each video must be at least 2 s long. | VIDEO | No | 0 to 5 videos |
| `reference_audios` | Growable slot: connect up to 5 reference audio clips. Clips longer than 30 s are trimmed to their first 30 s, and each type is trimmed to 30 s in total; audio shorter than 2 s is padded with silence. | AUDIO | No | 0 to 5 audio clips |
| `duration` | Length of the output video in seconds. Default: 5. | INT | Yes | 4 to 30 seconds (step 1) |
| `aspect_ratio` | Aspect ratio of the output video. Default: 16:9. | COMBO | Yes | "16:9" "9:16" "1:1" "4:3" "3:4" "21:9" |
| `resolution` | Resolution of the output video. | COMBO | Yes | "1080p" |
| `generate_audio` | Whether the output video contains a native audio track. Default: true. | BOOLEAN | Yes | true false |
| `seed` | Seed used for generation. Changing the seed re-runs the node; MAGI-2 results vary even with the same seed. Default: 42. | INT | Yes | 0 to 4294967295 |

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `video` | The generated video file. Includes an audio track when `generate_audio` is enabled. | VIDEO |

**Constraints:**

* Connect at least one reference image, video, or audio input; the node fails when all three reference slots are empty.
* The prompt is required; an empty or whitespace-only prompt is rejected.
* At most 10 reference images in total, counting every image of every batch.
* Each reference video must be at least 2 s long. Clips longer than 30 s are trimmed to their first 30 s, and the total duration of each reference type is capped at 30 s. When references are trimmed, they are taken from the start of the clip.
* Reference audio shorter than 2 s is padded with silence. Reference videos larger than 200 MB are downscaled before upload to a 1920×1080 pixel budget (2,073,600 pixels) with the aspect ratio preserved.

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/Magi2ReferenceToVideoApi/en.md)

***

**Source fingerprint (SHA-256):** `b9bb733691c459cca647b8ffdbe089481a2be5f4ff33610ad4327f61fea98d7f`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.