ComfyUI > Nodes > ComfyUI 1hewNodes > Mask Repeat

ComfyUI Node: Mask Repeat

Class Name

1hew_MaskRepeat

Category
1hewNodes/mask
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI 1hewNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 1hewNodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Mask Repeat Description

Efficiently duplicates and inverts masks for batch processing or animation sequences.

Mask Repeat:

The 1hew_MaskRepeat node is designed to efficiently duplicate a given mask multiple times, which can be particularly useful in scenarios where you need to apply the same mask across multiple instances or frames. This node allows you to control the repetition of a mask tensor, providing flexibility in how masks are applied in batch processing or animation sequences. Additionally, it offers an option to invert the mask, which can be beneficial for tasks that require the opposite of the original mask. By leveraging this node, you can streamline workflows that involve repetitive mask applications, ensuring consistency and saving time in manual adjustments.

Mask Repeat Input Parameters:

mask

The mask parameter is a tensor that represents the mask you wish to repeat. It is the primary input for this node and should be a 2D or 3D tensor. If the mask is 2D, it will be automatically expanded to 3D to facilitate repetition. This parameter is crucial as it defines the pattern or area that will be duplicated across multiple instances.

invert

The invert parameter is a boolean option that determines whether the mask should be inverted before repetition. By default, this is set to False, meaning the mask will be used as is. If set to True, the mask values will be inverted (i.e., 1 becomes 0 and vice versa), which can be useful for tasks that require the inverse of the original mask pattern.

count

The count parameter specifies the number of times the mask should be repeated. It accepts integer values ranging from 1 to 4096, with a default value of 1. This parameter directly impacts the number of duplicated masks produced, allowing you to control the extent of repetition based on your specific needs.

Mask Repeat Output Parameters:

mask

The output mask is a tensor that contains the repeated instances of the input mask. The shape of this output tensor will be adjusted to accommodate the specified count, effectively stacking the repeated masks into a single tensor. This output is essential for further processing or application in tasks that require multiple instances of the same mask.

Mask Repeat Usage Tips:

  • To create a batch of identical masks for processing multiple frames or instances, set the count parameter to the desired number of repetitions.
  • Use the invert parameter to quickly generate the inverse of a mask, which can be useful for tasks that require both the original and inverted masks.

Mask Repeat Common Errors and Solutions:

Mask dimension mismatch

  • Explanation: This error occurs if the input mask does not have the expected dimensions (2D or 3D).
  • Solution: Ensure that the input mask is either a 2D or 3D tensor. If it is 2D, the node will automatically adjust it to 3D.

Invalid count value

  • Explanation: This error arises when the count parameter is set outside the allowed range of 1 to 4096.
  • Solution: Verify that the count parameter is within the valid range and adjust it accordingly.

Mask Repeat Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.