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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| object_class | COMBO | 7 options: auto, person, product, vehicle, animal, furniture, +1 | |
| confidence_threshold | FLOAT | 0.500.3–0.9 | Minimum confidence for object detection |
| grabcut_iterations | INT | 51–10 | Number of GrabCut algorithm iterations |
| margin_pixels | INT | 200–50 | Pixel margin around detected object |
| edge_refinement | FLOAT | 0.70–1 | Edge refinement strength (0=none, 1=maximum) |
| edge_blur_amount | FLOAT | 0.00–10 | Amount of Gaussian blur to apply to mask edges (0=none, 10=maximum) |
| bbox_safety_margin | INT | 300–100 | Extra pixels beyond detected bounding box for safety |
| min_bbox_size | INT | 6432–256 | Minimum bounding box dimensions to prevent over-cropping |
| fallback_margin_percent | FLOAT | 0.200.1–0.5 | Margin percentage for fallback bbox when no object detected |
| binary_threshold | INT | 200128–250 | Threshold for binary mask conversion |
| output_size | COMBO | ORIGINAL | Target output size for the processed image and mask |
| scaling_method | COMBO | NEAREST | Interpolation method for scaling: NEAREST (pixel-perfect), BILINEAR (smooth), BICUBIC (high-quality), LANCZOS (best quality) |
| auto_adjust | BOOLEAN | false | Automatically adjust parameters based on image content analysis |
| initial_maskopt | MASK | — | |
| output_formatopt | COMBO | RGBA | Output format: RGBA with alpha channel or binary MASK (0=background, 255=foreground) |
| invert_maskopt | BOOLEAN | false | Invert the output alpha/mask (swap foreground and background) |
| custom_widthopt | INT | 51264–4096 | Custom width (used when output_size is 'custom') |
| custom_heightopt | INT | 51264–4096 | Custom height (used when output_size is 'custom') |
| edge_detection_modeopt | COMBO | AUTO | Edge detection optimization: AUTO (detect content type), PIXEL_ART (sharp edges), PHOTOGRAPHIC (smooth edges) |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| bbox_coords | STRING | — |
| confidence | FLOAT | — |
| metrics | STRING | — |
| bbox_tensor | BBOX_TENSOR | — |