ComfyUI Node

NIX_MaskNull

A boolean that says 'this mask is empty' — the cheap way to skip a pointless sampler run

By J-ChenX·Created 11 months ago·Updated 11 months ago· 2
NIX_MaskNull
  • mask
  • boolean

NIX_MaskNull is the smallest useful node in the NIX pack, and possibly the easiest to skip past. It takes a mask, checks whether every pixel is zero, and outputs a single boolean. That's it. There's no angle, no channel, no mode - one input, one output.

But a boolean that tells you a mask is empty is genuinely handy, because an empty mask is usually a signal: whatever was supposed to be detected wasn't. In a detection-driven workflow - face detailer, object removal, region inpainting - a mask that came back all zeros means there's nothing to fix, and running the sampler anyway wastes a generation on a no-op.

How it works

Feed a mask (MASK type). The node returns True if every value is exactly zero, False otherwise. Note the exactness: a mask with a single faintly-gray pixel - 0.02, say - is not empty. If your detector spits out soft-edged masks, a near-empty one can fail the test and send you down the sampling path for nothing. Binarize the mask upstream if that matters.

The boolean output wires into any logic or switch node. The natural pattern: mask → NIX_MaskNull → switch → (empty ? pass original image through : run the detail pass). NIX_SwitchAnything is a good partner here - route around the sampler entirely.

A thin node, honestly

There's a case that this could be a few lines inside another node, and there are other packs that offer equivalent checks. But having it as a standalone one-input node is also fine - it slots into a graph without dragging in a whole utility suite, and when you're building a batch loop you want the check to be visible on the canvas, not buried in a parameter. It costs nothing to keep around.

Getting it installed

It's part of the NIX pack, so one install covers this and every other NIX node:

  • ComfyUI Manager: search "NIX" (or the pack title "NIX ComfyUI Plugin"), or use Install Custom Nodes → Git URL with https://github.com/J-ChenX/ComfyUI-NIX. Restart after.
  • By hand:
    cd ComfyUI/custom_nodes
    git clone https://github.com/J-ChenX/ComfyUI-NIX
    
    Restart ComfyUI. No models, no extra pip packages beyond numpy/Pillow. It's under the "NIX" category.

Gotchas worth knowing

  • Exact zero test. Soft masks rarely read as exactly empty; threshold or binarize first if you're using this as a guard.
  • Batch-aware? Not really. It checks the whole tensor at once - True only if all masks in the batch are all-zero. If you need per-image emptiness, split the batch first.
  • Silent pack. No meaningful community discussion around NIX nodes as of mid-2026, so don't expect forum wisdom; the source is one short readable file if you want to confirm the exact test.
CategoryNIX

Inputs (1)

NameTypeDefaultDescription
maskMASK

Outputs (1)

NameTypeDescription
booleanBOOLEAN