Nodes/Simswap Node for ComfyUI/Build Blended Face Model
ComfyUI Node

Build Blended Face Model

Turn a few photos of someone into one reusable face model

By TaiTair·Created 2 years ago·Updated 2 years ago· 14
Build Blended Face Model
  • images
  • FACE_MODEL
save_modetrue
send_onlyfalse
face_model_namedefault
compute_methodMean

Every face swap needs a "who." In the main Simswap - Fast Face Swap node you normally supply that as a source_image on every run. Build Blended Face Model exists so you don't have to: feed it several photos of the same person, and it squeezes them down into a single FACE_MODEL - one vector that represents their identity - that the swap node can take directly. One build, reused forever.

Why feed it several photos instead of one? Same reason you'd want more than one reference photo for a LoRA: a single image gives you one embedding, and it's hostage to that particular angle and lighting. Blend three or four angles and the resulting identity is more robust, less likely to drift when the target face is posed differently. The swap itself is still a pixel-level post-process (the ReActor/inswapper family, not a generative FaceID-style adapter), so the model is just an ArcFace embedding the swapper uses to lock identity.

How it works

For each image in the batch, the node runs InsightFace detection, aligns the face, and extracts its ArcFace embedding. Then it blends all those embeddings into one using compute_method:

  • Mean (default) - averages the embeddings. The safe, boring choice that works for almost everyone.
  • Median - takes the element-wise median; shrugs off a bad outlier image.
  • Mode - the most common value per dimension. Weird for this purpose, but it's there.

The output keeps the geometry (bounding box, keypoints, pose) of the first detected face and bolts the blended embedding onto it. If save_mode is on - it is by default - the result is also written to ComfyUI/models/simswap/faces/<face_model_name>.safetensors, which is exactly the folder the Load Face Model node reads. So build once, and every workflow from then on can grab the person by name.

Inputs that matter

  • images - the batch of photos. More than one, ideally different angles.
  • compute_method - Mean / Median / Mode as above.
  • save_mode - ON by default; this is what writes the .safetensors file. Flip it off if you only want the in-memory model for this session.
  • send_only - the odd one. When ON, it skips the rebuild entirely and just passes out the last blended model this session built. Think of it as "I already built this, don't touch it again, just hand it over."
  • face_model_name - filename used when saving. Defaults to "default".

The output

One FACE_MODEL output, which you feed straight into the Simswap swap node's face_model input (in place of source_image). You can also run it into Save Face Model if you want more control over the save step. That's the whole graph: photos in, face model out, swap node reuses it.

Installing it

Same as every node in this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/TaiTair/comfyui-simswap
# or: ComfyUI Manager → search "simswap" → install
# then restart ComfyUI

The build step depends on InsightFace, which the pack pins to 0.7.3 and installs on first start - and it needs a usable detection model under ComfyUI/models/simswap (the README walks through placing one; InsightFace will otherwise try to auto-fetch buffalo_l on first use). No extra downloads beyond that for this node specifically.

Gotchas

  • Any image where InsightFace can't find a face gets skipped with a console message, not a crash. If every image fails you'll see "No face found, please try another image" - and no model gets built.
  • Images that are wildly different identities will produce a mush. This is a blend, not a composite of features; it only works if the photos are the same person.
  • The pack is unmaintained ("I will not be maintaining it," says the README), so treat the Median/Mode options as experimental. Mean has never let me down.
CategorySimswap

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
save_modeBOOLEANtrue
send_onlyBOOLEANfalse
face_model_nameSTRINGdefault
compute_methodCOMBOMean3 options: Mean, Median, Mode

Outputs (1)

NameTypeDescription
FACE_MODELFACE_MODEL