YOLOE-26 Instance Masks
One mask per object, so you can grab the single dog out of the pack
- model
- image
- instance_masks
- instance_metadata_json
- count
YOLOE-26 Prompt Segment gives you one merged mask for everything your prompt matched. That's fine when you want "all the people" masked at once. It's useless when you want that person - the one in the middle - and not the other eleven. This node is the per-instance version: it returns one mask per detected object, individually addressable, plus JSON that tells you which mask is which.
That single difference is what makes targeted editing possible. Per-instance masks feed per-object inpainting, one-at-a-time detail passes, object replacement, or the pack's own Select Best Instance node. Think of it as the difference between "remove the crowd" and "fix this one face."
How it works
Same segmentation pipeline as the rest of the pack - prompt to classes, set_classes() for embeddings, one predict pass with native-resolution masks. The difference is in the output stage: instead of unioning every instance into a single binary mask, the node keeps each instance's mask separate and outputs them as a batch.
The JSON it emits is what makes the batch navigable. Each entry records which input image a mask came from, its class, confidence, box, area, and - crucially - the output_mask_index, the position of that mask in the instance_masks batch. That's the key that lets other nodes (or your own scripts) map a detection record to its exact mask.
Inputs
The standard family again: model, image, prompt (comma-separated classes), conf, iou, max_det, mask_threshold, imgsz. Defaults are sane - conf 0.1, iou 0.7, max_det 300, imgsz 640. Lower conf to catch more instances, especially for anything unusual.
Outputs
instance_masks- aMASKbatch, one mask per detected instance, in detection order. Position in the batch lines up withoutput_mask_indexin the metadata.instance_metadata_json- the per-detection records with the mapping to batch positions.count- how many instances were detected.
A note on batch inputs: if you feed it several images, you get one flat batch of masks across all of them, and the metadata's batch index is how you tell which image each mask belongs to.
Installing and using it
The node lives 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 ComfyUI. First run downloads the model and, on first prompt inference, the ~250 MB MobileCLIP text encoder - online required, one time.
Where it sits in a workflow
The natural pairing is Instance Masks → Select Best Instance, which picks the single best mask from this batch and gives you just that one. You can also pipe individual masks into inpainting per instance, or use the metadata in a loop. One caution from the author's own release post: edges are rougher than SAM's, so for anything where mask quality is the whole point, consider refining with Refine Mask or handing the job to SAM. This node is for when you need to work with objects one at a time - and it does exactly that.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | YOLOE_MODEL | — | |
| image | IMAGE | — | |
| prompt | STRING | person | Text prompt for open-vocabulary segmentation. Separate multiple classes with commas. |
| 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 when binarizing 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. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| instance_masks | MASK | — |
| instance_metadata_json | STRING | — |
| count | INT | — |