Nodes/comfyui-vs-glassmatte/VS Composite Over
ComfyUI Node

VS Composite Over

The red background that tells you your alpha is wrong

By andrewclass1·Created 4 days ago·Updated 4 days ago· 0
VS Composite Over
  • color
  • alpha
  • background_image
  • IMAGE
◄backgroundred►

A transparent PNG on a white checkerboard in an image viewer tells you almost nothing. Every alpha defect - the pedestal haze, the white fringe, the ghosted label, the glass that isn't actually transparent - is invisible against white and screams against red. VS Composite Over exists to give you that red. It's the cheapest node in the pack and the one you'll wire up first.

The five backgrounds

color and alpha in, one IMAGE out. background offers red, mid grey, checker, black and white, and the default is red, which is the right default and a small sign the author has done this before. Against saturated red:

  • leftover pedestal alpha shows as a pink wash over the whole frame
  • a white fringe on the silhouette shows as a pale rim
  • a ghosted label shows as a faint emboss of type in the glass
  • real partial transparency in the neck shows as red genuinely reading through the bottle

mid grey is the professional's check - it's the least flattering background for edge errors because it sits between both extremes, and it's what a client will look at. checker draws a procedural 64-pixel checkerboard (values around 0.6 and 0.85 - grey, not the classic bright white), which is the visual language everyone reads as "transparent". black and white are there for completeness and are also how you spot bright or dark fringes respectively.

The optional background image

Wire anything into background_image and it wins over the background enum: the node cover-fits the image to your frame (scale to fill, centre crop) and composites your bottle onto it. That's more useful than it sounds - a mockup against actual product-page background art is the real acceptance test, and it's a two-second check rather than an export-to-Photoshop round trip. Because it's a cover fit, a portrait background against a 9:16 frame crops top and bottom, so don't use this to judge framing, only to judge edges and transparency.

What it isn't

It's a preview node, not a save node. It outputs a composited RGB image with a PreviewImage-style destination, and it bakes the background in - there's no alpha left in the output. If you save that, you've thrown away the whole point of the pipeline. It sits between VS Difference Matte and VS Save RGBA (16-bit), on a dead-end branch, and only the save node gets the real deliverable.

Install

Manager → VS Glass Matte, or:

cd ComfyUI/custom_nodes
git clone https://github.com/andrewclass1/comfyui-vs-glassmatte
# restart ComfyUI

Torch and numpy only. No requirements file, no checkpoints, nothing to configure.

Where people get burned

The honest answer is that this node has almost no failure modes - it's a lerp. The problems people have are upstream and this node is just where they become visible. Which is the point: keep it in the graph so a bad clip_low, a stale VS_CROP, or a black plate built from the wrong base shows up as a pink halo rather than as a support ticket from a client who opened your PNG in Figma.

One real gotcha: if you composite premultiplied from VS Difference Matte instead of color, you'll get a dark, muddy preview. Premultiplied alpha is meant for a compositor that knows to un-premultiply; this node expects straight colour and multiplies by alpha itself. Wire color and alpha.

Second, if the image looks like it has a hard cut at the silhouette with no soft glass edge at all, check the alpha you're feeding. A hard binary edge means the matte clipped everything - usually clip_low too high or a segmentation mask being used where plate-based alpha should have been. This node won't hide that. It'll point at it.

CategoryView Source/Glass Matte

Inputs (4)

NameTypeDefaultDescription
colorIMAGE—
alphaMASK—
backgroundCOMBOred5 options: red, mid grey, checker, black, white
background_imageoptIMAGE—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—