Nodes/ComfyUI-PuLID-Flux2/Load InsightFace (PuLID)
ComfyUI Node

Load InsightFace (PuLID)

Pick CPU, CUDA, or ROCM and let it find the faces

By iFayens·Created 6 months ago·Updated 4 months ago· 119
Load InsightFace (PuLID)
    • INSIGHTFACE
    provider

    Every PuLID workflow needs a face detector, and this is it. Load InsightFace (PuLID) (PuLIDInsightFaceLoader) boots the InsightFace antelopev2 model - the same ArcFace-based detector/embedder used by InstantID and IP-Adapter FaceID - that finds faces in your reference photo and computes the identity embedding PuLID builds its tokens from.

    It's a tiny node with exactly one input and one output. Don't let the smallness fool you: half the "PuLID doesn't work" reports in the wild trace back to this loader failing to find its model files.

    The one input: provider

    An enum with three choices: CPU, CUDA, ROCM. This maps directly onto the ONNX execution provider InsightFace uses underneath.

    • CUDA - what you want on an NVIDIA card with a working CUDA setup.
    • ROCM - for AMD.
    • CPU - the fallback that just works, and honestly fine for a single face per image. Face detection is not the bottleneck in a PuLID pipeline; the diffusion model is. Start with CUDA, and if the loader throws, drop to CPU.

    The output, INSIGHTFACE, wires into the face_analysis input of Apply PuLID ✦ Flux.2 - and also into the pack's PuLID - Face Preview node, if you want to see what it's detecting. Like the EVA-CLIP loader, the model is cached globally, so you pay the load cost once per session.

    Install and the model files

    The node ships in the iFayens/ComfyUI-PuLID-Flux2 pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/iFayens/ComfyUI-PuLID-Flux2.git
    cd ComfyUI-PuLID-Flux2
    pip install insightface onnxruntime-gpu open-clip-torch safetensors ml_dtypes==0.3.2
    

    But the code is the easy half. InsightFace's antelopev2 ONNX files aren't bundled with the pack - you download them from MonsterMMORPG/InstantID_Models and place them at:

    ComfyUI/models/insightface/models/antelopev2/
    

    Get the nesting wrong (the code looks for antelopev2 inside models/insightface/models/) and the loader fails with an error about loading InsightFace, which reads like a dependency problem but is really a file-placement problem. The README's own warning covers the other common failure: if you already have a working ComfyUI, don't run the full requirements.txt - just install the five packages above. InsightFace has historically been finicky to install (the community has griped about it for years), and onnxruntime-gpu needs a CUDA version matching your driver. When in doubt, pip install onnxruntime for the CPU fallback and use the CPU provider.

    A license heads-up

    The insightface Python library is MIT-licensed, but the pretrained ONNX models it loads are not - they're non-commercial. That's a real constraint on any commercial work, not just this pack: every ArcFace-based tool (InstantID, IP-Adapter FaceID, Reactor, PuLID) inherits it. If that matters to you, know it now rather than after you've built the pipeline.

    CategoryPuLID-Flux2

    Inputs (1)

    NameTypeDefaultDescription
    providerCOMBO3 options: CPU, CUDA, ROCM

    Outputs (1)

    NameTypeDescription
    INSIGHTFACEINSIGHTFACE