Shima Interactive SEGSelector
Pick detection regions by clicking, not by guessing index numbers
- segs
- image
- filtered_segs
Detectors are greedy. A YOLO face detector finds twelve faces in your group shot when you only want to re-detail two of them, and then you're either hand-editing comma-separated indices or building filters. Shima SEGSelector exists so you don't have to guess: it takes your image plus the SEGS, draws the detection boxes into the frontend, and lets you pick which segments survive by clicking. The filtered list comes out the other end as valid SEGS.
How it works
The node sends the first image in the batch and the full SEG metadata - bounding boxes, labels, confidence scores, selection state - to the frontend, which renders the boxes over the image for interactive picking. Your picks get serialized back into the selected_indices widget as a comma-separated string like "0, 2, 4". The backend parses that, keeps only the matching segments, and rebuilds the SEGS tuple exactly to Impact Pack's spec.
The "all" semantics are worth knowing. selected_indices defaults to "all", and what "all" means is decided by fallback_behavior: Output All passes the entire SEGS through, Output None returns an empty set. So on first run before you've picked anything, the node still does something sensible instead of dying. Once you pick specific indices, only those come through.
Inputs: segs, image, selected_indices (widget, usually driven by the picker), and fallback_behavior. Output: filtered_segs. It's marked as an output node so the UI interaction always gets a chance to fire.
Installing it
Part of KDB-USJP/shima_wf:
cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf
Restart ComfyUI. Since SEGS comes from ComfyUI-Impact-Pack, you need that pack installed - the Shima installer clones it automatically if it's missing. No model downloads involved.
Where it shines and where it stumbles
This is the right tool when you're curating a specific composition - "detail these three faces, not the crowd." It's less useful in automated batch pipelines, where the interactive click is exactly what you don't want, and the comma-index approach ends up being set once and never touched again.
Two gotchas. First, the indices are zero-based and positional - re-run your detector with a slightly different threshold and segment 3 might be a different person, so stale selections silently pick the wrong thing. Second, if the picker UI doesn't appear (older frontend, missing custom JS), you can still type indices directly into the widget, which is the escape hatch that keeps the workflow functional. Small, focused, and genuinely nicer than raw index typing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — | |
| image | IMAGE | — | |
| selected_indices | STRING | all | — |
| fallback_behavioropt | COMBO | Output All | 2 options: Output All, Output None |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filtered_segs | SEGS | — |