YOLOE-26 Prompt Segment
Type 'person, car, dog' and get a mask — this is the node that does it
- model
- image
- annotated_image
- mask
- detection_count
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. Dropimgszif 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 Model → YOLOE-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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | YOLOE_MODEL | — | |
| image | IMAGE | — | |
| prompt | STRING | person | Text prompt for open-vocabulary segmentation. Separate multiple classes with commas, e.g. 'person, car, dog'. |
| confopt | FLOAT | 0.100–1 | Detection confidence threshold. |
| iouopt | FLOAT | 0.700–1 | IoU threshold used by Ultralytics inference. |
| max_detopt | INT | 3001–1000 | Maximum number of detections returned per image. |
| mask_thresholdopt | FLOAT | 0.500–1 | Threshold 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. |
| imgszopt | INT | 64064–2048 | Inference image size. |
| show_boxesopt | BOOLEAN | true | — |
| show_labelsopt | BOOLEAN | true | — |
| show_confopt | BOOLEAN | true | — |
| show_masksopt | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| annotated_image | IMAGE | — |
| mask | MASK | — |
| detection_count | INT | — |