Nodes/comfyUI-TiledWan/TiledWan Mask Statistics
ComfyUI Node

TiledWan Mask Statistics

See exactly how bad your mask is before the model does

By Baverne·Created about a year ago·Updated 7 months ago· 8
TiledWan Mask Statistics
  • mask
  • mask
  • min_value
  • max_value
  • mean_value
  • variance
  • median_value
  • white_pixel_count
analyze_connected_componentstrue

Masks are where video inpainting quietly dies, and TiledWan Mask Statistics exists to catch it before the model does. Feed it a mask and it prints the usual stats - min, max, mean, variance, median - plus the mask-specific numbers that actually tell you whether your input is usable, then passes the mask through untouched.

In the TiledWan pack's world (tiled Wan 2.1 VACE video inpainting), a bad mask is expensive: it decides how much footage gets regenerated, and a stray speck or a drift can waste a multi-minute tile render. The useful readouts: mean is effectively your coverage ratio - mask values run 0–1, so the average is the fraction that's white - and white_pixel_count counts pixels above 0.5. A video mask that's accidentally all-white, all-black, or covered in speckles shows up here in one glance instead of after a 20-minute render. The analyze_connected_components toggle (on by default) adds connected-region analysis: how many separate masked areas exist and which is the largest, which is exactly how you spot isolated noise blobs that shouldn't be inpainted at all.

Inputs: mask (MASK) and analyze_connected_components (BOOLEAN). Outputs: the mask pass-through, five FLOAT stats (min_value, max_value, mean_value, variance, median_value), and one INT (white_pixel_count). Like the pack's Image Statistics node, it's an output node that talks to the console - a diagnostic, not a data source.

Install with the rest of the pack: ComfyUI Manager (search "comfyUI-TiledWan"), or cd ComfyUI/custom_nodes && git clone https://github.com/Baverne/comfyUI-TiledWan, then restart. No extra dependencies.

It's the sibling of TiledWan Image Statistics, and together they're the "show me your homework" nodes of the pack. Boring - and exactly what you want when a render is misbehaving.

CategoryTiledWan

Inputs (2)

NameTypeDefaultDescription
maskMASKInput mask to analyze. Should be a grayscale mask with values typically between 0-1.
analyze_connected_componentsBOOLEANtrueAnalyze connected regions in the mask to count separate masked areas and find the largest connected component.

Outputs (7)

NameTypeDescription
maskMASKPass-through of the input mask
min_valueFLOATMinimum mask value found
max_valueFLOATMaximum mask value found
mean_valueFLOATAverage mask value (coverage ratio)
varianceFLOATVariance of mask values
median_valueFLOATMedian mask value
white_pixel_countINTNumber of white/masked pixels (where value > 0.5)