ComfyUI > Nodes > ComfyUI > Batch Masks

ComfyUI Node: Batch Masks

Class Name

BatchMasksNode

Category
mask
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

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

Batch Masks Description

Efficiently combines and processes multiple masks into a single batch for uniform resizing and stacking.

Batch Masks:

The BatchMasksNode is designed to efficiently handle and process multiple mask inputs by combining them into a single batch. This node is particularly useful when you need to manage a collection of masks, ensuring they are uniformly resized and stacked together for further processing. By automating the resizing and batching process, the BatchMasksNode simplifies workflows that involve multiple mask manipulations, making it easier to apply consistent operations across all masks. This node is essential for tasks that require uniformity in mask dimensions, such as image processing pipelines where masks are used for segmentation or masking operations. Its primary goal is to streamline the handling of multiple masks, reducing manual effort and potential errors in resizing and alignment.

Batch Masks Input Parameters:

masks

The masks input parameter is a collection of mask inputs that you wish to batch together. This parameter accepts multiple mask inputs, with a minimum of 2 and a maximum of 50 masks. Each mask in the collection is automatically resized to match the dimensions of the first mask in the list, ensuring uniformity across the batch. This resizing is crucial for maintaining consistency in subsequent processing steps, as it aligns all masks to a common size. The masks parameter is essential for the node's execution, as it determines the set of masks that will be combined into a single batch output.

Batch Masks Output Parameters:

mask

The mask output parameter represents the batched collection of masks, combined into a single tensor. This output is crucial for further processing, as it provides a unified representation of all input masks, stacked along a new dimension. The batched mask output allows for efficient application of operations across all masks simultaneously, facilitating tasks such as segmentation, filtering, or analysis. By providing a single output tensor, the BatchMasksNode simplifies downstream processing and ensures that all masks are consistently aligned and ready for use in subsequent nodes or operations.

Batch Masks Usage Tips:

  • Ensure that all input masks are of compatible types and dimensions to avoid unexpected resizing issues. This will help maintain the quality and integrity of the masks during the batching process.
  • Use the BatchMasksNode when you have multiple masks that need to be processed together, such as in segmentation tasks, to streamline your workflow and reduce manual resizing efforts.

Batch Masks Common Errors and Solutions:

"Input masks list is empty"

  • Explanation: This error occurs when no masks are provided to the node, resulting in an empty input list.
  • Solution: Ensure that you provide at least two masks as input to the node to avoid this error.

"Incompatible mask dimensions"

  • Explanation: This error arises when the input masks have varying dimensions that cannot be automatically resized to match the first mask.
  • Solution: Verify that all input masks are of similar dimensions or can be resized to a common size. Adjust the input masks accordingly before using the node.

Batch Masks Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
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.

Batch Masks