Video Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/latentgenerated

Repeat Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’(RepeatLatents)

From a technical implementation perspective, this node receives a standard LATENT dictionary input, which contains tensor key-value pairs such as `samples`.

Repeat Latents

latents
LATENT
count
multiply_by
INT
VideoHelperSuite

The Repeat Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’ node, from a technical implementation perspective, receives a standard LATENT dictionary input containing tensor key-values such as samples.

The Repeat Latents node is a tool for duplicating and extending latent space data. Its core function is to receive a set of latent representations and repeat/concatenate their content by a specified multiplier, thereby generating a longer sequence. This operation primarily serves workflows that require batch or sequential processing of latent data.

Node Functionality

From a technical implementation perspective, this node receives a standard LATENT dictionary input containing tensor key-values such as samples. It iterates through all one-dimensional tensors in the dictionary that match the length of the primary sample and repeats/concatenates these tensors along dimension 0 (the batch dimension). Finally, it outputs a new, length-extended LATENT dictionary and simultaneously returns the total count of the concatenated tensors (i.e., the new batch size).

Node Parameter Description - Repeat Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
latentsLATENTYes--: The input latent representation data to be repeated. Type is LATENT dictionary.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
multiply_byINTYes11 - BIGMAX (Step: 1): Specifies how many times to repeat the input data. Value range is 1 to a very large number, with a step of 1.

Output

Parameter NameData TypeDescription
LATENTLATENT: The output new latent representation data after repetition and concatenation.
countINT: The total number of samples (batch size) in the new latent data.

Usage Scenarios

This node is very useful in workflows for video generation or batch image processing. For example, when you have a latent representation of a single frame image generated by a VAE encoder but need to generate a static video composed of multiple frames of identical content, you can use this node to repeat that latent representation multiple times. Then, pass the output to a subsequent sampler for batch decoding, thereby efficiently generating the sequence.

Notes

Please note that this node only performs the repeat operation on one-dimensional tensors within the LATENT dictionary that match the length of the primary sample. The multiply_by parameter must be an integer greater than or equal to 1. Excessively large repetition multipliers may lead to insufficient GPU memory.

The Repeat Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’ node is from the ComfyUI-VideoHelperSuite node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…