Nodes/ComfyUI-Voxels/Mask Batch To Mask List
ComfyUI Node

Mask Batch To Mask List

A tiny batch-splitter that exists because voxel videos are lists of frames

By DanielHabib·Created 2 years ago·Updated 2 years ago· 4
Mask Batch To Mask List
  • mask
  • MASK

Mask Batch To Mask List is the quiet utility node that most of this pack's graph actually depends on. It takes a batched MASK tensor and splits it into a list of individual masks. That's it. It does not sound exciting, and it isn't - but it's the piece that makes the "voxel video" idea work frame by frame.

Why it's in a voxel pack

Voxel videos are fundamentally sequential. The video maker (Voxel Blocks Into Voxel Video) expects its frames as a list of VOXEL_BLOCKs, and a natural way to build those frames is to process a batch of masks or images one at a time - mask 1 becomes block 1, mask 2 becomes block 2, and so on. But ComfyUI loves batches: decode a batch of latents or run a segmentation step and you get one batched tensor, not a list. This node is the adapter that un-splits the batch so each mask can feed its own frame of the voxel pipeline.

Under the hood it's four lines: slice mask[i:i+1, ...] for each index in the batch and return the slices as a list with OUTPUT_IS_LIST = True. Its sibling Image Batch To Image List (same file, same idea for IMAGE) covers the image side of that same workflow.

Inputs and outputs

  • mask (MASK) - a batched mask tensor, e.g. with shape [B, H, W]. This is the only input.
  • Output: MASK as a list - one entry per frame.

There's nothing to configure, which is the good kind of utility node.

The one thing to keep in mind

It doesn't check whether your input is actually batched. A single [1, H, W] mask just comes back as a one-item list, which is harmless - but if you feed it a stack of 8 masks and only wire one output up, you've silently dropped 7 frames. Also, since the whole point is feeding per-frame processing, the natural next step is converting each mask into a voxel block; this pack doesn't ship that specific node, so you'll typically route each list item through whatever image→block step your graph uses before collecting them back into the video maker.

Installing it

It ships inside ComfyUI-Voxels, so install the pack once and it's there:

# ComfyUI Manager: search "ComfyUI-Voxels", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DanielHabib/ComfyUI-Voxels
# restart ComfyUI

No extra dependencies beyond numpy, no gotchas beyond "it's in a 3D pack but it's really a general batch utility." And yes, it works fine in non-voxel graphs too - if you ever need a batched mask split into a list for any other reason, this node does the job. It's thin, unmaintained (the pack's last commit is September 2024), and entirely serviceable.

CategoryVoxel/Util

Inputs (1)

NameTypeDefaultDescription
maskMASK

Outputs (1)

NameTypeDescription
MASKMASK