Nodes/Transparency Background Remover/Auto GrabCut Background Remover
ComfyUI Node

Auto GrabCut Background Remover

Automatic object detection (YOLO) + GrabCut refinement. Produces an IMAGE (RGBA or binary MASK), a MASK, bbox coordinate string, confidence score, metrics, and a structured BBOX_TENSOR.

By Limbicnation·Created about a year ago·Updated 4 months ago· 21
Auto GrabCut Background Remover
  • image
  • initial_mask
  • image
  • mask
  • bbox_coords
  • confidence
  • metrics
  • bbox_tensor
object_class
confidence_threshold0.50
grabcut_iterations5
margin_pixels20
edge_refinement0.7
edge_blur_amount0.0
bbox_safety_margin30
min_bbox_size64
fallback_margin_percent0.20
binary_threshold200
output_sizeORIGINAL
scaling_methodNEAREST
auto_adjustfalse
output_formatRGBA
invert_maskfalse
custom_width512
custom_height512
edge_detection_modeAUTO
Categoryimage/processing

Inputs (20)

NameTypeDefaultDescription
imageIMAGE
object_classCOMBO7 options: auto, person, product, vehicle, animal, furniture, +1
confidence_thresholdFLOAT0.500.3–0.9Minimum confidence for object detection
grabcut_iterationsINT51–10Number of GrabCut algorithm iterations
margin_pixelsINT200–50Pixel margin around detected object
edge_refinementFLOAT0.70–1Edge refinement strength (0=none, 1=maximum)
edge_blur_amountFLOAT0.00–10Amount of Gaussian blur to apply to mask edges (0=none, 10=maximum)
bbox_safety_marginINT300–100Extra pixels beyond detected bounding box for safety
min_bbox_sizeINT6432–256Minimum bounding box dimensions to prevent over-cropping
fallback_margin_percentFLOAT0.200.1–0.5Margin percentage for fallback bbox when no object detected
binary_thresholdINT200128–250Threshold for binary mask conversion
output_sizeCOMBOORIGINALTarget output size for the processed image and mask
scaling_methodCOMBONEARESTInterpolation method for scaling: NEAREST (pixel-perfect), BILINEAR (smooth), BICUBIC (high-quality), LANCZOS (best quality)
auto_adjustBOOLEANfalseAutomatically adjust parameters based on image content analysis
initial_maskoptMASK
output_formatoptCOMBORGBAOutput format: RGBA with alpha channel or binary MASK (0=background, 255=foreground)
invert_maskoptBOOLEANfalseInvert the output alpha/mask (swap foreground and background)
custom_widthoptINT51264–4096Custom width (used when output_size is 'custom')
custom_heightoptINT51264–4096Custom height (used when output_size is 'custom')
edge_detection_modeoptCOMBOAUTOEdge detection optimization: AUTO (detect content type), PIXEL_ART (sharp edges), PHOTOGRAPHIC (smooth edges)

Outputs (6)

NameTypeDescription
imageIMAGE
maskMASK
bbox_coordsSTRING
confidenceFLOAT
metricsSTRING
bbox_tensorBBOX_TENSOR