Nodes/ComfyUI-Remover/Remove Parts
ComfyUI Node

Remove Parts

Three ways to make pixels disappear in one node — background, face, or a blur

By Shraknard·Created 3 years ago·Updated 2 years ago· 5
Remove Parts
  • image
  • IMAGE
apply_effect

The pack is called ComfyUI-Remover and it ships exactly one node, "Remove Parts", whose whole job is a dropdown with three ways to erase pixels: cut out the background, cut out the face, or blur everything. If you've got a generated image sitting in your graph and you want it on a transparent background for compositing, that's a one-node detour with zero configuration. The README is upfront that it's work in progress - face and background only, nothing else planned yet - and the rough edges are visible if you look. For a quick cutout, though, it works.

Don't reach for this expecting SOTA edges. The background-removal story in this ecosystem is that u2net-class models solve the easy case and lose on hair, fur and anything semi-transparent - that's why BiRefNet landed in ComfyUI core and InSPyReNet still wins head-to-heads. This node is the "I just need a cutout right now" tier, not the "ship product photography" tier. Fine. It has its place, and it has no model folder to set up, no VRAM to speak of.

How it works

Each option in the dropdown is a different mechanism under the hood:

  • Remove Background calls rembg's remove(), which wraps u2net, the 2020 salient-object-detection network. On the first run it downloads the u2net weights (~176MB) from GitHub and caches them, so the first execution stalls for a bit. Fast, runs on CPU if it has to, and honestly rough on hair - that's the classic u2net tradeoff.
  • Remove Face is old-school computer vision, not a segmentation model. It runs dlib's frontal face detector, maps the face with the bundled 68-point shape predictor, draws a convex hull around the landmarks (plus an estimated forehead), then zeroes the alpha channel inside that hull. Result: a person-shaped transparent hole, background still intact. It's neat, it's deterministic, and it doesn't care about your GPU.
  • Blur just applies a Gaussian blur. The radius is hardcoded at 5px - there's no control for it, which is the first sign this pack is a personal tool that escaped into the wild.

The inputs that matter

There are only two, and both are obvious:

  • image - any IMAGE tensor. One image at a time: the node assumes a batch of 1 and will choke on anything bigger.
  • apply_effect - the enum: Remove Background, Remove Face, Blur.

One output, also IMAGE. Background and face modes emit RGBA with the transparency you asked for; Blur comes back as a plain blurred RGB. Wire the output into Save Image to get a PNG with alpha - and remember that not every node downstream keeps the alpha channel, so if your transparency mysteriously vanishes, that's the usual culprit.

Installing it

Easiest path is ComfyUI Manager: search for "ComfyUI-Remover", install, restart. Or clone it yourself:

cd ComfyUI/custom_nodes
git clone https://github.com/Shraknard/ComfyUI-Remover

Then restart ComfyUI. The heavy lifting is in the dependencies - dlib, pillow, opencv, rembg. The one that bites is dlib: it compiles from source on most setups, which on Windows means a working C++ toolchain or a prebuilt wheel, and it's the most common way this pack fails to load. The 99MB shape_predictor_68_face_landmarks.dat is bundled right in the repo, so face mode needs no separate download - in theory.

Gotchas

The one that'll actually get you: the face path looks for the landmarks file at <ComfyUI root>/custom_nodes/shape_predictor_68_face_landmarks.dat, but the repo ships it inside custom_nodes/ComfyUI-Remover/. So out of the box, Remove Face tends to throw a file-not-found error. The fix is to copy the .dat up into your custom_nodes/ folder:

cp ComfyUI/custom_nodes/ComfyUI-Remover/shape_predictor_68_face_landmarks.dat ComfyUI/custom_nodes/

And the second, subtler trap: this is a single-image node. Feed it a batch and it'll break on the batch dimension rather than politely processing each frame. If you need batch background removal, rembg or the BiRefNet nodes in core are the grown-up options. This node is the quick-and-dirty one - use it that way and it'll be happy.

CategoryRemover

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
apply_effectCOMBO3 options: Remove Background, Remove Face, Blur

Outputs (1)

NameTypeDescription
IMAGEIMAGE