ComfyUI Node

✂️ Object Segmentation

The 'SAM integration' that draws shapes instead of segmenting anything

By kanibus·Created about a year ago·Updated about a year ago· 5
✂️ Object Segmentation
  • image
  • masks
  • segmented_image
  • mask_overlay
  • mask_count
segmentation_modeeverything
prompt_points
bounding_boxes
min_mask_area1000
max_masks10
wan_versionauto
enable_t2i_adaptertrue
cache_resultstrue

Here's the shortest honest review of ObjectSegmentation: its docstring says "Segment objects using SAM." It does not use SAM. It does not segment objects. It draws a rectangle, a circle, and maybe a polygon on your frame and calls the result segmentation.

This is one of the placeholder nodes that make the kanibus/kanibus pack (Claude-generated, last commit Aug 2025) a minefield for beginners. The pattern is consistent: polished input/output schemas, enterprise-flavored naming, and inside, a stub that never runs a model. ObjectSegmentation is the clearest example because the code isn't even trying to hide it.

What it actually does

Open nodes/object_segmentation.py and read segment_objects: it converts your image, then - regardless of content - creates up to three masks drawn as geometric primitives:

  • a rectangle centered on the frame
  • a circle centered on the frame
  • a hexagon-ish polygon (only in wan_2.2 mode)

The segmentation_mode selector (everything/prompt/box/point) is accepted and never read. The prompt_points and bounding_boxes text inputs are accepted and never read. You can type a detailed prompt into prompt_points and it will do absolutely nothing. min_mask_area filters the fake shapes by pixel area, and max_masks caps how many fake shapes you get - those two are the only knobs with any effect.

Outputs: masks (SEGMENTATION_MASKS - a list of mask dicts), segmented_image (IMAGE with colored contours drawn), mask_overlay (IMAGE with translucent color fill), mask_count (INT).

The inputs that matter

None of them change what's detected, because nothing is detected. min_mask_area and max_masks are the only inputs with real behavior (they filter/count the canned shapes). Everything else is decoration.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/kanibus/kanibus
cd kanibus    # lowercase - README's "cd Kanibus" fails on case-sensitive systems
pip install -r requirements.txt   # or requirements_minimal.txt if it clashes
python install.py

Restart ComfyUI, find it under Kanibus. It loads no SAM weights - there's no SAM. (The README's "5.6GB of required ControlNet models" doesn't apply either.)

What to do instead

Real segmentation in ComfyUI is a solved problem with mature options - SAM/SAM2 nodes, CLIPSeg for text-prompted segmentation, BiRefNet, and YOLO-seg packs all genuinely segment. If you specifically want text-driven masks, prompt_points here will never help you; a CLIPSeg-based node will. For the pack's own scope, the honest value stays in the MediaPipe tracking nodes and the real utilities - this one is the mock-up.

Troubleshooting

  • Masks don't match objects in the image - not a bug; it's not looking at the image. The rectangle and circle are always centered.
  • mask_count is 1–3 regardless of scene - correct, it counts drawn primitives.
  • Prompt input "not working" - it isn't a prompt input in any functional sense. Stop typing into it.

Bottom line: if a workflow you grabbed includes this node, delete it and add a real segmentation node. It will happily draw its little shapes forever and never once tell you anything about the actual contents of your image.

CategoryKanibus

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
segmentation_modeCOMBOeverything4 options: everything, prompt, box, point
prompt_pointsoptSTRING
bounding_boxesoptSTRING
min_mask_areaoptINT1000100–50000
max_masksoptINT101–50
wan_versionoptCOMBOauto3 options: wan_2.1, wan_2.2, auto
enable_t2i_adapteroptBOOLEANtrue
cache_resultsoptBOOLEANtrue

Outputs (4)

NameTypeDescription
masksSEGMENTATION_MASKS
segmented_imageIMAGE
mask_overlayIMAGE
mask_countINT