Nodes/abg-comfyui/Remove Image Background (abg)
ComfyUI Node

Remove Image Background (abg)

Remove Image Background (abg) — ComfyUI Node Guide

By kwaroran·Created 3 years ago·Updated 2 years ago· 25
Remove Image Background (abg)
  • image
  • IMAGE

What it is

This node does one job: you feed it an image, it hands back the same image with the background stripped out. No mask threshold, no model picker, no extra sockets to wire up - just IMAGE in, IMAGE out. That simplicity is the whole pitch. It's a ComfyUI port of skytnt's anime-remove-background HF Space, which itself is the same idea behind the old ABG extension for Automatic1111 - a segmentation model trained specifically to cut out anime and illustration art rather than photos. If you've ever used u2net or isnet-anime through rembg and gotten so-so results on line art or flat cel-shaded characters, this is the same lineage of "anime-tuned" cutout tool, just packaged as its own node instead of a model you pick from a dropdown.

Where this sits in the bigger picture: background removal has three real approaches - post-generation removal (this node's category), native transparent generation (LayerDiffusion, mostly stalled tooling now), and targeted masking (SAM/GroundingDINO, a different job entirely). Within post-generation removal, the field has moved on since this node was written. BiRefNet and InSPyReNet are what people actually reach for now - they win on hair, fur and semi-transparent edges, categories a straight u2net-family model doesn't handle as gracefully. This node predates that shift and isn't part of the current conversation about it; nobody's arguing "abg vs BiRefNet" on Reddit the way they argue BiRefNet vs InSPyReNet. What it's still good for is exactly its original niche: clean flat-color anime art with solid backgrounds, where the "which SOTA model wins on flyaway hair" debate doesn't really apply.

How it works

It's a straight image-in, alpha-cut-out pipeline. The model was trained on anime/illustration data specifically, so it's better at reading cel-shaded edges, flat colors and stylized hair than a general photo-trained segmenter, and worse than a general model on photorealistic subjects. There's no dial to turn - the network makes the foreground/background call and you get the result.

Inputs and outputs

  • image (required, IMAGE) - the picture you want the background pulled from. That's the only input.
  • Output: IMAGE - the same image with the background removed. Wire it straight into a compositor, a SaveImage, or whatever background you're pasting the subject onto next.

No mask output, no threshold slider, no model selector. If you need to fine-tune edge quality or export a soft alpha matte instead of a hard cut, this node isn't built for that - you'd want something from the BiRefNet/InSPyReNet family instead.

Installing it

Easiest path: open ComfyUI Manager and search for "abg-comfyui" (or "Remove Image Background"), install, restart.

Manual path:

cd ComfyUI/custom_nodes
git clone https://github.com/kwaroran/abg-comfyui

Then install its Python dependencies (pip install -r requirements.txt from inside the cloned folder) and restart ComfyUI. Once it's loaded, add a "Remove Image Background (ABG)" node and connect an image to it.

One thing worth knowing before you go digging through the repo yourself: the README's own install section actually tells you to git clone a different repository (Jcd1230/rembg-comfyui-node) - looks like a leftover from whatever this was forked or copied from. Ignore that line and use the actual pack URL above; the node title you're looking for after install is the same either way.

The README doesn't spell out a separate model-download step, which is unusual for this class of node - it just says clone + pip install -r requirements.txt. If your first run throws an error looking for a missing model file rather than a Python import error, that's the likely culprit; it's not something wrong with your general ComfyUI setup.

Common issues

  • Import/dependency errors on startup - this node relies on its own requirements.txt separate from ComfyUI's. If the node doesn't show up (or ComfyUI logs an import failure for it), re-run the pip install from inside the abg-comfyui folder, not the ComfyUI root.
  • Muddy edges on hair, fur, or photorealistic subjects - this is a known limitation of the whole u2net-generation of segmenters, not a bug: they're solid on flat, contrasty subjects and visibly weaker on fine detail. If you're cutting out anything with real hair strands or semi-transparent material, that's exactly the case where BiRefNet or InSPyReNet do noticeably better - worth trying one of those side by side if this node's output looks rough.
  • Wrong repo cloned - see above. If you followed the README's git clone line literally and ended up with a node pack that doesn't match what's described here, you cloned the wrong URL.
Categoryimage

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE