Inspyrenet Rembg Assistant
Stop your removed background from sneaking back in
- image
- mask
- IMAGE
- MASK
First thing to know: this node doesn't actually remove a background itself. The name makes it sound like a segmentation model, but it isn't one - it's a cleanup step for a mask you already have. You run an actual InSPyReNet Rembg node (the one from ComfyUI-Inspyrenet-Rembg, or any node that hands you an image plus a mask) first, and then this node takes that pair and does something the segmentation step alone can't: it makes the removed background stay removed once you leave ComfyUI's alpha-aware world.
That sounds like a non-problem until you hit it. A lot of downstream nodes - Video Combine being the classic offender - just don't carry an alpha channel through. Export to MP4, ProRes without the right flag, most common video codecs - none of them support real transparency, so your carefully cut-out subject gets composited back onto whatever was behind it, or onto black. People run into this constantly: cut the background out, pipe it into Video Combine expecting a transparent clip, and get the original background right back, because the codec silently dropped the channel that was carrying "transparent" as information. This node exists specifically for that moment - it bakes the removal in as pixels instead of leaving it as alpha, so there's nothing left for a downstream node to drop.
The inputs that matter
- image and mask (required) - the output pair from your actual rembg/segmentation node. This is the part that trips people up: if you only have an image with no mask yet, this node has nothing to work with. Run the real background-removal step first.
- use_bg_color (boolean, default off) - the switch between the two things this node can do. Off, and the background gets knocked out entirely. On, and it gets replaced with a flat color instead.
- bg_color - a set of sixteen named flat colors (whites, blacks, primaries, plus the greens and blues you'd want for chroma-key style work) that only matters when
use_bg_coloris on.
Outputs are IMAGE and MASK - the processed image with its background dealt with, and the mask carried along so you can keep compositing with it further down the graph.
Why you'd actually want a flat color instead of transparency
If your endpoint genuinely supports alpha - PNG sequence, a compositor, an app that reads RGBA - you don't need this node; keep the transparency. But if you're heading toward video, or into any node in your graph that flattens to RGB somewhere along the way, transparency is a liability: it either gets discarded or turns into an ugly matte fringe. A solid color background is honest about what's actually going to happen to your pixels, and if you pick green or blue you get a genuine green-screen clip you can key properly in a real video editor - arguably a better outcome than fighting ComfyUI's video nodes to preserve alpha they were never built to carry.
Installing it
Search ComfyUI Manager for Image to Painting and Inspyrenet Assistant Nodes and install - that's the pack's registered title, not its repo name, so searching "Img2Painting" alone may not surface it. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/Isi-dev/ComfyUI-Img2PaintingAssistant, then restart ComfyUI. No models to download, no heavy dependencies - it's pure image compositing, so it's a light, fast install either way.
Common issues
The one real gotcha is conceptual, not technical: people expect this node to find and cut out the subject on its own, wire in just an image, and get a red squiggly or a missing-mask error. It needs a mask input from a real segmentation node - pair it with ComfyUI-Inspyrenet-Rembg (or BiRefNet, or whatever rembg node you're already using; the mask input doesn't actually care which model produced it, despite the node's name). Beyond that, if you're chasing a clean edge on hair or fur, that fight happens upstream at the segmentation step, not here - this node can only work with the mask it's handed, so a rough mask in gives you a rough result out no matter what color you pick.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| use_bg_color | BOOLEAN | false | — |
| bg_color | COMBO | 16 options: white, black, red, lime, blue, yellow, +10 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |