Nodes/ComfyUI Impact Subpack/UltralyticsDetectorProvider
ComfyUI Node

UltralyticsDetectorProvider

The detector that feeds FaceDetailer

By ltdrdata·Created 3 years ago·Updated about a year ago· 371
UltralyticsDetectorProvider
    • BBOX_DETECTOR
    • SEGM_DETECTOR
    model_name

    If you dropped a FaceDetailer into your graph and it's got an angry red bbox_detector slot that won't connect to anything, this is the node that fills it. UltralyticsDetectorProvider answers "what am I looking for" before the Impact Pack does the actual fixing. It's unglamorous plumbing, and the whole detail-refinement loop is dead in the water without it.

    What it actually does

    The Impact Pack's headline trick is the detect-crop-resample-paste loop: find a face (or hand, or eyes) too small in the frame to survive the latent, crop that region, run a fresh sampling pass on it at proper resolution, and composite it back. A face living in 80x80 pixels of a 1024x1024 render gets 80x80 worth of the model's attention and comes out looking melted; this loop gives it a full pass of its own. That's what FaceDetailer and Detailer (SEGS) do.

    But those nodes don't know what a face is. They need a detector handed to them, and this is the loader that reads a YOLO model off disk and hands out a detector object they can consume. It's the "which body part, and how precisely" dial for the pipeline.

    YOLO here means Ultralytics' object-detection models - the same .pt weights A1111's ADetailer uses, which is no coincidence: both tools largely run the same Bingsu detection models. You're not choosing between better and worse detection, just between two hosts. This one lives in ComfyUI.

    bbox vs segm, and why there are two outputs

    The node has one input that matters, model_name - a dropdown of whatever detection models you've dropped into your ultralytics folders. Everything downstream flows from which one you pick.

    There are two outputs: BBOX_DETECTOR and SEGM_DETECTOR, and the difference is the mask shape each produces. A bbox (bounding-box) model gives a rectangle around what it found. A segm (segmentation) model gives a polygon that hugs the outline - far less visible seam when the refined patch gets pasted back, so it's the nicer choice wherever a boxy halo would show.

    One genuinely useful quirk from the README: for a segm model you get a BBOX_DETECTOR out of it too (it just boxes the segmentation). A plain bbox model only gives you the box. So if you're unsure, a segm model is the more flexible thing to load. Wire the output that matches your downstream slot and leave the other dangling.

    The model names tell you what you're getting: face_yolov8m.pt, hand_yolov8s.pt, person_yolov8m-seg.pt. The n/s/m is nano/small/medium - bigger is slower but catches more, so s or m beats the tiny nano. The -seg suffix marks a segmentation model.

    Installing it (and why it's a subpack)

    Easiest path: open ComfyUI-Manager, search ComfyUI Impact Subpack, hit Install, restart. Done.

    Manual, if you must: cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Impact-Subpack, then pip install -r requirements.txt - and this bites people, so read it: install into the same Python environment ComfyUI runs in. Portable builds use python_embeded\python.exe -m pip; a venv needs activating first. Then restart.

    Here's the part that trips up newcomers. The detector used to ship inside the main Impact Pack. As of Impact Pack v8.0 it got carved out into this separately-installed subpack, so installing Impact Pack alone no longer gets you YOLO detection - you need this too. The Ultralytics dependency is also AGPL: a non-issue for personal work, worth checking before you ship commercially.

    The node ships no models; you feed it. Save them into models/ultralytics/bbox and models/ultralytics/segm by type - a bbox model in the segm folder won't show up where you expect. ComfyUI-Manager's Model Manager has a pile if you search ultralytics; beyond that, Bingsu's adetailer repo on HuggingFace has the standard face/hand/person set, ultralytics/assets has the rest, and CivitAI has a cottage industry of purpose-trained detectors (a lot of it NSFW, fair warning).

    When it breaks

    The dropdown is empty. You installed the node but never downloaded a model. Grab one, drop it in models/ultralytics/bbox or /segm, and refresh - the list is read straight from those folders.

    The model refuses to load on newer PyTorch. PyTorch 2.6+ tightened model loading (weights_only) because a .pt file can execute arbitrary code, and older YOLO files sometimes fail the new safety check. The pack's fix, straight from the README: list the model's path in <user_directory>/default/ComfyUI-Impact-Subpack/model-whitelist.txt (user dir is usually ComfyUI/user) to disable the restriction for that specific file. Only whitelist models you actually trust.

    That last one isn't paranoia. In December 2024 a compromised release of the Ultralytics package shipped a cryptominer, and Impact Pack was the route it reached ComfyUI users - the risk lived in the pip dependency, not the node. That history is a decent chunk of why the dependency is opt-in now, and why "only load models you trust" is the actual rule, not boilerplate.

    CategoryImpactPack

    Inputs (1)

    NameTypeDefaultDescription
    model_nameCOMBO3 options: bbox/face_yolov8m.pt, bbox/hand_yolov8s.pt, segm/person_yolov8m-seg.pt

    Outputs (2)

    NameTypeDescription
    BBOX_DETECTORBBOX_DETECTOR
    SEGM_DETECTORSEGM_DETECTOR