ComfyUI > Nodes > ComfyUI 1hewNodes > Mask Batch Split

ComfyUI Node: Mask Batch Split

Class Name

1hew_MaskBatchSplit

Category
1hewNodes/batch
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 Batch Split Description

Efficiently splits mask batches into two based on criteria, enabling independent data processing.

Mask Batch Split:

The 1hew_MaskBatchSplit node is designed to efficiently divide a batch of masks into two separate batches based on specified criteria. This node is particularly useful in scenarios where you need to process or analyze different segments of a dataset independently. By allowing you to specify how many masks to take from the start or end of the batch, it provides flexibility in handling data. The node operates asynchronously, ensuring that the splitting process is efficient and does not block other operations. This capability is essential for workflows that require dynamic data manipulation, enabling you to tailor the data processing pipeline to specific needs.

Mask Batch Split Input Parameters:

mask

The mask parameter is a tensor that represents the batch of masks you want to split. It is crucial as it forms the basis of the operation, determining the data that will be divided into two separate batches. The shape of this tensor influences the batch size and the subsequent operations performed by the node. There are no explicit minimum or maximum values for this parameter, but it should be a valid tensor with a batch dimension.

take_count

The take_count parameter specifies the number of masks to be included in the first batch. This parameter directly impacts how the batch is split, determining the size of the first output batch. If take_count is greater than or equal to the total batch size, the entire batch is returned as the first batch, with the second batch being empty. There are no explicit minimum or maximum values, but it should be a non-negative integer.

from_start

The from_start parameter is a boolean that determines the direction from which the masks are taken. If set to True, the node will take the specified number of masks from the start of the batch. If False, it will take them from the end. This parameter allows for flexible data manipulation, enabling you to choose which part of the batch to prioritize.

Mask Batch Split Output Parameters:

first_batch

The first_batch output is a tensor containing the masks that were selected based on the take_count and from_start parameters. This output is crucial for further processing or analysis, as it represents the subset of data you have chosen to focus on. The shape of this tensor will vary depending on the input parameters, but it will always be a subset of the original batch.

second_batch

The second_batch output is a tensor containing the remaining masks that were not included in the first_batch. This output is important for scenarios where you need to handle or analyze the leftover data separately. Like the first_batch, its shape will depend on the input parameters and the original batch size.

Mask Batch Split Usage Tips:

  • Use the take_count parameter to control the size of the first batch, ensuring it aligns with your data processing needs.
  • Set the from_start parameter based on whether you want to prioritize the beginning or the end of the batch, allowing for targeted data manipulation.

Mask Batch Split Common Errors and Solutions:

"[MaskBatchSplit] 错误: {str(e)}"

  • Explanation: This error message indicates that an exception occurred during the execution of the node. The {str(e)} part will be replaced with the specific error message.
  • Solution: Check the input parameters to ensure they are valid and correctly formatted. Verify that the mask tensor is properly defined and that take_count is a non-negative integer. If the error persists, review the stack trace for more details on the exception.

Mask Batch Split 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.

Mask Batch Split