> ## 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 Image to Video - ComfyUI Built-in Node Documentation

> Animates a first frame, or moves from a first frame to a last frame, with the MAGI-2 model.

Animates a first frame, or moves from a first frame to a last frame, with the MAGI-2 model. The node uploads the frames, submits the prompt and settings to the MAGI API, and returns a 1080p video of 4 to 30 seconds with native audio when `generate_audio` is enabled. The result varies between runs even when the seed is unchanged.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `first_frame` | Image used as the first frame of the video. | IMAGE | Yes | - |
| `prompt` | Text description of the motion and content of the video. Must contain at least one non-whitespace character. Default: empty. | STRING | Yes | Multiline text, up to 15,000 characters |
| `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. With "auto", the ratio closest to the first frame is used and MAGI-2 stretches the frames to that ratio. Default: auto. | COMBO | Yes | "auto" "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 |
| `last_frame` | Image used as the last frame of the video. Leave it unconnected to generate from the first frame only. | IMAGE | No | - |

## Outputs

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

**Constraints:**

* The prompt is required; an empty or whitespace-only prompt is rejected.
* `duration` accepts whole seconds only, from 4 to 30.
* With `aspect_ratio` set to "auto", the frames are stretched to the ratio that is closest to the first frame.

> 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/Magi2ImageToVideoApi/en.md)

***

**Source fingerprint (SHA-256):** `249b7ddca0219f1ecb2fcab23d54926b0c2ba1b1e6b315b2c3043b3de8d23da6`


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