Mask Batch Multi(MaskBatchMulti)
This node receives multiple inputs of type MASK and concatenates them along the batch dimension (dim=0).
Mask Batch Multi
Creates an image batch from multiple masks. You can set how many inputs the node has, with the inputcount and clicking update.
The Mask Batch Multi node receives multiple MASK-type inputs and concatenates them along the batch dimension (dim=0).
The Mask Batch Multi node is a tool for batch processing masks. Its core function is to combine multiple independent mask images into a single batch. This allows users to process multiple masks at once, facilitating subsequent batch image generation or editing operations.
Node Function
This node receives multiple MASK-type inputs and concatenates them along the batch dimension (dim=0). When the input masks have inconsistent dimensions, the node automatically resizes subsequent masks to match the dimensions of the first mask using bicubic interpolation, ensuring uniform data format within the batch. Users can dynamically define the number of masks to be concatenated via the inputcount parameter.
Node Parameter Description - Mask Batch Multi
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
mask_1 | MASK | Yes | - | - | The first mask to be concatenated, which serves as the reference for resizing subsequent masks. |
mask_2 | MASK | Yes | - | - | The second mask to be concatenated, which will be merged into the output batch. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
inputcount | INT | Yes | 2 | 2 - 1000 (Step: 1) | Sets the total number of masks to be merged, ranging from 2 to 1000 with a step of 1. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| masks | MASK | The output batch of concatenated masks. |
Usage Scenarios
This node is very useful in workflows where the same processing pipeline needs to be applied to multiple different images. For example, you can first use multiple "Mask Drawing" nodes to create different region selections, then use this node to merge them, and finally input them into nodes like "VAE Encode" or "Image Mask Composite" for batch operations, thereby efficiently handling a set of related image tasks.
Notes
Please note that this node requires at least two mask inputs to be connected. When there are many masks with significant size differences, automatic scaling may affect edge details. It is recommended to pre-unify the dimensions of the source masks whenever possible for optimal results.
Mask Batch Multi Node Source Code Link
The Mask Batch Multi node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.