> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-partner-nodes-consolidate.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CosmosPredict2ImageToVideoLatent - ComfyUI Built-in Node Documentation

> CosmosPredict2ImageToVideoLatent creates video latent representations from images for video generation.

CosmosPredict2ImageToVideoLatent creates video latent representations from images for video generation. It can generate a blank video latent or incorporate start and end images to create video sequences with specified dimensions and duration. The node handles the encoding of images into the appropriate latent space format for video processing.

## Inputs

| Parameter     | Description                                                                      | Data Type | Required | Range                 |
| ------------- | -------------------------------------------------------------------------------- | --------- | -------- | --------------------- |
| `vae`         | The VAE model used for encoding images into latent space                         | VAE       | Yes      | -                     |
| `width`       | The width of the output video in pixels (default: 848, must be divisible by 16)  | INT       | Yes      | 16 to MAX\_RESOLUTION |
| `height`      | The height of the output video in pixels (default: 480, must be divisible by 16) | INT       | Yes      | 16 to MAX\_RESOLUTION |
| `length`      | The number of frames in the video sequence (default: 93, step: 4)                | INT       | Yes      | 1 to MAX\_RESOLUTION  |
| `batch_size`  | The number of video sequences to generate (default: 1)                           | INT       | Yes      | 1 to 4096             |
| `start_image` | Optional starting image for the video sequence                                   | IMAGE     | No       | -                     |
| `end_image`   | Optional ending image for the video sequence                                     | IMAGE     | No       | -                     |

**Note:** When neither `start_image` nor `end_image` are provided, the node generates a blank video latent. When one or both images are provided, they are resized to `width` and `height`, encoded into latent space, and positioned at the beginning and/or end of the video sequence, with the corresponding regions marked in the noise mask so they are preserved during generation. The resulting latent and mask are repeated `batch_size` times.

## Outputs

| Output Name  | Description                                                                                                                                                    | Data Type |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `samples`    | The generated video latent representation containing the encoded video sequence                                                                                | LATENT    |
| `noise_mask` | A mask indicating which parts of the latent should be preserved during generation. Only present when at least one of `start_image` or `end_image` is provided. | LATENT    |

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

***

**Source fingerprint (SHA-256):** `842bd2b8cda438e7b938439d4eba280478939e3302dc1846d52595d40082ff05`
