Nodes/lzits Nodes/YOLO Get Boxes
ComfyUI Node

YOLO Get Boxes

Let YOLO find the objects so you don't have to

By lzitser23·Created 9 months ago·Updated 3 months ago· 0
YOLO Get Boxes
  • image
  • detections
  • preview
model
conf_threshold0.25

Before you can move an object in an image, someone has to say where it is. That's usually you, staring at pixels and estimating a bounding box. YOLO Get Boxes offloads it: it runs a real YOLOv8 detection model on the image and returns a structured list of detections - plus a preview image with every found object boxed in yellow so you can see what the model thinks it sees.

The mechanism

It's a thin wrapper around ultralytics' YOLO, which is the pack's one declared Python dependency. You pick a model size from the dropdown - yolov8n through yolov8x (nano to extra-large) - and the first time you use one, ultralytics downloads the .pt weights automatically (a few MB for nano up to ~130 MB for x). Detection runs on the first image of the input batch, at your conf_threshold.

Inputs

  • image (IMAGE) - the frame to detect on.
  • model - dropdown of the five YOLOv8 sizes. Nano is fast and occasionally misses small objects; x is slow and accurate. Start with yolov8s or yolov8m and only go bigger if detections are genuinely wrong.
  • conf_threshold (0.01–1, default 0.25) - how confident the model must be to report a box. Lower it if objects are being missed; raise it if the preview is cluttered with false positives.

Outputs

  • detections (type YOLO_DETECTIONS) - the structured list, each entry carrying label, confidence, and x1,y1,x2,y2. Feed it to this pack's Object Selector to pull out the one box you care about.
  • preview (IMAGE) - the image with yellow boxes and label confidence captions drawn on. Wire this to a Preview node so you can read off the exact label names before wiring the selector.

Labels, and the workflow shape

YOLOv8's stock models are trained on COCO, so the vocabulary is the everyday one - person, car, dog, truck, umbrella, etc. If your target isn't a COCO class, detection won't find it; for those cases the pack's Bounding Box Draw node is the manual alternative (you drag the box yourself).

The canonical flow: YOLOGetBoxes → Object Selector ("person") → its x1,y1,x2,y2 into the source box of an object-move workflow, with the preview wired to a viewer so you can verify before you commit to a render.

Gotchas

  • If you get "ultralytics is not installed" at runtime, install it: pip install ultralytics into ComfyUI's Python. It's the one heavy-ish dependency this pack has, and it only matters for the YOLO nodes.
  • Only the first image of a batch gets detected - if you feed a video clip's frames and expect per-frame boxes, you'll get one detection set.
  • First run downloads weights from the network; the graph will look stuck on a slow connection.

Installing this node

One of the 16 nodes in the lzits Nodes pack (Lior Zitser, MIT). Install via ComfyUI Manager (search "lzits Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/lzitser23/lzits-nodes.git

Restart ComfyUI, then make sure ultralytics is present:

pip install ultralytics
Categorylzits nodes

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
modelCOMBO5 options: yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt, yolov8x.pt
conf_thresholdFLOAT0.250.01–1

Outputs (2)

NameTypeDescription
detectionsYOLO_DETECTIONS
previewIMAGE