🔎Yoloworld ESAM
Detect anything by name, get a mask back
- yolo_world_model
- esam_model
- image
- IMAGE
- MASK
This is the pack's actual headline node - the one that takes an image, a comma-separated list of things you want found, and gives you back both annotated boxes and clean masks in one pass. No training, no fine-tuning, no fixed class list. You type "car, person, red umbrella" and it goes and looks. That's the pitch, and for the most part it delivers exactly that.
What it's doing under the hood
It's a two-stage pipeline wired into one node. YOLO-World reads your categories text and runs open-vocabulary detection over the image, producing bounding boxes for anything matching those descriptions above your confidence threshold. Then, if you've asked for it, EfficientSAM takes each box and refines it into a pixel-accurate mask, the same way SAM does with a box prompt anywhere else. You get the speed of a detector and the precision of a segmenter without hand-drawing anything.
Where this actually earns its keep: selective inpainting or compositing where "select everything that's a car" beats manually painting a mask, or building an automated pipeline where the categories change per-image and you can't pre-train a fixed model for each one.
Inputs you'll actually touch
Feed in yolo_world_model and esam_model from the two loader nodes, plus your image. Past that, the one field doing all the real work is:
categories- a multiline, comma-separated list of what to look for (defaults to a COCO-flavored example: "person, bicycle, car, motorcycle…"). Replace it with whatever you're actually hunting for. This is genuinely open vocabulary, so plain descriptive phrases work, not just single nouns.
A handful of thresholds tune how trigger-happy detection is: confidence_threshold (default 0.1) - lower it to catch more borderline matches at the cost of more false positives, raise it to be pickier. iou_threshold (default 0.1) - lower keeps overlapping boxes tight and strict, raise it if legitimate overlapping detections are getting suppressed. Both are the author's own framing from the README, and both are worth nudging if you're getting nothing or getting garbage - they're the two levers to pull first.
The rest are mostly cosmetic or structural toggles: box_thickness, text_thickness, text_scale, and with_confidence control how the annotated preview looks, not what gets detected. with_class_agnostic_nms suppresses overlapping boxes across different categories, not just within one. with_segmentation (default on) is the master switch for the EfficientSAM step - turn it off and you get detection only, which is faster if you never needed masks in the first place.
Then there's the mask-shaping trio, new in V2.0: mask_combined (default on) merges every detected mask into one flattened output; turn it off and each detection gets its own separate mask instead. mask_extracted plus mask_extracted_index let you pull one specific detection out by number rather than dealing with all of them - handy when you detected five things but only want the mask for the third one. Note the V1.0/V2.0 split: the pack's older example workflows predate mask separation and extraction, so if you're following an old tutorial and these fields look unfamiliar, that's why.
Outputs
Two: IMAGE, the input picture with boxes (and labels, if with_confidence is on) drawn over it - a preview, useful for sanity-checking your categories are matching what you expect. And MASK, the actual segmentation output - this is what you wire into an inpaint node, a composite, or anywhere else downstream that wants a mask.
Installing and troubleshooting
Standard pack install - ComfyUI Manager (search ComfyUI YoloWorld-EfficientSAM) or git clone the repo into custom_nodes plus pip install -r requirements.txt, then restart. This node needs both loader nodes upstream and won't run without EfficientSAM's .jit weight files manually placed (see the ESAM Model Loader article for that step - it's the single most common setup miss). If detection is coming back empty, loosen confidence_threshold before assuming your categories are wrong - 0.1 is already fairly permissive, but oddly-phrased categories or small objects in a busy scene can still slip under it. The pack itself hasn't seen a meaningful update since early 2024, so if you're on a very recent Python (3.12 has bitten people) and installation itself is the blocker, that's a known, reported issue rather than something you're doing wrong.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| yolo_world_model | YOLOWORLDMODEL | — | |
| esam_model | ESAMMODEL | — | |
| image | IMAGE | — | |
| categories | STRING | person, bicycle, car, motorcycle, airplane, bus, train, truck, boat | — |
| confidence_threshold | FLOAT | 0.100–1 | — |
| iou_threshold | FLOAT | 0.100–1 | — |
| box_thickness | INT | 21–5 | — |
| text_thickness | INT | 21–5 | — |
| text_scale | FLOAT | 1.000–1 | — |
| with_confidence | BOOLEAN | true | — |
| with_class_agnostic_nms | BOOLEAN | false | — |
| with_segmentation | BOOLEAN | true | — |
| mask_combined | BOOLEAN | true | — |
| mask_extracted | BOOLEAN | true | — |
| mask_extracted_index | INT | 00–1000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |