Nodes/MultiBand/Decompose Multiband
ComfyUI Node

Decompose Multiband

Split a multiband back into individual masks

By PozzettiAndrea·Created 9 months ago·Updated 22 days ago· 5
Decompose Multiband
  • multiband
  • all_masks
  • channel_0
  • channel_1
  • channel_2
  • channel_3
  • channel_4
  • channel_5
  • channel_6
  • channel_7
  • channel_names

Decompose Multiband is Compose Multiband's mirror. Compose builds one multi-channel object out of loose masks; this node takes a MULTIBAND_IMAGE and splits it back into the individual channel masks, so you can feed them to ordinary ComfyUI nodes that only understand MASK. Load a saved .npz, decompose it, and you're back in normal land - every channel its own wire.

It's the node that makes the pack safe to commit to. Because it exists, you can happily round-trip through multiband (compose → save → load → decompose) without painting yourself into a corner where only this pack's nodes can touch your data. The exit ramp is always there.

How it works

The multiband's (B, C, H, W) samples get split per channel. Two families of output:

  • all_masks - every channel as one batched MASK tensor. If the multiband has batch 1, you get (C, H, W); otherwise (B*C, H, W), i.e. all channels of all batches flattened into one mask batch.
  • channel_0 through channel_7 - the first eight channels as individual MASK outputs. Channels 9+ have no socket.

That last sentence is the gotcha, and it's the reason this node needs a second look. Only eight named channel outputs exist. Load a 30-channel spectral file and channels 8–29 only appear inside all_masks. Fine if you want the whole batch and pick apart downstream with Multiband to Masks or Select Multiband Channels; a surprise if you assumed every channel gets its own wire.

There's also a channel_names output - a comma-separated string of the channel names, handy if you want to display them or feed them to a text node.

The inputs

Just one, required:

  • multiband - any MULTIBAND_IMAGE, straight out of a loader, Compose Multiband, or Select Multiband Channels.

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

numpy, torch, and tifffile - that's the whole dependency list, no weights to download.

Where people get burned

The eight-channel cap, mostly. If your stack is small - the common segmentation case is a handful of masks - it never bites. The other thing to remember: the individual channel_N outputs are empty (all-zero) masks for channels that don't exist, so don't wire channel_7 blind on a 3-channel multiband and wonder where your data went. It went to all_masks. For anything over eight channels, prefer Multiband to Masks with an explicit channel list or its auto-detect-by-name mode - it handles arbitrarily many channels cleanly.

Categorymultiband/compose

Inputs (1)

NameTypeDefaultDescription
multibandMULTIBAND_IMAGE

Outputs (10)

NameTypeDescription
all_masksMASK
channel_0MASK
channel_1MASK
channel_2MASK
channel_3MASK
channel_4MASK
channel_5MASK
channel_6MASK
channel_7MASK
channel_namesSTRING