Nodes/comfyui_bmad_nodes/FromListGetMasks
ComfyUI Node Runs on cloud

FromListGetMasks

Split a mask list back into individual sockets — FromListGetMasks

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
FromListGetMasks
  • list
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK
  • MASK

FromListGetMasks is the "unpack everything" end of Bmad's list plumbing. A MASK list goes in and each mask comes out its own output socket, so you can route five (or ten, or sixteen) masks to different places without a single switch node. It's the opposite of ToMaskList, which gathers individual masks into a list - and in a mask-heavy workflow you'll often use both, gathering at one end and splitting at the other.

Why bother? Because some nodes want a single mask and some want a whole list, and ComfyUI's wiring won't let you cross that boundary. When a preprocessing chain or a batch produces a pile of masks, FromListGetMasks fans them back out so each can get its own treatment - one goes to a conditioning set area, another into a composite, another to a save node. It's clean graph design instead of a tangle of Index helper nodes.

How it works

Under the hood it's the UnMakeListMeta metaclass, shared by every FromListGetX node in the pack. It declares INPUT_IS_LIST, so ComfyUI delivers the whole list as one value, and the "unpack" is literally:

def get_all(self, list):
    return tuple(list)

The node is declared with 32 output slots, but here's the part that trips people up: on the canvas it starts with zero visible outputs. The pack ships a JavaScript extension (ArbitraryOutputsFixedInputs.js) that adds an outputs widget to the node - set it to how many slots you want (up to 16 in the UI), or use the right-click "update Outputs" option. That widget is the the README warns about: without touching it, the node shows no sockets at all.

Inputs and outputs

  • list - a MASK list, forceInput, so it must be wired from a list producer like ToMaskList or ExtendMaskList.
  • Outputs: up to 16 individual MASK sockets (MASK_1, MASK_2, …), one per list entry.

One practical note: match the outputs widget to the actual list length. The node returns exactly as many masks as the list holds, so if you've exposed fewer sockets than items, you'll have items you can't reach, and exposing more than you feed means empty slots.

Install

Part of bmad4ever/comfyui_bmad_nodes. Via ComfyUI Manager, search "comfyui_bmad_nodes" ("Bmad Nodes"), install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_bmad_nodes
cd comfyui_bmad_nodes
pip install -r requirements.txt

Then restart ComfyUI. No model downloads; the requirements are opencv-python, scikit-image, simpleeval and gray2color.

Common issues

The number-one surprise is the invisible-outputs behavior - if the node looks empty, set the outputs widget. If that widget isn't there at all, the pack's JS didn't load (hard-refresh the browser, or check your ComfyUI frontend is up to date; a stale browser cache keeps old extensions). Second: don't set more visible sockets than your list has and expect a partial run - match them up. And as with all the list nodes, the list input only accepts a real list connection, not a bare mask.

CategoryBmad/Lists/GetAll

Inputs (1)

NameTypeDefaultDescription
listMASK

Outputs (32)

NameTypeDescription
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK
MASKMASK