Repeat Latents π₯π ₯π π ’
Repeat Latents
- latents
- LATENT
- count
Repeat Latents (class VHS_DuplicateLatents) appends copies of a latent batch onto itself so it repeats. Give it a batch and a multiply-by of 4, and you get that batch four times in a row. It's the latent-space twin of the Repeat Images node - same idea, applied to latents instead of decoded pixels.
Working in latent space matters when you want the repetition to happen before sampling or decoding, so the repeated frames go through the rest of the pipeline as latents rather than being copied after the fact.
Why you'd reach for it
The main uses are padding and holding. Padding: a downstream node needs a certain number of latent frames and you're short - repeat to reach the target length. Holding: you've got a single latent (or a short loop) that you want to persist across a longer sequence, so you multiply it up to the frame count you're targeting.
It's also a quick way to line latent counts up with an image or mask stack that's a whole-number multiple longer. When "these two things need to be the same length and one is exactly Nx the other," repeating the shorter one is the fix.
How it works
It concatenates the input latent onto itself multiply_by times along the batch (frame) axis. Output length is input length Γ multiplier, and the node reports that as a count output. Multiply-by of 1, the default, changes nothing - it's a pass-through.
Inputs and outputs
- latents (LATENT) - the batch to repeat.
- multiply_by (INT, default 1, minimum 1) - total number of copies. 1 = unchanged, 2 = doubled, and so on.
Outputs:
- LATENT - the repeated batch.
- count (INT) - the new length (input Γ
multiply_by).
Installing it
comfy.icu ships VideoHelperSuite in the image - nothing to install.
Locally: ComfyUI Manager β search ComfyUI-VideoHelperSuite β install β restart. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
then restart ComfyUI. Kosinkadink's suite - standard for AnimateDiff, Wan, and LTX pipelines.
Common issues
Same mental model as the image version: it repeats the entire batch end to end, not each frame in place. A 4-latent batch Γ 3 becomes the sequence 0,1,2,3,0,1,2,3,0,1,2,3 - three full cycles, twelve latents. If you wanted each latent held (0,0,0,1,1,1β¦), this isn't it.
And repeating latents multiplies real work downstream. Every repeated frame still gets sampled and decoded, so a big multiplier on a long clip costs proportional VRAM and time - this makes the sequence longer, it doesn't make it cheap.
If the node's missing from your menu, that's the whole pack failing to import (ffmpeg or a NumPy clash, typically). The ComfyUI startup log has the real error; reinstall through Manager to fix it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| latents | LATENT | β | |
| multiply_by | INT | 11β9007199254740991 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |
| count | INT | β |