🎭 Yolo Seg Mask
Point a YOLOv8 model at an image, get a mask back
- image
- image
- mask
- all_id
- num_objects
Yolo Seg Mask finds things in an image with a YOLOv8 segmentation model and hands you back a ready-to-use mask - no manual mask painting, no separate detection-then-convert pipeline. Point it at faces, hair, skin, anime characters, even flowers, and it'll draw the mask for whatever the chosen model was trained to find.
If you've used FaceDetailer from Impact Pack, this is doing the same underlying detection job - YOLOv8 segmentation weights from the same family (the Bingsu/adetailer model zoo that both ADetailer and Impact Pack draw on) - just wrapped differently. Impact Pack's detailers run the whole detect → crop → resample → paste-back loop internally; SDVN's version stops one step earlier and just gives you the mask, which you then feed into whatever inpaint or compositing step you want. That's less automated, but more composable if you already have your own masked-region workflow built around SDVN's Inpaint or Crop Inpaint nodes.
How it works
model_name picks which trained YOLOv8 model runs - and the pack ships a genuinely wide zoo here, not just faces: hair, skin, facial features, human-body parsing, pose, and even non-human targets like flowers or anime-style segmentation. The model scans the image, proposes detected regions above your score confidence threshold, and returns them as a mask. When it finds more than one instance (multiple faces in a group shot, say), id lets you pull out one specific detection instead of getting everything merged into a single mask.
Inputs and outputs
image(IMAGE, required) - the source to scan.model_name(enum, defaultface_yolov8n-seg2_60.pt) - which YOLOv8 segmentation model to run. Face variants are the default; the dropdown also covers hair, skin, facial features, human parsing, pose, anime, and more.score(FLOAT, default 0.6, range 0.01–1) - the detection confidence threshold. Raise it if you're getting false-positive junk in the mask; lower it if it's missing things that are clearly there.id(STRING, optional, default empty) - leave blank to merge every detection into one mask; fill it in to isolate a single detected instance once you know its id.image(output) - the original image passed through, for convenience.mask(MASK output) - the actual result, wire this into an inpaint node or VAE encode-for-inpainting step.all_id(STRING output) - every detected instance's id, so you know what's available before you fill inid.num_objects(INT output) - how many things it found.
Common issues
YOLO detection needs the model file present, and per the pack's general pattern most model-consuming nodes auto-fetch on first use - but if a .pt file fails to download (Windows/macOS need aria2c installed manually per the README for auto-download nodes generally), the node will error rather than silently produce an empty mask. If it doesn't show up in the model list or errors immediately, check that step first.
A half-installed Python environment is the most common way this kind of node breaks. YOLOv8 detection means an Ultralytics-family dependency under the hood, which is exactly the kind of thing that can silently fail to install if pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt didn't fully complete. If the node is missing from your menu entirely rather than just erroring, that's almost certainly the cause - rerun the requirements install from the ComfyUI root.
score is a blunt instrument for precision. If you need to exclude one specific false positive while keeping everything else at a lower threshold, tune id after inspecting all_id rather than fighting the global score value - it applies to every detection in the image uniformly.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Ảnh đầu vào | |
| model_name | COMBO | face_yolov8n-seg2_60.pt | Tên mô hình YOLO |
| score | FLOAT | 0.600.01–1 | Ngưỡng điểm |
| id | STRING | Lọc ID đối tượng |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Ảnh với vùng phát hiện |
| mask | MASK | Mask vùng phát hiện |
| all_id | STRING | Danh sách ID đối tượng |
| num_objects | INT | Số lượng đối tượng |