ComfyUI Node

Load Face Embeds

Your reference face's identity vector, on demand

By upseem·Created about a year ago·Updated 11 months ago· 15
Load Face Embeds
    • face_embed
    nameface_embed
    seed0

    Load Face Embeds is the reload side of a two-node trick: instead of running face analysis on your reference photo every single run, you save the resulting identity embedding once and load it back here. It's an InstantID workflow's "cache the face" button, and once you're processing batches against a single reference identity, it's the node that stops you from wasting time re-embedding the same face over and over.

    The mechanism. InstantID (which this pack, comfyui_sunxAI_facetools by Sunx.ai, wraps) turns a reference face into an embedding - the biometric-ish vector that carries the identity into generation. The pack's ApplyInstantID node emits that vector as a face_embed output. Save Face Embeds writes it to disk as ComfyUI/models/face_embeds/<name>.pt. This node reads it back: give it a name, it looks for <name>.pt in that folder, loads the cond/uncond tensors onto the GPU (fp16 on CUDA), and hands you the same FACE_EMBEDS object you'd get fresh from face analysis. It even handles the degenerate case: if what was saved is a "no face" marker, it returns that marker rather than crashing.

    The inputs. Two, and the second is a subtle one:

    • name (STRING, default "face_embed") - the filename minus the .pt. It has to match what you saved exactly; this is a plain file lookup, not a search.
    • seed (INT, default 0) - this is not a random seed. It's a cache-buster. The pack's own printout calls it "reload," and changing it forces the node to re-read the file. Same name, same seed, and ComfyUI may treat the node as unchanged and skip it; bump the seed if you suspect you're getting stale data.

    Why you'd reach for it. Speed and determinism. Face analysis on a reference image takes time and, on a single photo, its output varies slightly run to run; a saved embedding is both instant and identical every time. Typical pattern: save once when you set up a character, then load the same face_embed for every generation in a series. It also keeps long batch runs from re-running the InsightFace analysis path that this pack leans on so heavily.

    The gotcha. This is an InstantID embedding, period. The file format and the FACE_EMBEDS type are specific to this pack's InstantID nodes - don't expect PuLID, IP-Adapter FaceID, or anything else to read it, even though they all sit on the same InsightFace backbone. And the file has to exist: wrong name and the node prints a warning and returns None, which downstream InstantID nodes generally won't loudly reject - your likeness just quietly evaporates. If outputs look like the reference person "lost" their identity, check that your name matches what Save Face Embeds wrote.

    Install. With the pack, as always: ComfyUI Manager → search comfyui_sunxAI_facetools, or cd ComfyUI/custom_nodes && git clone https://github.com/upseem/comfyui_sunxAI_facetools, then restart. The dependency load is the pack's usual heavyweight roster - insightface, onnxruntime, ultralytics, mediapipe, transformers.

    Small node, quietly important: it's the difference between re-analyzing a face every run and re-using the analysis you already paid for.

    CategorysunxAI_facetools

    Inputs (2)

    NameTypeDefaultDescription
    nameSTRINGface_embed
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    face_embedFACE_EMBEDS