> ## 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.

# ReplaceVideoLatentFrames - ComfyUI Built-in Node Documentation

> ReplaceVideoLatentFrames replaces a range of frames in a destination latent video with frames from a source latent video, starting at a specified frame index.

ReplaceVideoLatentFrames replaces a range of frames in a destination latent video with frames from a source latent video, starting at a specified frame index. If no source latent is provided, the destination latent is returned unchanged. The node supports negative indexes and logs a warning when the source frames do not fit within the destination.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `destination` | The destination latent where frames will be replaced. | LATENT | Yes | - |
| `source` | The source latent providing frames to insert into the destination latent. If not provided, the destination latent is returned unchanged. | LATENT | No | - |
| `index` | The starting latent frame index in the destination latent where the source latent frames will be placed. Negative values count from the end (default: 0; step: 1). | INT | Yes | -MAX\_RESOLUTION to MAX\_RESOLUTION |

**Constraints:**

* A negative `index` is adjusted by adding it to the destination frame count, so it counts backward from the end of the destination latent.
* If `index` points beyond the destination frame count, or if the source frames do not fit within the destination starting at `index`, a warning is logged and the destination latent is returned unchanged.

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `output` | The resulting latent video after the frame replacement operation. If the replacement cannot be performed, the destination latent is returned unchanged. | 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/ReplaceVideoLatentFrames/en.md)

***

**Source fingerprint (SHA-256):** `5b98d875bdeaec63521bff19fecbc5510036c8b4f90322d8296b216688b557bf`


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