Nodes/tri3d-comfyui-nodes/Transparent Background v5.1.0
ComfyUI Node

Transparent Background v5.1.0

Background removal that hands you the alpha channel as a proper MASK

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Transparent Background v5.1.0
  • image
  • IMAGE
  • MASK

Background removal is the most commoditized operation in the ComfyUI ecosystem, and this is TRI3D's take: one image in, cutout plus alpha mask out. The reason this node (and its sibling tri3d-bgremove-mega) exists is that the pack needs clean subject cutouts everywhere - garment try-on, compositing, pose work - and the two outputs it gives you, the RGB cutout and the mask as a separate MASK channel, are exactly what downstream nodes want.

What it does

One input - image. It runs the transparent-background CLI under the hood (the InSPyReNet-based library, --mode base, RGBA output), then splits the result: the RGB channels become the output IMAGE (transparent pixels turned into black, since ComfyUI images don't carry alpha), and the alpha channel becomes the second output, a proper MASK. One pass, both the cutout and the mask, pixel-aligned because they come from the same inference.

Three things worth knowing before you rely on it:

  • It's a subprocess, not in-process inference. The node shells out to the transparent-background command-line tool. That means the CLI must be on PATH, which is a common install failure point - if the pack's requirements installed to a different Python than the one ComfyUI runs, the node errors with a "command not found".
  • First run downloads the model. The InSPyReNet base checkpoint gets pulled into ComfyUI's models folder (--ckpt points at the models dir) on first use. The download is a few hundred MB; budget a minute and a real network connection.
  • Quality is InSPyReNet base. Solid on clean subjects, decent on hair for a base-tier model, and not in BiRefNet's league on flyaway hair or semi-transparent material. For the pack's VTON work (usually clean garment shots) it's fine; for e-commerce-grade hair cutouts you'd want a BiRefNet node instead.

Why you'd pick it

The two-output split is the differentiator. Most background-removal nodes give you a cutout and leave you to derive the mask yourself; this one hands you the MASK directly, ready for inpainting conditioning, compositing, or feeding back into the pack's mask-driven nodes. And if you want to choose your backend at runtime, tri3d-bgremove-mega wraps this same path plus a PhotoRoom API option.

Installing

ComfyUI Manager (search "tri3d"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes

Requirements matter here: pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt includes transparent-background, which provides the CLI. If you cloned by hand, don't skip this step - the node will not work without the library.

Troubleshooting

  • transparent-background: command not found - the library isn't on the same PATH as ComfyUI. Install it into ComfyUI's Python (<comfy>/python_embeded/python.exe -m pip install transparent-background on Windows) or fix PATH.
  • Hangs on first use - model download. Watch the console for progress.
  • Cutout edges look rough - that's base InSPyReNet being base. Switch to a BiRefNet node for hard edges, or accept it for garment work.

It's not the SOTA pick and it doesn't try to be - it's the "cutout plus a real mask, wired for this pack's downstream" workhorse.

CategoryTRI3D

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK