Ultralytics Inference
The node that actually runs the detector
- model
- image
- ULTRALYTICS_RESULTS
- IMAGE
- BOXES
- MASKS
- PROBABILITIES
- KEYPOINTS
- OBB
- LABELS
- MASK
The whole pack revolves around this one. Feed it a model from either loader plus an image, and it runs Ultralytics' predict() and dumps out nine outputs - detections, masks, keypoints, labels, the works. Everything else in the pack is either loading a model, drawing on the result, or converting it to some other format. This is the engine.
Two required inputs: model (the ULTRALYTICS_MODEL from a loader) and image. The optional inputs are where the real control lives, and only three matter on day one:
- conf (0.25): the confidence threshold. Lower it to catch more objects at the cost of false positives; raise it if you're drowning in garbage detections.
- iou (0.7): how much overlap boxes may have before non-max suppression merges them. Leave it alone unless boxes are duplicating.
- height / width (640 each): inference resolution. The image gets resized to this square before detection. 640 is the YOLO sweet spot.
device (cuda:0 or cpu) picks the compute target, half runs fp16 (can crash on GPUs that don't support it), augment enables test-time augmentation (slower, slightly better recall), agnostic_nms suppresses boxes across classes, and classes is a comma-separated list of class indices - not names, which is where CocoToNumber comes in handy.
The nine outputs, and the honest version of what each is:
ULTRALYTICS_RESULTS- the raw Ultralytics result object. Feed it to UltralyticsVisualization or BBoxToCoco.IMAGE- the original image, passed through untouched. Handy passthrough so you don't need a separate copy.BOXES- YOLO-format boxes: x, y, width, height, where x/y is the center of the box. That trips people up later; BBoxToXYWH exists to fix it.LABELS- the class index for each detection, not the name.MASK- a ComfyUI-ready tensor of rectangle masks built from the boxes. This is what you feed to a mask node or an inpaint.MASKS- the raw Ultralytics segmentation masks object; mostly useful for visualization, andNonefor a plain detector.PROBABILITIES,KEYPOINTS,OBB- classification probs, pose keypoints and oriented boxes, populated only when your model produces them.
Install is the pack's shared story: ComfyUI Manager, search "ComfyUI-YOLO", or git clone https://github.com/kadirnar/ComfyUI-YOLO into custom_nodes, restart, and let Manager install ultralytics>=8.2.27. (The README's custom/nodes path is a typo.) First inference on a fresh model pays a one-time download.
Where people get burned: forgetting the 640×640 resize means small images get upscaled into the detector, which is fine but eats VRAM; feeding class names into classes instead of indices (the field wants "0", not "person"); and expecting MASKS to be a tensor you can plug into a Comfy mask node - that's MASK. Start with a plain yolov8s at conf 0.25 and it's remarkably hard to get wrong.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | ULTRALYTICS_MODEL | — | |
| image | IMAGE | — | |
| confopt | FLOAT | 0.250–1 | — |
| iouopt | FLOAT | 0.700–1 | — |
| heightopt | INT | 64064–1280 | — |
| widthopt | INT | 64064–1280 | — |
| deviceopt | COMBO | 2 options: cuda:0, cpu | |
| halfopt | BOOLEAN | false | — |
| augmentopt | BOOLEAN | false | — |
| agnostic_nmsopt | BOOLEAN | false | — |
| classesopt | STRING | None | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| ULTRALYTICS_RESULTS | ULTRALYTICS_RESULTS | — |
| IMAGE | IMAGE | — |
| BOXES | BOXES | — |
| MASKS | MASKS | — |
| PROBABILITIES | PROBABILITIES | — |
| KEYPOINTS | KEYPOINTS | — |
| OBB | OBB | — |
| LABELS | LABELS | — |
| MASK | MASK | — |