ComfyUI Node

Arc2Face UNet Loader

The UNet Loader

By caleboleary·Created 2 years ago·Updated 2 years ago· 53
Arc2Face UNet Loader
    • ARC2FACE_UNET
    model_pathdiffusion_pytorch_model.safetensors

    The Arc2Face model is a Stable Diffusion 1.5 UNet that foivospar fine-tuned on millions of face photos - the idea being that if you condition it on an ArcFace embedding instead of a text prompt, it learns to draw that specific person's face. The Arc2Face UNet Loader is the node that pulls that trained UNet into your graph. It's the first of the two loaders (this one plus the Encoder Loader) that every Arc2Face generation path needs.

    Mechanically it's refreshingly simple. It reads config.json from ComfyUI/models/arc2face_checkpoints/, builds a diffusers UNet2DConditionModel from it, then loads the weights from diffusion_pytorch_model.safetensors using safetensors' load_file. That's the whole job. No quantization, no patching, no merged checkpoints - you're loading the exact model the paper shipped.

    Input

    Just one: model_path, a STRING defaulting to diffusion_pytorch_model.safetensors. Note the subtlety - it's not an absolute path. The node joins models/arc2face_checkpoints/ with whatever string you type, so the default works if and only if you placed the safetensors file in the right folder with the right name. Set-and-forget for 99% of people, which is why it's a node with zero impressions on comfy.icu: it does its job quietly.

    Output

    ARC2FACE_UNET - the loaded UNet object. This is a pack-internal type, not a standard ComfyUI model socket, so it only plugs into the two generators (Arc2Face Generator, Arc2Face Img2Img Generator). Same story for the encoder.

    Install and file placement

    The pack install is the usual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/caleboleary/ComfyUI-Arc2Face.git
    pip install -r requirements.txt
    

    Then, from FoivosPar/Arc2Face on Hugging Face, grab arc2face/config.json and arc2face/diffusion_pytorch_model.safetensors and lay them out as:

    ComfyUI/models/arc2face_checkpoints/
    ├── config.json
    └── diffusion_pytorch_model.safetensors
    

    That's the big one - the safetensors is a couple of gigabytes. The loader will not download it for you; the author's README lists auto-downloading as a TODO, and that's still a TODO.

    Where people get burned

    • Path or name mismatch. This loader doesn't browse your models folder. If the file is named anything other than diffusion_pytorch_model.safetensors (or your model_path doesn't match), you get a file-not-found traceback that doesn't tell you where it looked. The answer is always arc2face_checkpoints/ + your string.
    • Missing config.json. The node reads it unconditionally before loading weights, so a half-downloaded model folder fails here first.
    • Don't flatten the structure. The encoder loader expects a nested encoder/ subfolder - if you tidy everything up into the root, this node keeps working while the Encoder Loader breaks. Keep the README's tree verbatim.

    One thing this loader does not do: it won't run on its own. The Generator still needs the base SD1.5 pipeline, which it downloads from Hugging Face on first run - so expect that initial delay even though the UNet is already local.

    CategoryArc2Face

    Inputs (1)

    NameTypeDefaultDescription
    model_pathSTRINGdiffusion_pytorch_model.safetensors

    Outputs (1)

    NameTypeDescription
    ARC2FACE_UNETARC2FACE_UNET