Nodes/XB_ToolBox/XB-llama - ✂️ BBox转SEGS
ComfyUI Node

XB-llama - ✂️ BBox转SEGS

LLM-detected boxes, fed straight into the Impact Pack detailer

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-llama - ✂️ BBox转SEGS
  • bboxes
  • image
  • SEGS
dilation10
feather0

The Impact Pack's detailer pipeline - detect, crop, resample, paste back - runs on a data type called SEGS, and its detectors are normally YOLO models. But nothing says the detector has to be a YOLO. XB_llamaBBox2SEGS takes the boxes your local vision LLM found and packages them as SEGS, so the whole Impact Pack detailing machinery will happily detail whatever the LLM decided was worth looking at. That's a genuinely different detection source with the same downstream ecosystem: DetailerForEach, FaceDetailer, SEGS filtering, SEGS paste - all of it just works.

For the KB's masking-detection framing, this is the bridge that makes an LLM a first-class SEGS producer. Detectors are swappable; SEGS is the container they all agree on.

Inputs

  • bboxes - the BBOX list (from XB_llamaJSON2BBox).
  • image - the source image; it defines the SEGS canvas size and provides the crop content for each segment.
  • dilation - grow each box before cropping, default 10. Dilation on SEGS means each segment's crop region is bigger than the raw box, so the detail pass sees context around the subject rather than a razor-tight crop.
  • feather - gaussian blur on each segment's local mask, default 0. Softens the mask edge so the refined crop blends back in without a hard seam.

Output

One SEGS - the Impact Pack container. Each box becomes a SEG with label "bbox" and a confidence of 0.9, carrying its cropped image, cropped mask, crop region, and bounding box. Because it's real SEGS, you can run filters on it (keep only the largest, drop by confidence), feed DetailerForEach for per-region refinement, or use any Impact Pack consumer.

Installing it

XB_ToolBox install - ComfyUI Manager (XB_ToolBox) or git clone, then restart. But to do anything with the output you need the Impact Pack installed too (ltdrdata/ComfyUI-Impact-Pack via Manager) - that's where SEGS is defined, so without it the type doesn't resolve and the node can't even validate. The node itself only needs ComfyUI core + numpy/scipy.

The honest trade-offs

The big attraction: zero YOLO models to download, and the LLM finds things by natural-language description ("locate the red car") rather than a fixed class list. The cost: LLM detection is slower, less precise, and hallucination-prone compared to a purpose-trained detector - a local 8B model's boxes wobble, and it occasionally invents objects. Confidence is hard-coded to 0.9 for every segment, so you can't use it to filter out weak detections - your filter has to be before this node (prompt discipline, or eyeballing the drawn image_list from XB_llamaJSON2BBox). For rough region targeting it's brilliant and model-free; for pixel-precise face detailing, a real face detector is still the right tool.

CategoryXB-llama

Inputs (4)

NameTypeDefaultDescription
bboxesBBOX
imageIMAGE
dilationINT100–200
featherINT00–100

Outputs (1)

NameTypeDescription
SEGSSEGS