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

Repeat Masks πŸŽ₯πŸ…₯πŸ…—πŸ…’(RepeatMasks)

From a technical implementation perspective, this node receives a mask in PyTorch tensor format and processes it via torch。

Repeat Masks

mask
MASK
count
multiply_by
INT
VideoHelperSuite

The Repeat Masks node is a tool for processing and expanding mask data. Its core function is to receive an input MASK and, based on a specified multiplier, repeat and concatenate it along the batch dimension, thereby generating a new mask sequence containing multiple identical copies of the original mask. This node primarily serves workflows that require batch or sequential processing of masks.

Node Functionality

From a technical implementation perspective, this node receives a mask in PyTorch tensor format and uses the torch.cat operation to repeat and concatenate it along dimension 0 (the batch dimension) a specified number of times. Both its input and output are of the standard ComfyUI MASK data type, ensuring compatibility with other nodes in the pipeline. The multiply_by parameter controls the number of repetitions, with a minimum value of 1 and a maximum value limited by the system-defined BIGMAX constant.

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

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
maskMASKYes--mask (input parameter): The original mask data to be repeated. Type is MASK.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
multiply_byINTYes11 - BIGMAX (Step: 1)multiply_by (input parameter): Specifies the number of times the mask needs to be repeated. Valid range is 1 to BIGMAX, with a step of 1.

Output

Parameter NameData TypeDescription
MASKMASKMASK (output parameter): Outputs the new mask sequence generated after repetition and concatenation.
countINTcount (output parameter): Outputs the total number of masks contained in the new mask sequence (i.e., the repetition count).

Usage Scenarios

This node is very useful in video generation or image batch processing workflows when you need to apply the same mask to a series of frames. For example, you can input a mask for foreground segmentation into this node, set multiply_by to the number of video frames, quickly generate a mask sequence applicable to all frames, and then feed it into subsequent video synthesis nodes.

Notes

Please note that this node only performs simple repetition and concatenation; it does not modify or interpolate the mask content itself. The output mask sequence is identical in content, only the batch size is increased. Setting the multiply_by parameter too high may lead to a significant increase in VRAM usage.

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

Comments

Sign in with GitHub to join the discussion.

Loading comments…