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

Split Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’(SplitLatents)

From a technical implementation perspective, this node receives a standard `LATENT` dictionary input, which typically contains key tensors such as `samples`.

Split Latents

latents
LATENT_A
A_count
LATENT_B
B_count
split_index
INT
VideoHelperSuite

From a technical implementation perspective, the Split Latents πŸŽ₯πŸ…₯πŸ…—πŸ…’ node receives a standard LATENT dictionary input, which typically contains key tensors such as samples.

The Split Latents node is a tool for processing latent space data. Its core function is to split a latent tensor containing multiple frames into two independent parts at a specified index position. This node receives a batch of latents and, based on the user-defined split point, divides it into a front part and a back part, while also outputting the number of frames contained in each part. This facilitates subsequent differentiated processing of different segments of video or sequential images.

Node Functionality

From a technical implementation perspective, this node receives a standard LATENT dictionary input, which typically contains key tensors such as samples. The node duplicates the input data and iterates through all tensors in the dictionary that have the same dimension as the main tensor, performing a slicing operation at the specified split_index. Ultimately, it generates two LATENT dictionaries with identical structures but split content, and calculates and returns the number of samples contained in each. The entire process maintains the structural integrity of the original data.

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

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
latentsLATENTYes--latents (Input Parameter): The latent representation data containing multiple frames, which is the original input to be split.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
split_indexINTYes0BIGMIN - BIGMAX (Step: 1)split_index (Input Parameter): Specifies the frame index (starting from 0) for the split position. The range is from BIGMIN to BIGMAX, with a step size of 1.

Output

Parameter NameData TypeDescription
LATENT_ALATENTLATENT_A (Output Parameter): The first half of the latent data obtained after splitting.
A_countINTA_count (Output Parameter): The number of frames contained in LATENT_A.
LATENT_BLATENTLATENT_B (Output Parameter): The second half of the latent data obtained after splitting.
B_countINTB_count (Output Parameter): The number of frames contained in LATENT_B.

Usage Scenarios

This node is highly practical in video generation or editing workflows. For example, after generating a latent representation of an animation containing 30 frames, you can use this node to split out the first 10 frames (set split_index to 10) for separate stylization or inpainting operations, while applying a different set of parameters to the remaining 20 frames. This enables smooth transitions or style switches between video segments. It is often used in conjunction with nodes for conditioning, resampling, etc.

Notes

When using this node, note that the value of split_index should be within the valid range (from BIGMIN to BIGMAX), and the split operation is performed based on frame indices. If split_index is 0, the first output group will be empty; if it equals the total number of frames, the second output group will be empty.

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

Comments

Sign in with GitHub to join the discussion.

Loading comments…