ComfyUI Node

YOLOE-26 Prompt Segment

Type 'person, car, dog' and get a mask — this is the node that does it

By Rinne414·Created 6 months ago·Updated 2 months ago· 11
YOLOE-26 Prompt Segment
  • model
  • image
  • annotated_image
  • mask
  • detection_count
promptperson
conf0.10
iou0.70
max_det300
mask_threshold0.50
imgsz640
show_boxestrue
show_labelstrue
show_conftrue
show_maskstrue

This is the main event. Give it an image and a comma-separated list of things, and it returns a mask of everything that matched - no fixed class list, no trained detector for your specific object, just words. person, car, dog and you get a merged binary mask covering all three.

The author says it plainly in the release thread: this is not a SAM replacement. Where SAM wins on edge precision and supports points and boxes, YOLOE-26 wins on speed and VRAM - it's real-time capable and runs happily in 4–6 GB. The author's own advice is to think of it as "get a rough mask fast, refine with SAM later." If you need surgical edges, use SAM. If you're iterating quickly or batch-processing on a weak GPU, this is your node.

How it works

Your prompt gets split on commas into class names, which are fed to the model's set_classes() - that's the open-vocabulary trick, computing text embeddings on the fly instead of looking up a fixed training set. It's the expensive step, so the node caches it per model and skips it if you don't change the prompt. Then it runs a single YOLOE-26 predict pass with retina_masks enabled, which matters more than it sounds: masks come back at the original image resolution, aligned with the detection boxes, instead of in the letterboxed inference space. That's what makes the mask usable for inpainting and compositing without awkward rescaling.

Inputs that matter

  • prompt - comma-separated class names. Keep it plain: person, car, red apple. Obscure or rare objects detect poorly, which is a known limitation of the model, not a bug in the node.
  • conf - confidence threshold, default 0.1. Getting no detections? Lower it. The author's tested tip for hard targets (feet, oddly-shaped stuff) is 0.1 or lower plus the biggest model (yoloe-26x-seg.pt).
  • iou (0.7), max_det (300), imgsz (640) - standard Ultralytics inference knobs. Drop imgsz if you're out of VRAM.
  • mask_threshold (0.5) - here's the trap: recent Ultralytics releases already return binary masks, so values below 1.0 do nothing, and setting it to exactly 1.0 empties every mask. If your masks come back empty, check this before anything else.
  • show_boxes / show_labels / show_conf / show_masks - purely cosmetic, control what the preview image draws. Turn them off for a clean annotated render.

Outputs

  • annotated_image - the input with boxes, labels, and mask overlays drawn on. Great for eyeballing whether the prompt matched what you meant.
  • mask - the merged binary mask at original resolution. This is what you wire into an inpainting or compositing setup: Set Mask → InpaintModelConditioning → your sampler, or straight into a background-removal flow.
  • detection_count - how many instances matched, summed across the whole batch. Handy for logic in more elaborate graphs.

Installing and running it

The node ships in the Rinne414/ComfyUI-YOLOE26 pack. Install via ComfyUI Manager (search YOLOE-26) or:

cd ComfyUI/custom_nodes
git clone https://github.com/Rinne414/ComfyUI-YOLOE26.git
pip install -r ComfyUI-YOLOE26/requirements.txt

Restart, then chain: YOLOE-26 Load ModelYOLOE-26 Prompt Segment → image in, person in the prompt, run. The first run downloads the model and, on the first text-prompt inference, the ~250 MB MobileCLIP text encoder - so your very first execution needs network and looks stuck. Let it finish.

When it goes wrong

No detections means conf too high or a prompt that names something the model barely knows. Out of memory means lower imgsz or switch on offload_to_cpu on the loader. Empty masks mean the mask_threshold got set to 1.0. All three are quick fixes, and all three have bitten someone - the tooltips in the node literally spell them out.

A final take: for faces, hands, and people specifically, a purpose-trained YOLO detector plus a detailer is still faster and more reliable than describing "a face" in words. This node shines for the one-off object you have no detector for - that's the niche, and it fills it well.

CategoryYOLOE26

Inputs (12)

NameTypeDefaultDescription
modelYOLOE_MODEL
imageIMAGE
promptSTRINGpersonText prompt for open-vocabulary segmentation. Separate multiple classes with commas, e.g. 'person, car, dog'.
confoptFLOAT0.100–1Detection confidence threshold.
iouoptFLOAT0.700–1IoU threshold used by Ultralytics inference.
max_detoptINT3001–1000Maximum number of detections returned per image.
mask_thresholdoptFLOAT0.500–1Threshold used to binarize instance masks. Recent Ultralytics releases already return binary masks, in which case values below 1.0 have no additional effect and exactly 1.0 empties every mask.
imgszoptINT64064–2048Inference image size.
show_boxesoptBOOLEANtrue
show_labelsoptBOOLEANtrue
show_confoptBOOLEANtrue
show_masksoptBOOLEANtrue

Outputs (3)

NameTypeDescription
annotated_imageIMAGE
maskMASK
detection_countINT