Nodes/ComfyUI-NuA-FlashFace/FlashFace Sampler
ComfyUI Node

FlashFace Sampler

FlashFace Sampler Is Its Own Face Machine

By nuanarchy·Created 2 years ago·Updated 2 years ago· 25
FlashFace Sampler
  • flashface_models
  • reference_faces
  • IMAGE
positivebest quality, masterpiece,ultra-detailed, UHD 4K, photographic
negativeblurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face
steps35
height768
width768
face_bbox_x10.4
face_bbox_y10.3
face_bbox_x20.6
face_bbox_y20.6
lamda_feat1.2
lamda_feat_before_ref_guidence0.8
face_guidence3.2
step_to_launch_face_guidence750
text_control_scale7.5
seed0

Give FlashFace Sampler one photo of a person and it hands you a new image of that same person - different pose, different scene, aged up or swapped into another style, all from text and a reference face. It's the zero-shot identity trick that made people ask whether character LoRAs were finished, in the same family as IP-Adapter FaceID and InstantID. But this node doesn't ride on your usual setup. It brings its own SD 1.5 UNet, its own VAE, its own CLIP encoder, and its own face detector. "Sampler" undersells it: this is the entire pipeline in a single node.

FlashFace comes from Ali's labs (May 2024, FlashFace: Human Image Personalization with High-fidelity Identity Preservation). The community usually meets it through the cold-hand/ComfyUI-FlashFace port; this NuA version from nuanarchy is a compact, self-contained re-implementation. It gets essentially zero search traffic - this page will likely be the first thing you find about it - which is a shame, because once the weights are in place it's one of the friendliest identity setups in ComfyUI.

How it works

The sibling FlashFace Loader loads everything: a FlashFace-tuned SD 1.5 UNet with an extra encoder on its input conv, OpenAI's CLIP ViT-L/14 text encoder, the SD 1.5 VAE, and RetinaFace for face detection. The sampler takes your reference_faces, runs RetinaFace over them (each image is detected and cropped to the face), VAE-encodes them, and injects those latents into the UNet's cross-attention as reference context during denoising. Same decoupled-injection idea as IP-Adapter, but baked into a custom UNet rather than an add-on adapter - which is why it refuses to play with ControlNet or your regular checkpoints.

Identity is controlled by a classifier-guidance-style term on top of normal CFG. face_guidence (default 3.2) is how hard the output is pushed toward the reference face; lamda_feat (default 1.2) is the similarity weight on the reference features; and step_to_launch_face_guidence (default 750, on the 0–1000 timestep scale) decides when that face guidance switches on. Before it launches, identity runs at the weaker lamda_feat_before_ref_guidence (0.85). Raise it and identity locks in earlier; lower it and the early composition stays mostly text-driven. text_control_scale (7.5) is your ordinary prompt CFG.

The inputs that actually matter

  • reference_faces - the photo(s). One works; several give it more to average, and the README's "non-celebrities" claim is real, this thing holds likeness on randoms.
  • face_bbox_x1/y1/x2/y2 - a normalized 0–1 box on the output canvas where the face lands (default 0.4, 0.3, 0.6, 0.6, roughly centered). This is your composition control, so it's the first thing to move.
  • lamda_feat + face_guidence - your identity-strength dials. Too low and you get the prompt's generic person; too high and the face starts to fight the pose.
  • steps, width, height, seed, positive/negative - the boring ones, all present with sane defaults.

Output is a single IMAGE, ready to feed a save node. There's no batch control; the pack hardcodes one sample.

Installing it

Two ways: ComfyUI Manager (search "ComfyUI-NuA-FlashFace") or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/nuanarchy/ComfyUI-NuA-FlashFace.git
pip install -r ComfyUI-NuA-FlashFace/requirements.txt

The heavy lift is the weights - five files, several GB total, from shilongz/FlashFace-SD1.5 on HuggingFace: flashface.ckpt and the SD1.5 VAE into models/flashface and models/vae, the CLIP encoder plus BPE vocab into models/clip, and retinaface_resnet50.pth into models/face_detection. Nothing auto-downloads, so don't skip this step - the loader's dropdown will be empty without it. The pack ships an install.py that does all of it; run it from inside the pack folder (cd ComfyUI/custom_nodes/ComfyUI-NuA-FlashFace && python install.py). Dependencies are just numpy, safetensors, torch, torchvision, transformers, easydict, ftfy - nothing exotic.

Where people get burned

The biggest confusion: this is SD 1.5-only and self-contained, so your favorite checkpoint, LoRAs, and ControlNet are irrelevant here. It will happily ignore them, and you can't stack a ControlNet on top for pose. If you need FlashFace inside a normal graph, the cold-hand port is the better fit; this one is the "just run it" version.

Two practical traps: it asserts a face was detected (No face detected in the reference images) - RetinaFace must actually find a face, so cropped or heavily filtered references fail. And it loads CLIP + VAE + RetinaFace + the UNet onto the GPU in fp16, so treat VRAM like a full SD 1.5 run with reference processing on top. Generous, not insane. For photorealistic faces, most people then run the output through an upscaler or FaceDetailer-style pass, since identity tools give you likeness, not skin texture.

CategoryNuA/FlashFace

Inputs (17)

NameTypeDefaultDescription
flashface_modelsFLASHFACE_MODELS
reference_facesIMAGE
positiveSTRINGbest quality, masterpiece,ultra-detailed, UHD 4K, photographic
negativeSTRINGblurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face
stepsINT35
heightINT768256–4096
widthINT768256–4096
face_bbox_x1FLOAT0.40–1
face_bbox_y1FLOAT0.30–1
face_bbox_x2FLOAT0.60–1
face_bbox_y2FLOAT0.60–1
lamda_featFLOAT1.2
lamda_feat_before_ref_guidenceFLOAT0.8
face_guidenceFLOAT3.2
step_to_launch_face_guidenceINT750
text_control_scaleFLOAT7.5
seedINT00–4294967295

Outputs (1)

NameTypeDescription
IMAGEIMAGE