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
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 Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
mask | MASK | Yes | - | - | mask (Input Parameter): The input mask sequence, the original multi-frame mask data to be split. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
split_index | INT | Yes | 0 | BIGMIN - 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 Name | Data Type | Description |
|---|---|---|
| MASK_A | MASK | MASK_A (Output Parameter): The first mask sequence obtained after the split. |
| A_count | INT | A_count (Output Parameter): The number of frames contained in the first mask sequence MASK_A. |
| MASK_B | MASK | MASK_B (Output Parameter): The second mask sequence obtained after the split. |
| B_count | INT | B_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.
Split Masks π₯π ₯π π ’ Node Source Code Link
The Split Masks π₯π ₯π π ’ node is from the ComfyUI-VideoHelperSuite node package.
Comments
Sign in with GitHub to join the discussion.