> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-sync-comfy-api-v2-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CosmosImageToVideoLatent - ComfyUI Built-in Node Documentation

> The CosmosImageToVideoLatent node creates a video latent representation from input images.

The CosmosImageToVideoLatent node creates a video latent representation from input images. It builds a blank video latent with the requested width, height, and number of frames, then optionally encodes a start image into the beginning frames and/or an end image into the end frames. When images are provided, it also generates a noise mask so the encoded frames remain fixed during generation.

## Inputs

| Parameter     | Description                                                               | Data Type | Required | Range                            |
| ------------- | ------------------------------------------------------------------------- | --------- | -------- | -------------------------------- |
| `vae`         | The VAE model used to encode the images into the video latent space.      | VAE       | Yes      | -                                |
| `width`       | The width of the output video in pixels (default: 1280).                  | INT       | Yes      | 16 to MAX\_RESOLUTION (step: 16) |
| `height`      | The height of the output video in pixels (default: 704).                  | INT       | Yes      | 16 to MAX\_RESOLUTION (step: 16) |
| `length`      | The total number of frames in the video (default: 121).                   | INT       | Yes      | 1 to MAX\_RESOLUTION (step: 8)   |
| `batch_size`  | The number of video latents to generate (default: 1).                     | INT       | Yes      | 1 to 4096                        |
| `start_image` | Optional image or image sequence to encode at the beginning of the video. | IMAGE     | No       | -                                |
| `end_image`   | Optional image or image sequence to encode at the end of the video.       | IMAGE     | No       | -                                |

**Note:**

* When neither `start_image` nor `end_image` is provided, the node returns a blank latent without a noise mask.
* When `start_image` is provided, it is encoded into the first frames of the latent and those frames are marked with noise mask value 0 (preserved). When `end_image` is provided, it is encoded into the last frames and those frames are marked with noise mask value 0. The remaining frames keep a mask value of 1.
* The latent has 16 channels and its spatial dimensions are `height / 8` by `width / 8`. The number of latent frames is `((length - 1) // 8) + 1`.
* `batch_size` repeats the latent and, when present, the noise mask.

## Outputs

| Output Name | Description                                                                                                                                                                   | Data Type |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `latent`    | The generated video latent containing the optional encoded start and/or end images and, when images are provided, a matching noise mask with value 0 on the preserved frames. | 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/CosmosImageToVideoLatent/en.md)

***

**Source fingerprint (SHA-256):** `0b06ccfcb14c27c81eeebbbff519da1e187970d4cfc19c8796fc3da20688245c`
