TiledWan Mask Statistics
See exactly how bad your mask is before the model does
- mask
- mask
- min_value
- max_value
- mean_value
- variance
- median_value
- white_pixel_count
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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | Input mask to analyze. Should be a grayscale mask with values typically between 0-1. | |
| analyze_connected_components | BOOLEAN | true | Analyze connected regions in the mask to count separate masked areas and find the largest connected component. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| mask | MASK | Pass-through of the input mask |
| min_value | FLOAT | Minimum mask value found |
| max_value | FLOAT | Maximum mask value found |
| mean_value | FLOAT | Average mask value (coverage ratio) |
| variance | FLOAT | Variance of mask values |
| median_value | FLOAT | Median mask value |
| white_pixel_count | INT | Number of white/masked pixels (where value > 0.5) |