easy isMaskEmpty
Branch your workflow on whether a mask found anything
- mask
- boolean
Small node, specific job: it looks at a mask and tells you whether it's empty. Nothing detected, all black? You get True. Something there? False. That single boolean is what lets an automated workflow decide instead of blindly running a step that has nothing to work on.
It lives in ComfyUI-Easy-Use's Logic group, alongside the comparisons, switches and if/else nodes. On its own it's trivial. As the condition on a branch, it's the difference between a graph that handles "no face found" gracefully and one that errors or wastes a pass on an empty region.
Why you'd reach for it
The archetypal case is conditional detailing or inpainting. You run a detector or a segmenter, it produces a mask, and sometimes that mask is empty - no face in frame, nothing matched. If you feed an empty mask into an inpaint sampler, best case you waste a pass, worst case something downstream chokes. Put easy isMaskEmpty on the mask, wire its boolean into an easy ifElse (or use it to gate a switch), and skip the whole detail branch when there's nothing to detail. In a batch pipeline that runs unattended, that guard is what keeps it from falling over on the one image without a subject.
How it works
It sums up the mask's pixels; if there's no non-zero region, it reports the mask as empty. One input, one output, no configuration. The value it emits is a plain BOOLEAN that any logic node in the pack (or elsewhere) can act on.
The input and output
mask- the mask to test, typically from a detector, a segmentation node, or a Load Image's alpha.
Output: a single boolean - True when the mask is empty, False when it holds something. Route it into an if/else, a switch's selector, or any node that takes a boolean condition.
Installing it
ComfyUI Manager: search ComfyUI Easy Use, install, restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/yolain/ComfyUI-Easy-Use, install requirements (install.bat / pip install -r requirements.txt), restart. No models, no dependencies - it's a mask test.
Where people trip
Almost nothing to trip on, but two things worth knowing. First, "empty" means no non-zero pixels - a mask that's technically all-but-invisible (a stray near-black smudge) still counts as non-empty, so if a detector emits faint noise you may get False when you expected True. Second, the node only produces a boolean; it doesn't do the branching. You still need an easy ifElse or a switch downstream to actually take the fork - plugging the boolean into nothing just gives you a value nobody reads. Pair it with the pack's logic nodes and it earns its keep.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | — |