Nodes/DenRakEiw_Nodes/πŸ’Ύ Save Transparent Image
ComfyUI Node

πŸ’Ύ Save Transparent Image

Save the PNG with the alpha intact β€” the standard Save Image node will flatten it

By DenRakEiwΒ·Created about a year agoΒ·Updated a day agoΒ· 34
πŸ’Ύ Save Transparent Image
  • images
    β—„filename_prefixtransparent_β–Ί
    β—„save_metadatatrueβ–Ί

    Here's the trap this node exists to prevent: you run a full transparent-Flux pipeline, decode to RGBA, and then save with ComfyUI's standard Save Image - which flattens the alpha away and writes an opaque PNG. Your LayerDiffuse work is gone and you don't even notice until you composite. SaveTransparentImage is the "use this one instead" node: it writes a proper RGBA PNG with the alpha channel intact. The README says it flat out - "No transparency: use Save Transparent Image (not standard Save Image)."

    What it does

    Takes images (IMAGE) and a filename_prefix (default transparent_), and saves each to ComfyUI/output/ as a PNG. If an image already has alpha, it's preserved; if it comes in as RGB, it gets a full-opacity alpha channel added so the save never fails. Files are named {prefix}{timestamp}_{index}.png (the index zero-pads to three digits for batches).

    The optional save_metadata toggle (default on) is the ComfyUI convention working as you'd expect: it embeds PNG metadata - software/generator tags, creation time, size, channel count, a "Has Transparency: true" flag, and a workflow note - so the file carries its own provenance the way ComfyUI's SaveImage does. That metadata lives in PNG text chunks, which survive byte-for-byte copies and die to any re-encode; the alpha, on the other hand, is baked into the pixel data and survives far more abuse. Turn metadata off if you want minimal files or your downstream tool chokes on it.

    Where it fits

    The terminal node of the chain: FluxLayerDiffuseDecoderSimple β†’ SaveTransparentImage (with PreviewTransparentImage in front of it if you're smart). Output is a real RGBA file you can drop into Photoshop, a video compositor, or a game engine without a matting step. That's the LayerDiffuse payoff - alpha that was generated, not reconstructed.

    Inputs and the honest caveats

    • images (IMAGE, required) - the decoder's RGBA output.
    • filename_prefix (STRING, default transparent_) - include a subfolder with a slash if you want one, portraits/run_a/ style.
    • save_metadata (BOOLEAN, default true).

    Two things worth knowing. First, "transparent" here means "RGBA PNG" - if your downstream expects something like a premultiplied or straight-alpha distinction, that's on your pipeline, not this node. Second, this node writes only to output/, and unlike ComfyUI's SaveImage it doesn't do the auto-incrementing counter - the timestamp-based naming is deliberate so every save is a unique file, but it means repeated runs pile up rather than overwriting. That's usually what you want for a save node; just don't expect _00001_-style sequencing.

    Install

    Part of DenRakEiw_Nodes - ComfyUI Manager β†’ search "DenRakEiw Nodes", or git clone https://github.com/DenRakEiw/DenRakEiw_Nodes + pip install -r requirements.txt + restart. One-author pack, minimal support - but this particular node does one job and does it correctly, which is more than the standard Save Image does for RGBA.

    Categorydenrakeiw/flux

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGEβ€”
    filename_prefixSTRINGtransparent_β€”
    save_metadataoptBOOLEANtrueβ€”

    Outputs (0)

    No outputs