Nodes/ComfyUI-WJNodes/WAS Mask Fill Region batch
ComfyUI Node

WAS Mask Fill Region batch

Fill the holes in a mask, now with batch support

By 807502278·Created 2 years ago·Updated 11 months ago· 20
WAS Mask Fill Region batch
  • mask
  • MASKS
invert_maskfalse

This one's a patch, not an original idea, and the pack is upfront about it - the node's own description reads "Original plugin: was-node-suite-comfyui. Original node: WAS_Mask_Fill_Region. change: batch bug in mask processing." In plain terms: WAS Node Suite has a Mask Fill Region node, and it apparently didn't handle batches of masks correctly. WJNodes forked it and fixed that. If you've run the original on more than one mask at a time and gotten results that didn't make sense, this is the fix.

Quick note on WAS Node Suite itself, since this node is useless without it: it's one of the oldest and largest general-purpose utility packs in the ecosystem - blending, color correction, mask operations, text overlay, film grain, and dozens of other odds and ends that core ComfyUI doesn't ship. It's still genuinely in active use across the community - it keeps coming up something like ten to fifteen times a month in ongoing discussion even now - so installing it as a dependency here isn't a bet on abandonware, just on a large pack you may not otherwise need.

How it works

"Fill region," in mask terms, means closing up holes inside a mask shape. Take a mask that looks like a donut, or has little gaps punched through it - common after SAM/YOLO-style segmentation, or after a rough hand-painted mask - and get back one solid blob with the interior filled in, rather than a shape with holes a downstream inpaint or composite step would otherwise leave untouched. invert_mask flips the mask before the fill runs, which matters if the region you want filled is technically the "off" area of your mask rather than the "on" one.

The inputs and outputs that matter

  • mask (required) - the mask batch to clean up. This is the whole point of the "_batch" in the node's name: feed it more than one mask and it processes each correctly, which is exactly what the original WAS node reportedly didn't do.
  • invert_mask (boolean, default false) - flip the mask before filling, for when your holes are on the wrong side.
  • MASKS - the cleaned-up batch. Wire it wherever the original mask was headed - usually a composite or inpaint step that wants a solid region rather than a punctured one.

How to install it

This one's a two-step install because of the dependency:

  1. WJNodes itself - via ComfyUI Manager, search "ComfyUI-WJNodes," install, restart. Or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/807502278/ComfyUI-WJNodes
  2. WAS Node Suite - the WJNodes README says this outright: "To use the following nodes, you must install WAS plugin," and the WAS repo is WASasquatch/was-node-suite-comfyui. Install it the same way, through Manager or a manual clone into custom_nodes.

Restart ComfyUI after both are in place. No model downloads needed for this specific node - it's a mask-processing operation, not something that pulls weights.

Common issues & troubleshooting

Node missing from the menu after installing WJNodes - almost always means WAS Node Suite isn't installed. This node wraps WAS's original class rather than reimplementing it from scratch, so without the dependency present it has nothing to wrap and won't register.

You don't actually need this node if you only ever run mask fill on one mask at a time - the original WAS_Mask_Fill_Region in WAS Node Suite works fine for that case, and pulling in this wrapper (and by extension confirming your WAS install is current) is only worth it once batches are actually in play.

It's built on someone else's node, not from scratch - worth knowing if you're building something you don't want to babysit. If WAS Node Suite later renames or restructures WAS_Mask_Fill_Region internally, this wrapper is the one most likely to break first, since its whole job is patching that specific node's batch handling.

CategoryWJNode/Other-plugins/WAS

Inputs (2)

NameTypeDefaultDescription
maskMASK
invert_maskBOOLEANfalse

Outputs (1)

NameTypeDescription
MASKSMASK