Nodes/ComfyUI_RS_NAI_API_Request/NAI Detection Combine Loader
ComfyUI Node

NAI Detection Combine Loader

One Dropdown for Every Detector (SEGM Wins by Default)

By raspie10032·Created about a year ago·Updated 2 days ago· 8
NAI Detection Combine Loader
    • detectors
    ◄face_segm_modelsegm/Anzhc Face seg 640 v2 y8n.pt►
    ◄show_optional_modelsfalse►
    ◄sam_modelOFF►
    ◄face_bbox_modelOFF►
    ◄eye_bbox_modelOFF►

    Detector setup in ComfyUI is normally three or four nodes: an Ultralytics provider for the YOLO weights, a SAM loader, another provider for the eye detector, then whatever glues them together. This node collapses that into one panel with four dropdowns and a single output, and it's the only way to feed the pack's detailers - they take a NAI_DETECTION_BUNDLE, not Impact Pack SEGS.

    The design decision baked into it is worth understanding before you touch anything: SEGM takes priority. Pick a segmentation model and the BBOX and SAM dropdowns are ignored - not just unused, but not downloaded and not loaded into memory. Only when SEGM is set to OFF does the bbox-plus-SAM path wake up. That's a real improvement over the usual SEGS soup. Polygon masks follow the face outline instead of drawing a rectangle around it, which is exactly the argument for segmentation face models in the first place: much less obvious seams.

    What the four selectors do

    face_segm_model is the required one and defaults to segm/Anzhc Face seg 640 v2 y8n.pt, a small segmentation face model. Despite the name it isn't face-only - the catalog includes Anzhc's eye and head/hair segmenters, DeepFashion2 for clothing, person_yolov8*-seg for whole people, and a skin segmenter. It's the primary region selector, so if you want to correct eyes you put an eye model here, not in the eye slot.

    show_optional_models (off by default) reveals the other three:

    • face_bbox_model - used only when SEGM is OFF. With SAM connected it gives boxes for SAM to refine; without SAM you get plain rectangles, which is a legitimate way to run a detail pass with no segmentation model at all.
    • sam_model - used only when SEGM is OFF and a bbox model is selected. Its own list is populated from Impact Pack's SAM loader, so if SAM weights aren't installed the only entry is OFF.
    • eye_bbox_model - auxiliary. It doesn't define regions; it adds eye context to the request when the primary detector already found the face.

    OFF genuinely means off. An OFF model is never downloaded and never loaded, and the built-in validation will refuse a value that isn't in the available list rather than silently falling back.

    The downloads

    The dropdowns merge two sources: whatever is already in your models/ultralytics/segm, models/ultralytics/bbox and models/sams folders (via Impact Subpack's own provider), plus a pinned catalog bundled with the pack. Selecting a catalog model queues it for download, which happens on execution, with filename, percentage and received/total MiB shown on the loader node. Files are size- and SHA-256-verified before being moved into place, interrupted downloads leave nothing behind, and the folder cache is invalidated afterwards so the new weight shows up in the list. The default face seg model is only about 6.6 MiB, so the first run is quick.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/raspie10032/ComfyUI_RS_NAI_API_Request.git
    python -m pip install -r ComfyUI_RS_NAI_API_Request/requirements.txt
    

    Then install ComfyUI-Impact-Pack and ComfyUI-Impact-Subpack - this node doesn't ship YOLO or SAM itself, it borrows the providers from those packs, and the pack's own requirements pull segment-anything for the SAM path. If either pack is missing you get an explicit "install it and restart ComfyUI" error naming which one, which is nicer than the usual import traceback. Restart after updating; refresh the model list (or the page) after dropping new .pt files into the folders.

    Common issues

    The detectors output only connects to the NAI detailer nodes. There's no SEGS anywhere in this bundle, so you can't route it into Impact Pack's DetailerForEach - that's a different plumbing contract, not a misconfiguration.

    If you set SEGM to OFF and leave bbox OFF too, nothing detects anything. The loader still returns a bundle, but the detailer rejects it with a "select a primary SEGM or BBOX model" error, which is the node doing you a favour: SAM and the auxiliary eye detector alone can't define primary regions, and the alternative would be a run that silently does nothing.

    Finally, an OFF SEGM doesn't mean the other dropdowns are wasted - it means you've chosen the legacy rectangle path. If your seams are visible, that's the setting to revisit first.

    CategoryRS_NovelAI_API

    Inputs (5)

    NameTypeDefaultDescription
    face_segm_modelCOMBOsegm/Anzhc Face seg 640 v2 y8n.ptSEGM takes priority: BBOX and SAM are skipped even if selected. Face, eyes, clothes, skin, hair and whole-person masks. Missing catalog models download on execution. Installed models in ultralytics/segm appear after refreshing the model list. OFF does not download or load SEGM.
    show_optional_modelsoptBOOLEANfalse—
    sam_modeloptCOMBOOFFUsed only when SEGM is OFF and a BBOX is selected. Refines BBOX regions into masks. Skipped with SEGM; OFF does not load SAM.
    face_bbox_modeloptCOMBOOFFUsed only when SEGM is OFF. Face, eye or hand boxes for SAM, or rectangular masks without SAM. Missing catalog models download on execution. Installed models in ultralytics/bbox appear after refreshing the model list. Skipped with SEGM; OFF does not load BBOX.
    eye_bbox_modeloptCOMBOOFFExtra eye context for the NovelAI request. OFF does not load an eye model.

    Outputs (1)

    NameTypeDescription
    detectorsNAI_DETECTION_BUNDLE—