Maskbatch to List
Split one mask batch into individual masks
- masks
- MASK
Maskbatch to List takes a batch of masks - one tensor with several masks stacked along the batch dimension - and splits it into a list of individual masks, each one on its own. It's the opposite of its sibling, Masklist to Batch, and together they're the answer to a mismatch that shows up constantly in ComfyUI: some nodes are batch-native, and some only know how to handle a single mask at a time.
The classic scenario is per-mask processing. A segmentation node or a SAM-based detector hands you a batch of masks - say, one per detected object in an image. Now you want to do something per mask: crop each to its bounding box, blur each differently, composite each onto its own canvas, run each through a different strength. Most of those operations expect a single mask. Feed them the whole batch and you get weird multi-frame results or a type error; split it first with this node and each mask can go through the pipeline as its own thing.
It's also the natural partner for the loop-style workflows that ComfyUI power users build: split the batch, iterate over the list, do the per-item work, then recombine with the pack's Masklist to Batch. The round trip is a common pattern, and having both converters in one pack is why people reach for RvTools here instead of hand-rolling the conversion.
Inputs and outputs
- masks (MASK, required) - the batched input.
- Output MASK - and here's the detail that matters: the output is a list. The node is marked
OUTPUT_IS_LIST, so the single MASK output port actually carries N masks, one per item. Downstream nodes that accept lists will light up accordingly.
There's also a defensive default in the code: if you feed it nothing, it hands back a single empty 64×64 mask rather than erroring, so the workflow degrades gracefully instead of dying.
Installing it
Comes with ComfyUI-RvTools_v2:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
Restart ComfyUI or install via ComfyUI Manager (search "RvTools"). No model downloads. Dependencies are the usual torch/numpy/Pillow plus opencv-python, pilgram, pynvml, piexif.
Gotchas
README: pack is no longer maintained, superseded by ComfyUI_Eclipse (same author) - v2 nodes still work fine.
One honest caveat: "list" here is a ComfyUI-internal list, not a python list you can poke at. It means the output port can be consumed by nodes that accept lists (the pack's Masklist to Batch is the obvious one). If a downstream node doesn't accept list inputs, you'll get a connection error - that's usually the signal that you should be recombining before that node, not after.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |