create_mask_batch
Stacking a variable number of masks into one batch
- MASK
The mask equivalent of create_image_batch and create_any_batch: an empty static schema, a dynamic "+"-driven set of inputs, and a single batched output - here, MASK instead of IMAGE or a generic list.
What it is and why you'd reach for it
This sits in ComfyUI-Apt_Preset's data utilities. No required or optional fields are declared in the fixed schema - just the MASK output - which is the same variable-input pattern the pack uses for its other batch builders: you add exactly as many input slots as you need through the node's own UI, rather than being locked into a fixed count. Reach for this whenever you've generated or extracted several separate masks across your graph - say, a few region masks from Coordinate_create_mask, a shape mask from create_mask_solo, one pulled from a detector - and need them combined into a single MASK batch for a downstream node that expects a batch rather than individual masks.
How it works
Since there's nothing statically declared, add input slots on the node itself (look for a "+" control on the node body) and wire a mask into each one. Whatever you connect gets stacked, in the order added, into the batch output.
Inputs and outputs that matter
No required or optional fields exist in the fixed schema for this node - it's entirely dynamic on the input side. The documented output:
MASK- the batched collection of every mask you wired in.
There's nothing to name in advance on the input side; what you add through the node's UI is the input list.
Installing it
Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
Run install.bat on Windows for dependencies; on Linux/Mac install the requirements yourself, since no bundled script covers those platforms. No model downloads needed - this is tensor stacking, nothing to fetch.
Common issues
Like any manual batch node, every mask you feed in needs matching dimensions for the stack to succeed - a batch requires uniform shape across all entries, so if this node errors, mismatched mask sizes coming from different upstream sources (say, one built at 512×512 and another matched to a different image's resolution) is the first thing to check.
If you don't see anywhere to add an input when you first drop the node in, look for a small control directly on the node body - dynamic-input nodes in this pack genuinely start with zero slots until you add them, that's not a bug.
As with the rest of ComfyUI-Apt_Preset: it's a large, actively-updated pack, and at least one user has reported an IMPORT FAILED error at ComfyUI startup after installing it. Check the console log for the actual missing-dependency error if this node - or anything else from the pack - doesn't show up after install.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |