ComfyUI Node

VNCCS Mask Extractor

Turning an alpha channel into something you can actually look at

By AHEKOT·Created 10 months ago·Updated 20 days ago· 1,446
VNCCS Mask Extractor
  • image
  • IMAGE

The name suggests this pulls a MASK out of an image, and functionally that's exactly what it does - but check the output type and there's a real gotcha worth flagging up front: it returns an IMAGE, not a MASK. One input, image; one output, also typed IMAGE. If your mental model is "this is a MASK converter I can wire straight into a masking node," stop and rewire, because that's not what you're holding.

What it's actually for is visualization. After a chroma-keying or background-removal pass - VNCCS Chroma Key or VNCCS RMBG2 both produce an alpha channel on their output - it's genuinely hard to eyeball how clean that alpha is just by looking at the RGBA composite in ComfyUI's preview, especially around hair or fine edges where matting quality actually lives or dies. Mask Extractor takes that alpha channel and renders it back as a plain grayscale image you can preview directly, without needing to route it through a separate mask-preview node or convert types along the way.

Where it fits

Drop it as a side-branch off your chroma-key or RMBG2 output, right after generation, purely for inspection - it doesn't need to be part of your main pipeline at all. Feed it the RGBA image, look at the grayscale result: solid white where the subject's fully opaque, solid black where it's fully transparent, and gray gradients exactly where your matte is soft (which is where you want to check for problems - muddy gray in a hairline, or a hard edge where you expected a soft one, both show up immediately here in a way they don't in the composited preview).

If what you actually need downstream is a real MASK-typed output - to feed into an inpaint node, a conditioning-set-mask node, or anywhere else ComfyUI expects that type - this isn't your node. Reach for the matte output that VNCCS Chroma Key and VNCCS RMBG2 already provide directly, or a standard image-to-mask converter if you need to pull one out of an arbitrary RGBA image elsewhere in your graph.

How to install it

No separate install - it's part of the main pack:

  • ComfyUI Manager - search VNCCS - Visual Novel Character Creation Suite, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/AHEKOT/ComfyUI_VNCCS.git, then cd ComfyUI_VNCCS_Utils && pip install -r requirements.txt, restart, and let Comfy Manager pick up any missing dependencies.

Common issues

Trying to wire the output straight into a node expecting MASK. ComfyUI will refuse the connection outright - the types don't match, and that's correct behavior, not a bug to work around. If you need a real mask, get it from the source node's dedicated mask output instead of trying to force this node into that role.

The output looks flat white or flat black with no gradient at all. That usually means the input image doesn't actually have meaningful alpha variation - a fully opaque image (no transparency at all) extracts to solid white, which is expected. Check that whatever's upstream - chroma key, RMBG2 - is actually configured to output transparency before assuming this node dropped it.

CategoryVNCCS

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE