🍒YOLOWorld_Match🔍特征匹配
Zero-shot image gating with YOLO-World
- image
- result
YOLOWorld_Match answers a deceptively useful question: does this image contain the thing I name? Type a category like "person" or "cat" or "red car," feed it an image, and it returns "true" or "false". That's it - no masks, no boxes, no coordinates. A boolean-as-string you can gate a workflow on.
It's the classification sibling of the pack's YOLO_Multi_Crop, and it runs on YOLO-World, the open-vocabulary detection model. Where a regular YOLO is stuck with whatever classes it was trained on, YOLO-World lets you name the class at inference time. The README positions it as image classification - sort your output folders by content, keep only generations that match your prompt, reject images that don't. Hook result into a conditional route or a save-path decision and your batch pipeline starts sorting itself.
The mechanism. It loads a YOLO-World model, checks your category string against the model's known class names, and runs detection. If the named category is detected at or above confidence_threshold, you get "true"; otherwise "false". If the category isn't in the model's vocabulary at all, it returns "false" without even running inference. Multiple input images produce a comma-joined string of results.
Inputs that matter.
image- the image to test.yolo_world_model- dropdown listing.ptfiles inComfyUI/models/yolo-world/. Empty until you add weights (see install).category- STRING, default"person". The object you're looking for. This is the whole point of YOLO-World: you can put any noun here.confidence_threshold- FLOAT, default 0.25. YOLO-World is more tentative than a fixed-class model, so the low default is deliberate; raise it if you're getting false matches.
Output. result - a STRING, "true" or "false". Don't wire it into a BOOLEAN socket expecting it to just work; compare it with a text-match or string-to-bool node if your downstream needs a real boolean.
Gotchas. The "any category" pitch has a fence around it: YOLO-World's vocabulary is set by the model file you load. A general yolov8s-worldv2.pt knows a broad set of everyday objects, but it's not infinite and not great at very specific or abstract terms - "cyberpunk samurai" will reliably return false. Keep categories concrete and physical. And the community's recurring YOLO complaint applies here in milder form: detection boxes can be generous, so an object near your subject can register as a match - that's a confidence-threshold conversation, not a node bug.
Install. Part of KimNodes (wjl0313's 🍒 toolbox on the Comfy registry). ComfyUI Manager → search "ComfyUI_KimNodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/wjl0313/ComfyUI_KimNodes
Then the two steps the README skips. The pack's requirements.txt only lists pixeloe, so ultralytics won't be there:
pip install ultralytics
And drop a YOLO-World weights file (e.g. yolov8s-worldv2.pt or yolov8m-worldv2.pt, from the ultralytics releases or Hugging Face) into:
ComfyUI/models/yolo-world/
Empty folder → empty dropdown → node does nothing. Same trap as YOLO_Multi_Crop, different directory.
Troubleshooting. Always-false with a valid category → check the model's vocabulary or drop the confidence threshold. Empty dropdown → weights missing from models/yolo-world/. Import error on load → ultralytics missing, install it and restart. And if you're feeding it a batch of frames and the comma-joined string confuses your downstream logic, split it or test images one at a time.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| yolo_world_model | COMBO | 0 options: | |
| confidence_threshold | FLOAT | 0.250–1 | — |
| category | STRING | person | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |