Mask Info
Debug your masks with actual numbers
- mask
- mask
- coverage
- value_range
- mean_value
- detailed_info
The node that tells you what your mask actually is
Masks look identical at a glance and behave completely differently. A mask that's 0.2 everywhere is invisible to most consumers; a mask with a 1% hole in it fails in a way you can't see with your eyes. Mask Info is the meter: it measures a mask and reports its statistics, while also passing the mask through untouched. It's the debugging tool this pack's other mask nodes assume you have.
How it works
Feed it a mask and it computes, per image in the batch:
coverage- percentage of pixels above 0.5. The number that tells you whether your mask is empty (0%), nearly full, or reasonable.value_range- a string like[0.000, 1.000]giving the min and max pixel values.mean_value- average pixel value. A mean of 0.15 means "mostly background"; 0.8 means "mostly mask."detailed_info- a human-readable string with the per-batch breakdown (Shape=…, Coverage=…%, Range=[…], Mean=…), plus overall averages when you feed a batch.
And it passes the mask through as the first output, so you can drop it inline into an existing wire and inspect the numbers without changing your pipeline. That pass-through is a nice design touch - debug nodes that break the graph are annoying.
When you'll actually reach for it
- "My mask isn't doing anything." First check: coverage. 0.0% means an empty/black mask and no downstream node will fix that. This node converts a 20-minute head-scratcher into a five-second check.
- "It censored the whole image." Coverage near 100% means your mask is inverted or huge -
invertin Mask Attributes, or fix it upstream. - "Is my soft mask actually soft?"
value_rangetells you instantly whether you've got a clean binary 0/1 mask or a gradient - which determines whether binarizing downstream is safe.
Install
Part of LK-168/comfyui_imgutils. ComfyUI Manager → search "comfyui_imgutils", or:
cd ComfyUI/custom_nodes
git clone https://github.com/LK-168/comfyui_imgutils
Restart ComfyUI. Pure numpy statistics - no models, no downloads, nothing to configure. The only input is mask; the only decision is where in the graph you splice it in.
Common issues
There's essentially one failure mode, and it's the reverse of the debug story: the mask is fine and you've wired this node somewhere expecting it to transform the mask. It doesn't transform anything - it measures. The mask output is identical to the input. If you wanted an operation, you want Mask Attributes or Mask Morphology. Misunderstanding that is the whole source of confusion with this node.
Small, boring, and exactly the kind of instrumentation a pack of mask nodes needs to have. Keep one wired in while you're building, pull it out when you're done.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| coverage | FLOAT | — |
| value_range | STRING | — |
| mean_value | FLOAT | — |
| detailed_info | STRING | — |