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

Split Masks πŸŽ₯πŸ…₯πŸ…—πŸ…’(SplitMasks)

From a technical implementation perspective, this node receives a MASK-type tensor as input, which typically represents a sequence composed of multiple frame masks.

Split Masks

mask
MASK_A
A_count
MASK_B
B_count
split_index
INT
VideoHelperSuite

From a technical implementation perspective, the Split Masks πŸŽ₯πŸ…₯πŸ…—πŸ…’ node receives a Tensor of type MASK as input, which typically represents a sequence composed of multiple mask frames.

The Split Masks node is a tool for processing mask sequences. Its core function is to split an input mask sequence into two independent parts based on a specified index position. This operation is straightforward and facilitates the grouped management of consecutive mask frames.

Node Functionality

From a technical implementation perspective, this node receives a Tensor of type MASK as input, which typically represents a sequence composed of multiple mask frames. Internally, the node performs the split operation using an integer index split_index, dividing the original sequence at the specified index to generate two new mask sequences. The two output MASKs correspond to all frames before and after the split point, respectively, and the node also outputs the number of frames contained in each of these new sequences.

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

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
maskMASKYes--mask (Input Parameter): The input mask sequence, the original multi-frame mask data to be split.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
split_indexINTYes0BIGMIN - BIGMAX (Step: 1)split_index (Input Parameter): The index position for performing the split. The range has no specific limit, with a step size of 1. Frames before this index are assigned to the first group, and frames after (including) this index are assigned to the second group.

Output

Parameter NameData TypeDescription
MASK_AMASKMASK_A (Output Parameter): The first mask sequence obtained after the split.
A_countINTA_count (Output Parameter): The number of frames contained in the first mask sequence MASK_A.
MASK_BMASKMASK_B (Output Parameter): The second mask sequence obtained after the split.
B_countINTB_count (Output Parameter): The number of frames contained in the second mask sequence MASK_B.

Usage Scenarios

In practical workflows, this node is very useful when you need to process segments of a video's masks separately. For example, you might have a 100-frame object mask sequence where you want to apply one inpainting algorithm to the first 30 frames and another to the remaining 70 frames. In this case, you can use this node, setting split_index to 30, thereby splitting the mask sequence into two parts and feeding them into different subsequent processing branches.

Notes

When using this node, pay attention to the value of split_index to ensure it is within a valid range. If the index is 0, the first output sequence will be empty. If the index is equal to or greater than the total number of frames in the input sequence, the second output sequence will be empty.

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

Comments

Sign in with GitHub to join the discussion.

Loading comments…