Nodes/Remove Background (SET)/Remove background
ComfyUI Node

Remove background

Remove background — the five-second cutout node

By set-soft·Created about a year ago·Updated 9 months ago· 18
Remove background
  • model
  • images
  • depths
  • background
  • images
batch_size1
out_dtypeAUTO

This is the node the pack is named for, and it's deliberately boring. Drop a model in, drop an image in, get a transparent-background image out. No size sliders, no threshold fiddling, no colour picker. Remove background is the one you use when you just want the subject cut out and you don't want to think about it - and for most people, most of the time, that's the right call.

What's happening under the hood: the node asks the model what training size it was built for (every loader reports this), scales your image to that size, runs the network to produce a per-pixel foreground-probability map, then applies a foreground colour estimation pass so the edges pick up the subject's real colour instead of the background's. If you've connected a background image, the subject gets composited onto it; otherwise you get RGBA transparency. It's a thin wrapper around Remove background (full) with all the options pinned to sensible values - which is why it also uses less RAM than the full node.

Inputs

  • model (SET_REMBG) - from any loader: Load RemBG model by file or any Load XXXXXX model by name. The model's training size is used automatically.
  • images (IMAGE) - one or more images; scaled internally to the model's sweet spot.
  • batch_size - how many images to process at once. Great for video and batches, but the README is explicit that RTX 3060-class boards should stay at 1.
  • depths (optional) - external depth maps, only for PDFNet.
  • background (optional) - the replacement backdrop. Scaled to match your images; for video it can be another video with the same number of frames.
  • out_dtype (optional) - float16 halves memory when processing long videos.

Output

images (IMAGE) - the cutout: RGBA with transparency, or background-replaced if you supplied one. That's the whole output, no mask, no depth, no edges.

Install

ComfyUI Manager search "Remove Background (SET)", or:

cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
pip install -r ComfyUI-RemoveBackground_SET/requirements.txt

ComfyUI 0.3.48+, and seconohe >= 1.0.6 - if the node errors on first run, install a fresh copy with pip install git+https://github.com/set-soft/seconohe.git. Models auto-download into ComfyUI/models/rembg on first use.

Where people get burned: RGBA images aren't supported by every downstream node in ComfyUI, so if your cutout looks fine in the preview and then something downstream shows a black or broken background, the pipeline dropped the alpha channel - not the node's fault. Also, pick your model with intent: BiRefNet General is the default for hard edges, IS-Net for fast batch work, MODNet if it's a portrait and you want it instant. This node's job is to stay out of your way while the model does the real work.

CategoryRemBG_SET/Basic

Inputs (6)

NameTypeDefaultDescription
modelSET_REMBGThe remove background model from `Load RemBG model by file` or any of the `Load XXXXXX model by name` nodes
imagesIMAGEOne or more images to process, will be scaled to a size that is good for the model.
batch_sizeINT11–256How many images to process at once
depthsoptMASKFor models that starts with a depth map
backgroundoptIMAGEImage to use as background
out_dtypeoptCOMBOAUTOData type used for the outputs. `AUTO` means the same as the input.Using `float16` can help when processing videos.

Outputs (1)

NameTypeDescription
imagesIMAGEThe images with the background removed (transparent) or replaced by the background image