ComfyUI Node Runs on cloud

Mask Batch

Stack separate masks into one batched MASK

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Mask Batch

      Don't confuse this with Mask Batch to Mask, WAS's other batch-related node - that one pulls a single mask out of a batch by index. This one, plain Mask Batch, does the opposite job: it takes separate individual masks and stacks them into one batched MASK tensor, the same way ComfyUI's own core Image Batch node combines two images into a batch dimension instead of two independent wires. WAS's brief for this node doesn't spell out an exact field list the way its README does for some siblings, so that's the naming-convention reading I'm going on - "X Batch" builds a batch, "X Batch to Y" un-builds one - and it lines up with how the rest of ComfyUI uses the word.

      Why you'd want a batched mask instead of separate wires

      Batching exists so a pipeline can process several things in one pass instead of looping node-by-node. If you're running an inpaint, a masked filter, or a composite across several frames or several candidate crops, a lot of the downstream nodes are much happier consuming one batched MASK that lines up with a batched IMAGE than they are juggling four separate mask wires that all need to stay in sync by hand. Mask Batch is the node that turns "I have several masks" into "I have one mask batch," so the rest of your graph can treat them as a single unit.

      How it works

      Functionally it's a stacking operation: feed it individual mask tensors and it concatenates them along the batch dimension, handing back one MASK output whose batch size equals however many you fed in. It doesn't blend, merge, or combine the masks' contents the way WAS's dedicated "combine" nodes do (Masks Combine Masks, Masks Combine Batch) - those collapse multiple masks into one shared mask. Mask Batch keeps every mask distinct; it just changes how they travel through the graph, from several wires to one batched tensor.

      The inputs and outputs that matter

      Individual MASK inputs going in, one batched MASK coming out. If your goal is actually merging the masks' white regions together into a single combined mask, this isn't that node - look at WAS's Combine nodes instead. Mask Batch is strictly about packaging, not blending.

      Installing it

      ComfyUI Manager: search "WAS Node Suite," install, restart. Manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      install requirements.txt against your ComfyUI Python, restart. No model, no external dependency of its own - it's tensor plumbing.

      Common issues & troubleshooting

      Batch size mismatch downstream. The classic ComfyUI batching complaint: if your batched mask's count doesn't match your batched image's count, whatever consumes both together will error or silently misalign entries. Check that whatever fed you the individual masks is producing the same count as the images they're meant to pair with.

      I wanted them merged, not stacked. That's the combine family, not this node - Mask Batch keeps each mask separate inside the batch dimension rather than blending them into one.

      Every WAS node disappeared at once. Pack-level, not this node. WAS Node Suite has been unmaintained since the author marked it retired in December 2023, and the recurring issue since is the whole suite throwing "Import Failed" after a ComfyUI update when a pinned shared dependency gets bumped underneath it. Reinstall requirements against the correct, embedded Python interpreter (or run install.bat) to bring it back.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs