Mask to Multiband
A single mask becomes a single channel
- mask
- multiband
Mask to Multiband is the smallest node in the pack and exactly as simple as it looks: a ComfyUI MASK in, a one-channel MULTIBAND_IMAGE out. In a pack built for segmentation masks, this is the primitive everything else assembles. You don't reach for it alone often - its real job is being the building block you wire into Compose Multiband, or the conversion you use before saving a single mask in a format the pack can reload.
Think of the workflow: SAM hands you a mask, you want to persist it as a .npz or .tiff alongside other channels, or you want to run it through the pack's channel operations. Every multiband node speaks MULTIBAND_IMAGE, so the mask has to be converted first. This is that conversion.
How it works
A MASK is (B, H, W) - three dimensions, no channel axis. The node adds the channel axis, giving (B, 1, H, W), and names the channel whatever you put in the channel_name widget. Default is mask, and that default is quietly important: the pack's Multiband to Masks node can auto-detect channels by looking for "mask" in the name. Name it something else and auto-detect won't find it. If you plan to pull this channel back out by name later, keep the default or include "mask" in whatever you type.
The inputs
- mask - required, any MASK tensor.
- channel_name - optional, default
mask. The label that travels with the channel through saves, loads, and name-based selection.
Output is a single multiband. Because it's one channel, it's the lightest possible member of the type - perfect for passing into Compose Multiband alongside an RGB image's three channels, where it slots in as the fourth.
Installing the pack
From ComfyUI-Multiband. ComfyUI Manager → search "ComfyUI-Multiband" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-Multiband.git
pip install -r ComfyUI-Multiband/requirements.txt
Same dependency story as the rest of the pack: numpy, torch, tifffile, no model downloads.
When to use the sibling instead
If you have a whole batch of masks and want each as its own channel, Batch to Multiband flattens the batch into channels in one step and names them mask_01, mask_02 - better than looping this node. If you have several different masks from different sources, Compose Multiband converts and stacks in place. Mask to Multiband is the one you use for a single mask when you want full control over its channel name, or when the mask is just one ingredient in a stack you're building by hand.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| channel_nameopt | STRING | mask | Name for the mask channel |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| multiband | MULTIBAND_IMAGE | — |