Nodes/ComfyUI_Face_Anon_Simple/Face_Anon_Simple_Align
ComfyUI Node

Face_Anon_Simple_Align

The node that decides who gets anonymized — and whether faces get aligned first

By smthemex·Created 2 years ago·Updated about a year ago· 15
Face_Anon_Simple_Align
  • clip_vision
  • image
  • cond_image
  • condition
  • face_align
width512
height512
alignfalse

Face_Anon_Simple_Align is the pack's conditioning and face-detection hub. It does two jobs: it turns your input image into the CLIP embeddings the sampler needs, and - if you flip the align switch - it loads a face landmark detector so each face in the picture gets treated individually. It's also the node that unlocks the pack's second trick, face swapping, via an optional second image input.

What it's doing under the hood

Job one is CLIP encoding. It takes your image, encodes it with a CLIP vision model, and packs the resulting image embeddings into a condition packet. That packet is what the sampler uses to know what the "person to anonymize" looks like. Job two is face alignment: with align on, it instantiates a face_alignment detector (SFD face detector plus the 2DFAN4 landmark model, a 91.8MB download that happens on first use). With alignment loaded, the sampler can find, anonymize and paste back each face separately instead of regenerating the whole picture. The node also calls unload_all_models() before that detector spins up, which is a small mercy on low-VRAM rigs.

Inputs and outputs that matter

  • clip_vision (CLIP_VISION): needs a CLIP vision model loaded via CLIPVisionLoader. The README names clip_vision_g.safetensors - the SD 1.5 default that ships with ComfyUI. The bundled example workflow uses clip_vision_H.safetensors instead. Either works; both are already in your models/clip_vision folder.
  • image (IMAGE): the photo to anonymize.
  • width / height (INT, default 512): working resolution. This is an SD 1.5 pipeline, so 512-ish is home turf; the example workflow runs 1024x768.
  • align (BOOLEAN, default False): the big switch. Off = single-face / whole-image pass. On = per-face detection. Read the modes below.
  • cond_image (optional IMAGE): plugging a second image here flips the node into face-swap mode - the output uses cond_image as the base identity rather than the source.

Outputs: condition (CONDITIONING) into the sampler's condition input, and face_align (FACEANON_ALIGN) into the sampler's optional face_align input. Wire face_align even when align is off - it carries the "no alignment" signal and keeps the sampler happy.

The three modes, straight from the README

  • Single face: image only, align off, tune anonymization_degree in the sampler.
  • Multiple unaligned faces: image only, align on - each face gets handled, background untouched.
  • Face swap: image + cond_image, align off. The result uses cond_image as the base.

Install and first-run notes

Align is where the 91.8MB face_alignment checkpoint (2DFAN4) gets downloaded, so the first run with align on stalls briefly while it pulls. And if the pack was installed without pip install -r requirements.txt, the face_alignment import blows up at exactly this moment - that's the one Python dependency the whole face pipeline needs.

Where people get burned

Feeding a big image with align off works, but the node silently resizes to your width/height, so detail-heavy faces at 512 can come out soft. And multi-face groups are only as good as the detector: profiles, heavy occlusion or tiny background faces get missed, and a missed face simply doesn't get anonymized. Check the output before you post it - this is a stylization tool, not a guarantee.

CategoryFace_Anon_Simple

Inputs (6)

NameTypeDefaultDescription
clip_visionCLIP_VISION
imageIMAGE
widthINT512128–4096
heightINT512128–4096
alignBOOLEANfalse
cond_imageoptIMAGE

Outputs (2)

NameTypeDescription
conditionCONDITIONING
face_alignFACEANON_ALIGN