Nodes/comfyui-vs-glassmatte/VS Save RGBA (16-bit)
ComfyUI Node

VS Save RGBA (16-bit)

The only node here that produces the actual deliverable

By andrewclass1·Created 4 days ago·Updated 4 days ago· 0
VS Save RGBA (16-bit)
  • color
  • alpha
    ◄filename_prefixhero/hero_RGBA►
    ◄bit_depth16►

    ComfyUI's SaveImage writes 8-bit RGBA PNGs, and eight bits is 256 levels - for glass that's where banding lives, because a bottle neck might span 30 levels of alpha across a few hundred pixels and you can count them. VS Save RGBA (16-bit) writes a 65,536-level straight-alpha PNG instead. It's an output node with no outputs, it's the last thing in the graph, and it's the reason the rest of the pack bothers with float precision.

    Why it isn't just a checkbox

    PIL cannot write 16-bit RGBA. It can write 16-bit greyscale and it can write 8-bit RGBA, and that's the wall the whole ecosystem hits - which is why "16-bit PNG with alpha" is oddly rare even in 2026. The source here includes a small hand-rolled PNG encoder: IHDR, one zlib-compressed IDAT, IEND. That's it. It's about twenty lines of struct packing, and it's the difference between a file your client's retoucher can work with and one they can't.

    Which does mean one thing you should know up front: the file has no text chunks, so the ComfyUI workflow is not embedded in it. Every PNG that comes out of SaveImage carries your whole graph as tEXt/iTXt metadata - that's how drag-to-load works. This writer emits three chunks and none of them are text. If you want the workflow to travel with the deliverable, save a separate PNG through the normal node, or export the workflow JSON.

    The inputs

    color and alpha are the straight-colour and mask outputs from VS Difference Matte. Straight, not premultiplied - the writer just concatenates them and scales, so premultiplied input gives you a dark edge on every anti-aliased pixel.

    filename_prefix defaults to hero/hero_RGBA, which means your files land in ComfyUI/output/hero/hero_RGBA_00001_.png. The counter and subfolder handling are ComfyUI's own get_save_image_path, so subfolders, numbering and existing-file avoidance all behave exactly like the core save node. Slashes make folders; don't put a leading slash in.

    bit_depth is 16 or 8. 8 compresses far better and is fine for a web mockup; 16 is for anything going to print, retouching or a client who said the word "hero". Both write the same alpha.

    There are no outputs - it's an OUTPUT_NODE, so it always runs and the graph resolves backwards from it. It also writes an 8-bit copy into ComfyUI's temp directory and returns it as a UI preview, so you see the result in the graph without opening a file.

    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 Pillow version pin, no ImageMagick, nothing to install. It also doesn't need any of the output-directory config beyond what ComfyUI already sets up.

    Where people get burned

    "My file looks washed out in Photoshop." It probably doesn't - check that your viewer is reading straight alpha rather than assuming premultiplied, and composite it over something. A straight-alpha PNG on a transparent checkerboard looks identical either way; the giveaway is a dark fringe on a dark background, which means premultiplied values got saved.

    "Preview shows fine but the file won't open in X." A hand-rolled encoder writes a minimal PNG. Some older tools are fussy about missing ancillary chunks. In practice Photoshop, Affinity, Krita, GIMP and Figma all read it fine; if one doesn't, converting through ImageMagick (convert in.png out.png) settles it.

    No workflow in the PNG. As above - real, by design, and it surprises people who expect every ComfyUI PNG to be a workflow file. Keep a SaveImage on a parallel branch if that matters to your process.

    Last one, and it's the pack-wide rule: first image of the batch. This node saves one file per run, not one per image in a batch.

    CategoryView Source/Glass Matte

    Inputs (4)

    NameTypeDefaultDescription
    colorIMAGE—
    alphaMASK—
    filename_prefixSTRINGhero/hero_RGBA—
    bit_depthCOMBO162 options: 16, 8

    Outputs (0)

    No outputs