imageRemBG
ImageRemBG wraps rembg (and grabs a model on first run)
- image
- image
- mask
Want a clean cutout of the subject in an image, with a transparent background and a mask to go with it, in a single node? tinyterra's imageRemBG does exactly that by wrapping rembg - the same MIT-licensed library that made background removal mainstream in the SD world back in 2023.
Feed it an IMAGE and you get two outputs: the cutout (an RGBA image, where the background pixels are now transparent) and a mask. The pack's README pitches it for photobashing workflows - pull a subject out, slap it over a new background, regenerate - and that's a fair use, but it's just as handy for compositing, icons, or prepping reference images.
How it works
Under the hood it's a thin rembg wrapper: the node converts your tensor to a PIL image, calls rembg.remove(), converts the result back, and extracts the alpha channel. Two things worth knowing:
- The first run downloads a model. rembg's default is u2net, fetched from the project's GitHub on first use. After that it's cached locally, so the wait happens once.
- The mask output is inverted from the alpha. Where the cutout's alpha marks the subject as opaque (1), the mask output carries
1 - alpha- so the removed background reads as white. That's the opposite of the convention some other mask nodes use, so if your downstream masking looks backwards, this is why.
The inputs that matter
image- the IMAGE you're cutting out.image_output-Hide,Preview,Save, orHide/Save. This controls whether the result shows up in the UI and gets written to disk. Default isPreview, which is the right call while you're dialing things in.save_prefix- the filename prefix when you're saving, defaultComfyUI.
Installing it - the one node in this pack with a real dependency
This is the exception to "tinyterraNodes needs no pip installs." The node imports rembg lazily and will refuse to run with a clear error if it's missing: REMBG is not installed. Please install it with pip install rembg. So after installing the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes
# then, into your ComfyUI Python environment:
pip install rembg
On Windows/portable installs, remember you want the environment ComfyUI itself runs in (its python_embeded), not your system Python. rembg pulls in onnxruntime; on machines where the GPU build of onnxruntime fights with other packages, the CPU build works fine for this - background removal is light work.
Where it falls short (know before you reach for it)
rembg's default u2net is fast and reliable on clean backgrounds, but its edges are not exceptional - flyaway hair, glass, veils, and semi-transparent material all suffer, and that has been true since 2020. The background-removal landscape moved on: ComfyUI shipped BiRefNet nodes in core in mid-2026, and InSPyReNet fans are loud about that one too. So treat imageRemBG as the convenient, low-friction option. When a tricky edge matters - hair especially - you'll get better masks from BiRefNet or InSPyReNet, which you may already have installed. Convenience has a price, and here it's edge quality.
Also remember the RGBA output: downstream nodes need to respect the alpha channel. Compositing it over a new background usually means a composite node that can take an alpha/mask - pasting the RGBA straight into a sampler pipeline will just flatten the transparency back to black.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| image_output | COMBO | Preview | 4 options: Hide, Preview, Save, Hide/Save |
| save_prefix | STRING | ComfyUI | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |