🧩 Mask Batch Unpack (List)
The mask version of the unpack node you already need
- masks
- MASK
If you've read this pack's image unpacker, you already know this node - it's the same trick, one dimension down. MaskBatchUnpackDynamic takes a mask batch shaped [B, H, W] and splits it into a list of individual masks, each [1, H, W]. Masks are the quiet workhorses of ComfyUI: everything from inpainting to ControlNet conditioning to Impact Pack's segmented detection runs on them, and they batch up exactly like images do. Which means they hit the same wall - a batch of masks when you wanted each mask on its own.
What it does
One input, masks (MASK). One output, a LIST[MASK] where every item is a single mask with its original spatial size preserved. Any batch size, no slot limit - the "Dynamic" in the name is the whole point, same as the image version.
The mechanism matches its image sibling down to the details: it sets INPUT_IS_LIST, so it accepts either a plain [B, H, W] mask batch or a list of masks from a list-emitting node, and it flattens both into individual items. Nothing is resized or padded along the way. Different masks of different dimensions come out exactly as they went in.
When you'd actually use it
The pattern is identical to the image case, just for masks:
- Per-mask inpainting. A segmentation pass hands you N region masks; you want to run an inpaint pass on each region individually. Unpack first, then feed each mask to its own inpainting branch instead of fighting the whole batch at once.
- Mask → image conversion. Individual masks convert cleanly to images (via the mask-to-image nodes) when you need to inspect, save, or composite each one separately.
- Mixed-size masks. When detection produces masks of different dimensions - the normal state of the real world - the no-padding behavior keeps every mask usable downstream instead of silently aligning them.
This is the mask counterpart to the pack's flagship node, and it fills the same gap: ComfyUI core doesn't hand you a native "unpack this mask batch into a list" node, so the moment you need per-mask handling, this is the bridge.
Install
Zero friction, like the rest of the family:
cd ComfyUI/custom_nodes
git clone https://github.com/xuxiao305/ComfyUI-ImageBatchUtils
restart ComfyUI and the node shows up under mask/batch. Or open ComfyUI Manager, search ComfyUI-ImageBatchUtils, and let it install all six nodes together. No model files, no requirements.txt - genuinely nothing beyond ComfyUI itself, which is the rare case in the custom node ecosystem and the reason the install never surprises you.
Gotchas
One reminder worth repeating from the image version: the output is a list, so whatever you connect next must accept LIST[MASK]. If you get a type mismatch, that's the downstream node refusing a list, not this node failing. And when you unpack a batch of masks, remember each one is still tied to the image it came from only by position - keep the ordering straight, because the node won't track provenance for you.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |