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

Remove background (full)

Remove background (full) — the control panel for cutouts

By set-soft·Created about a year ago·Updated 9 months ago· 18
Remove background (full)
  • model
  • images
  • depths
  • background
  • images
  • masks
  • depths
  • edges
width1024
height1024
upscale_methodbicubic
blur_size90
blur_size_two6
fill_colorfalse
color#000000
mask_threshold0.000
batch_size1
out_dtypeAUTO

The simple Remove background node is the pack's "just do it" button. This is the "fine, let me have every knob" version. Remove background (full) runs the same model inference but exposes everything: pre-processing size, interpolation, foreground colour estimation, fill colour, mask threshold, and it hands back the mask, depth, and edge outputs the simple node hides. The README is upfront about the one cost - it consumes more RAM - but if you're doing real compositing work, this is the node you'll live in.

The inputs that matter

  • model (SET_REMBG) + images (IMAGE) - the loader output and your input, as everywhere.
  • width / height (default 1024) - the size images are scaled to before the model runs (doesn't change the output size). Wire the loader's train_w/train_h here for the model's sweet spot.
  • upscale_method (default bicubic) - scaling in and out. Bicubic is usually right.
  • blur_size (default 90) / blur_size_two (default 6) - diameters for the coarse and fine Gaussian blurs used by the Approximate Fast Foreground Colour Estimation. This is what makes the edges of a cutout take on the subject's true colour instead of bleeding the background's colour into hair. The advanced example workflow shows swapping this for FMLFE (fine-level estimation), which the author says is better but far heavier.
  • fill_color (boolean) + color - with no background image connected, this fills the background with a solid colour instead of leaving it transparent. The color field accepts hex (#RRGGBB), comma-separated RGB, rgb()/hsv()/hsl(), or ~140 named colours. Black by default.
  • mask_threshold (default 0) - force the mask to hard 0/1 above a confidence level. Leave at 0 to keep soft alpha (right for matte models).
  • batch_size - video/batch throughput; 3060-class GPUs are better at 1.
  • depths (optional) - external depth maps for PDFNet (otherwise auto-computed).
  • background (optional) - an image to composite behind the subject. It's scaled to match images, and for video it can be another video with the same frame count. Leave empty for RGBA transparency.
  • out_dtype - float16 for long video jobs to halve RAM.

Outputs

  • images (IMAGE) - the cutout: RGBA with transparency, background-replaced, or colour-filled.
  • masks (MASK) - the estimated foreground masks.
  • depths (MASK) - depth map (PDFNet only).
  • edges (MASK) - edge map (DiffDIS only).

Install and the usual gotchas

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+, seconohe >= 1.0.6 (fresh pip install git+https://github.com/set-soft/seconohe.git if it errors).

Two things that trip people up. First, RGBA output isn't supported by every downstream node in ComfyUI - the pack's own examples keep the image and mask separate, which is the robust pattern for anything compositing-related. Second, the author's honest framing: there's no universal best model, so this node's value is being able to compare - the 09_Compare_Models example runs ten models through this pipeline side by side. When a cutout looks bad, the fix is usually not more knobs but a different checkpoint; the knobs just let you wring out the last bit of edge quality.

CategoryRemBG_SET/Advanced

Inputs (14)

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.
widthINT10240–16384The width of the pre-processing image, does not affect the final output image size
heightINT10240–16384The height of the pre-processing image, does not affect the final output image size
upscale_methodCOMBObicubicInterpolation method for pre-processing image and post-processing mask
blur_sizeINT901–255Diameter for the coarse gaussian blur used for the `Approximate Fast Foreground Colour Estimation`
blur_size_twoINT61–255Diameter for the fine gaussian blur (see `blur_size`)
fill_colorBOOLEANfalseWhen enabled and no background is provided we fill the background using a color.
colorSTRING#000000Color for fill. Can be an hexadecimal (#RRGGBB). Can be comma separated RGB values in [0-255] or [0-1.0] range. Also `rgb(R,G,B)`, `hsv(H,S,V)` and `hsl(H,S,L) are supported. 'In addition around 140 color names are recognized
mask_thresholdFLOAT0.0000–1Most models generates masks that contain a value from 0 to 1, but can be any value in between. Matte models can estimate transparency using it. If you need to make the mask 0 or 1, but nothing in between, you can provide a threshold here. Values above it will become 1 and the rest 0.
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 (4)

NameTypeDescription
imagesIMAGEThe images with the background removed (transparent) or replaced by the background image
masksMASKThe estimated masks, where a higher value means the model estimates it belongs to the foreground with more confidence.
depthsMASKThe estimated depth map. Either from the `depths` input or computed. Note this applies only to PDFNet. This is the map generated by `Depth Anything V2`
edgesMASKThe estimated edges. This is only generated by the DiffDIS model.