Nodes/PuLID_ComfyUI/Load InsightFace (PuLID)
ComfyUI Node Runs on cloud

Load InsightFace (PuLID)

This node is PuLID's eyes — and InsightFace's license is its leash

By cubiq·Created 2 years ago·Updated about a year ago· 910
Load InsightFace (PuLID)
    • FACEANALYSIS
    provider

    It finds the face, and that turns out to matter a lot

    Load InsightFace (PuLID) is the node that tells the pack where the face is. PuLID doesn't just need to know "a face looks like this" - it needs to know what the face looks like as a biometric identity, and that job is done by InsightFace's ArcFace models, the same recognition engine behind InstantID, IP-Adapter FaceID and Reactor. You feed it a photo, it finds the biggest face, and it hands the rest of the pipeline an identity embedding that survives pose and lighting changes.

    The node is thin. One input - provider, a dropdown with CPU, CUDA, ROCM and CoreML - and one output, FACEANALYSIS, which you wire into the Apply PuLID node alongside the reference image. Under the hood it's loading InsightFace's FaceAnalysis with the antelopev2 model pack from ComfyUI/models/insightface/models/antelopev2/. No antelopev2 files, no face detection, and the Apply node will quietly warn "No face detected" and return your model unpatched.

    The provider setting

    This is the one choice you make. CUDA is the default answer on a Windows/Linux NVIDIA box and needs the GPU build of onnxruntime; if it errors, that's the dependency you're missing. ROCM is the AMD equivalent. CoreML is what you pick on Apple Silicon. CPU always works - face detection is not that heavy - but you'll feel it in queue times, especially since detection runs on every generation, not once. If you're on a laptop and not in a hurry, CPU is fine and sidesteps the onnxruntime-gpu install headache entirely.

    The license you didn't ask for

    Here's the part nobody reads until it bites them. PuLID itself is Apache 2.0, and this pack is too - but the antelopev2 models that make this node work are non-commercial. InsightFace's code is MIT; the pretrained face models are not. That restriction rides along with every image this pipeline produces, and it's exactly why the KB tracks "getting out of the InsightFace trap" as a whole topic: detection and landmarks can be swapped for MediaPipe, but an identity embedding needs a real recognition model, and the only documented PuLID escape is the third-party lldacing Flux node's FaceNet option. On this SDXL pack there's no clean way out. If the work is for money, this node is where you should do that math before building the workflow.

    Install

    The node installs with the rest of the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cubiq/PuLID_ComfyUI
    

    Restart, then grab the antelopev2 model pack from Hugging Face and drop it at:

    ComfyUI/models/insightface/models/antelopev2/
    

    The pack's dependencies - insightface, onnxruntime and onnxruntime-gpu, plus facexlib, ftfy and timm - are in its requirements.txt; ComfyUI Manager usually resolves them, but "lots of people have issues even just installing Insightface" is a direct quote from someone who maintains several competing nodes, and it still holds. The classic symptoms: a red node on load, or a traceback naming onnxruntime when you pick CUDA. Both mean a broken dependency, not a broken workflow.

    One more thing worth knowing since it decides how good your results get: this node can only find a face if there's a face to find. A clean, sharp, front-facing reference photo is not a nice-to-have here - the README says it outright, and the difference shows up in the output. Feed it a blurry selfie and PuLID does its best with garbage.

    Categorypulid

    Inputs (1)

    NameTypeDefaultDescription
    providerCOMBO4 options: CPU, CUDA, ROCM, CoreML

    Outputs (1)

    NameTypeDescription
    FACEANALYSISFACEANALYSIS