Nodes/KayTool/𝙆 Preview Mask
ComfyUI Node

𝙆 Preview Mask

The fastest way to actually see what a MASK contains

By kk8bit·Created 2 years ago·Updated about a year ago· 364
𝙆 Preview Mask
  • mask

    A MASK in ComfyUI is just a single-channel array of numbers - nothing about it renders by default, unlike an IMAGE. So the moment you want to sanity-check a mask (is it actually selecting what I think it's selecting? is it empty? is it inverted?) you need something to turn it into a picture first. Preview Mask is that something: plug in a mask, get a preview thumbnail right in the graph, no wiring an output socket anywhere.

    How it works

    It converts the single-channel mask into an RGB image and drops it straight into ComfyUI's temp directory, the same place a regular Preview Image writes to - so it shows up inline the moment the node runs, no separate save step. Mask sources aren't all consistent about value range (0–1 floats vs. 0–255, and which end counts as "selected" varies by node pack), so the node normalizes the range before converting, which is why you generally see something sane rather than a blown-out white square or an empty black one regardless of where the mask came from.

    The inputs and outputs that matter

    There's one required input and no outputs at all - this is a terminal node, meant to sit at the end of a branch purely for you to look at:

    • mask (MASK) - the mask you want to inspect.

    No output sockets to wire anywhere; it's a dead end by design, exactly like Save Image or Preview Image.

    How to install it

    Install the whole KayTool pack, not this node individually - it doesn't ship standalone. Easiest path is ComfyUI Manager: search KayTool, click install, restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kk8bit/KayTool
    

    then restart. Nothing heavy here - no models to download, no extra Python packages beyond basic image handling.

    Common issues & troubleshooting

    The preview is a dull gray blob instead of stark black-and-white. That's usually correct, not broken - a real mask, especially anything with soft edges or partial selection, does have intermediate gray values. If you expected a hard binary mask and got gray, the problem is upstream (whatever produced the mask), not this preview node.

    Fully black preview. Nine times out of ten this means the mask itself is genuinely empty at that point in the graph - nothing got selected, or an earlier step zeroed it out. Preview Mask just shows you what's there; it can't fix an empty mask, but it's the cheapest way to catch one before you spend generation time downstream on a mask that was never going to do anything.

    You need more than "is this mask non-empty." If you want to see the mask sitting on top of your actual image, choose between solid-color backgrounds, or flip it with an invert toggle, reach for the pack's other preview node - Preview Mask Plus - instead. This one is deliberately the bare-bones version: one input, instant sanity check, nothing to configure.

    CategoryKayTool/Mask

    Inputs (1)

    NameTypeDefaultDescription
    maskMASK

    Outputs (0)

    No outputs