Masklist to Batch
The friendly rejoiner that fixes your sizes for you
- mask
- MASK
Masklist to Batch is the sibling of the pack's Maskbatch to List, and it does the exact reverse: it takes a list of separate masks and stacks them back into a single batched mask tensor. It's the node you reach for at the end of any "process each mask individually" workflow, when you've split a batch, done per-mask work, and now need everything back in one tensor so a batch-native node (like a batch-aware sampler or a save operation) can consume it.
The pair exists because ComfyUI's mask ecosystem is genuinely split down the middle. Some nodes only handle one mask at a time; others only handle a batch. You live in one world or the other depending on what you're plugging together, and these two converters are the bridge. The full round trip - Maskbatch to List, process each mask, Masklist to Batch - is the standard rhythm for per-object edits on multi-mask outputs from segmentation tools.
The interesting bit: it fixes mismatched sizes
This is where the node stops being boring. When the masks in your list aren't all the same resolution, most naive joiners would just crash or silently mangle the data. This one takes the first mask's size as the reference and upscales every later mask to match it (Lanczos, center-cropped) before stacking. So you can throw a 512×512 mask and a 768×768 mask into the same list and get a uniform batch out the other end without doing manual resizing.
That convenience is also the trap, so keep it in mind: the first mask in the list silently dictates the output resolution. If your first item happens to be a tiny mask, everything gets upscaled to that small size and you've just ruined the detail in the rest. If you care about output resolution, sort your list so the mask with the dimensions you actually want comes first.
Inputs and outputs
- mask (MASK, required) - accepts a list of masks (the node is marked
INPUT_IS_LIST). The single port is a list input, so it connects to list-producing outputs like the pack's Maskbatch to List. - Output MASK - the stacked batch, all at the first mask's size.
There's a graceful default too: feed it nothing and it returns an empty 64×64 batch rather than crashing.
Installing it
Part of 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 standard stack plus opencv-python, pilgram, pynvml, piexif.
Gotchas
The pack README marks it no longer maintained, pointing to ComfyUI_Eclipse (same author) as the successor. Still works fine.
Watch the ordering point above - first mask sets the size. And remember this node's list input only connects to list-capable outputs; if you're feeding a single mask and the connection won't take, you don't need a converter at all, you just have a type mismatch elsewhere in the graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |