Nodes/ComfyUI-Flux-FaceIR/Flux FaceIR Load RetinaFace
ComfyUI Node

Flux FaceIR Load RetinaFace

The unglamorous RetinaFace loader that every FaceIR whole-image workflow starts with

By cosmicrealm·Created 5 months ago·Updated 3 days ago· 63
Flux FaceIR Load RetinaFace
    • retinaface_model
    retinaface_name[manual path]
    networkresnet34
    deviceauto
    manual_retinaface_path

    This node restores nothing. It's the boring first step that makes the flashy ones work, and honestly that's the whole job. Flux FaceIR Load RetinaFace loads the face detector weights that Flux FaceIR Detect And Align Face runs on, so if you're doing full-image (as opposed to already-cropped) restoration, this is where your graph starts.

    If you only feed the pack aligned face crops - the aligned_face_restore.json workflow - you don't need it at all. Detection only matters when there's a whole photo to find the face in.

    How it works

    The pack registers a face_detectors model folder under ComfyUI/models, reads whatever .pth file is there, and builds a RetinaFace detector on the backbone you pick. That prepared object comes out as a RETINAFACE_MODEL, which is the custom type the rest of the pipeline consumes. It's a loader: weights in, ready-to-run detector out.

    The inputs that actually matter

    Most of the dropdowns have one right answer:

    • retinaface_name - the weights file from models/face_detectors. After you've dropped in retinaface_r34.pth it's the default.
    • network - leave it on resnet34. This is the trap: the dropdown lists seven backbones (resnet18/50, mobilenet variants…), but you only downloaded the r34 weights. Picking another backbone doesn't download anything; it just breaks.
    • device - auto is right. cuda, cpu, or mps only exist for when auto guesses wrong.
    • manual_retinaface_path - an escape hatch if your weights live somewhere the face_detectors folder can't see. Empty by default; leave it empty unless you have a reason.

    The single output, retinaface_model, wires straight into Flux FaceIR Detect And Align Face. That's it.

    Installing it

    Install the pack once, then grab the detector weights:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cosmicrealm/ComfyUI-Flux-FaceIR.git
    cd ComfyUI-Flux-FaceIR
    python install.py
    

    Or search Flux FaceIR in ComfyUI Manager / run comfy node install flux-faceir. Restart ComfyUI after. Then:

    mkdir -p ComfyUI/models/face_detectors
    wget -O ComfyUI/models/face_detectors/retinaface_r34.pth \
      https://github.com/yakhyo/retinaface-pytorch/releases/download/v0.0.1/retinaface_r34.pth
    

    Heads-up for the full pipeline: the detector is the small file. The actual restoration needs the FLUX.2-Klein base 4B model, the Qwen3-4B text encoder, the flux2 VAE, and the FaceIR LoRA - several gigabytes total. This node just gets you past detection.

    Where people get burned

    • "RetinaFace model path is empty" - the node can't find weights in face_detectors. You skipped the wget step. Fix: download the file, then fully restart ComfyUI so the dropdown refreshes.
    • Weights load, detection silently fails - check you didn't touch network. retinaface_r34.pth is a resnet34 model; run it as anything else and you're loading garbage into a differently-shaped net.
    • One genuine Windows gotcha from the wild: dependencies installed into the system Python instead of the portable install's python_embeded cause nodes to vanish entirely. If a node shows up as "missing," re-run pip install -r requirements.txt with the full path to python_embeded\python.exe.

    RetinaFace is old, proven, and license-friendly here (no Ultralytics AGPL in sight, unlike the YOLO detector route). For the detecting step of a restoration loop, that's exactly what you want.

    CategoryFlux FaceIR

    Inputs (4)

    NameTypeDefaultDescription
    retinaface_nameCOMBO[manual path]1 options: [manual path]
    networkCOMBOresnet347 options: resnet34, resnet18, resnet50, mobilenetv2, mobilenetv1, mobilenetv1_0.50, +1
    deviceCOMBOauto4 options: auto, cuda, cpu, mps
    manual_retinaface_pathSTRING

    Outputs (1)

    NameTypeDescription
    retinaface_modelRETINAFACE_MODEL