ComfyUI > Nodes > ComfyUI-YCNodes > Mask Repeat Batch

ComfyUI Node: Mask Repeat Batch

Class Name

MaskRepeatBatch

Category
YCNode/Mask/Batch
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI-YCNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-YCNodes 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 Batch Description

Efficiently duplicates masks for consistent AI art projects using PyTorch tensor operations.

Mask Repeat Batch:

The MaskRepeatBatch node is designed to efficiently duplicate a given set of masks a specified number of times. This node is particularly useful when you need to apply the same mask across multiple instances or layers in your AI art projects. By repeating the masks, you can ensure consistency and uniformity in your designs, which is essential for creating cohesive visual effects. The node leverages the power of PyTorch to handle the tensor operations, ensuring that the process is both fast and memory-efficient. This capability is crucial for artists working with large datasets or complex compositions, as it allows for seamless integration and manipulation of mask data without the need for manual duplication.

Mask Repeat Batch Input Parameters:

masks

The masks parameter is the primary input for the node, representing the set of masks you wish to duplicate. It is expected to be in the form of a tensor, which is a multi-dimensional array commonly used in machine learning and AI applications. The shape of this tensor should be compatible with the operations performed by the node, and if it is a 2D tensor, it will be automatically adjusted to a 3D tensor by adding an additional dimension. This parameter is crucial as it forms the basis of the duplication process, and any changes to the masks will directly affect the output.

amount

The amount parameter determines how many times the input masks will be repeated. It is an integer value with a default setting of 1, meaning that the masks will be duplicated once by default. The minimum value for this parameter is 1, and the maximum is 64, providing flexibility in how extensively you wish to repeat the masks. Adjusting this parameter allows you to control the scale of repetition, which can be particularly useful for creating patterns or ensuring that a specific mask is applied consistently across multiple elements in your artwork.

Mask Repeat Batch Output Parameters:

repeated_masks

The repeated_masks output is the result of the duplication process, providing you with a new set of masks that have been repeated according to the specified amount. This output is a tensor that maintains the original structure of the input masks but extends it by the specified repetition factor. The repeated_masks are essential for further processing or integration into your AI art projects, as they allow you to apply consistent masking effects across different layers or components without manually duplicating the masks.

Mask Repeat Batch Usage Tips:

  • To ensure optimal performance, make sure that the input masks are correctly shaped as a 3D tensor. If your masks are initially 2D, the node will automatically adjust them, but starting with the correct shape can save processing time.
  • Experiment with the amount parameter to achieve different visual effects. For instance, repeating masks multiple times can create interesting patterns or textures in your artwork.

Mask Repeat Batch Common Errors and Solutions:

"RuntimeError: The expanded size of the tensor must match the existing size at non-singleton dimension"

  • Explanation: This error occurs when the input masks tensor does not have the correct dimensions for the repeat operation.
  • Solution: Ensure that your input masks are in the correct shape. If they are 2D, the node will automatically adjust them to 3D, but you should verify that the initial dimensions are appropriate for your intended use.

"ValueError: amount must be between 1 and 64"

  • Explanation: This error is raised when the amount parameter is set outside the allowed range.
  • Solution: Adjust the amount parameter to be within the range of 1 to 64. This ensures that the node can process the repetition without exceeding its operational limits.

Mask Repeat Batch Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.