Nodes/ComfyUI_Face_Anon_Simple/Face_Anon_Simple_Sampler
ComfyUI Node

Face_Anon_Simple_Sampler

One number decides whether they still look like themselves

By smthemex·Created 2 years ago·Updated about a year ago· 15
Face_Anon_Simple_Sampler
  • model
  • condition
  • face_align
  • image
seed0
cfg4.0
steps30
anonymization_degree1.25

Face_Anon_Simple_Sampler is where the pack actually does the work. It takes the pipeline from the LoadModel node, the condition packet from the Align node, and denoises an image in which the subject's identity has been nudged away from the source. Everything upstream is setup; this node is the output.

How the anonymization actually works

The core trick is a variable the diffusers pipeline calls anonymization_degree, exposed directly on this node. It doesn't blur or pixelate. Instead, the reference-net pipeline runs diffusion with two copies of the image-conditioning embeddings, then deliberately corrupts the identity-carrying one: image embeddings get scaled toward zero by the degree, and the reference-net cross-attention states get interpolated between the two halves. Higher degree = the generated face drifts further from the person in the photo. Zero = no anonymization at all. The default is 1.25, which is enough to visibly change a face while keeping lighting and tone roughly in place - that's the whole selling point over slapping a blur over someone's head.

There are two runtime modes, controlled entirely by whether you wired face_align:

  • No face_align: the whole image goes through the pipe. Simple, one face, but it re-renders the entire frame.
  • face_align connected (with the Align node's align on): each detected face is cropped, warped to 512x512, anonymized individually, and pasted back onto the original background. The background stays untouched - this is the mode for group photos.

Inputs you actually set

  • model (FACEANON_PIPE): from the LoadModel node.
  • condition (CONDITIONING): from the Align node.
  • anonymization_degree (FLOAT, default 1.25, range 0.01–10): the dial. Low = subtle, high = aggressively different identity. If the output barely changed, raise it; if the result looks like a stranger wearing the same face, you overshot.
  • cfg (default 4.0) and steps (default 30): ordinary diffusion knobs. The pack uses a DDPM scheduler, so this isn't a KSampler under the hood - ComfyUI's usual sampler presets don't apply.
  • seed (default 0): reproducibility.

Output: image (IMAGE), straight into SaveImage or anything downstream.

Where people get burned

  • Slow on group shots. With face_align on, every face is a separate ~30-step diffusion run plus a paste-back. A ten-person photo is ten mini-generations. Budget accordingly.
  • VRAM. The pipeline is three reference-nets plus a UNet. Leave lowvram on in the LoadModel node or you'll be fighting OOM on anything under ~12GB.
  • Align off means a full re-render. If the README's "keep lighting and tone" promise feels off, that's why: whole-image mode is a full img2img-style pass, not a surgical edit. That's what per-face mode exists for.
  • A missed face ships as-is. The face detector gates everything; if it misses a profile face in the back row, that face stays un-anonymized in the output. Always eyeball the result before you share it.
CategoryFace_Anon_Simple

Inputs (7)

NameTypeDefaultDescription
modelFACEANON_PIPE
conditionCONDITIONING
seedINT00–2147483647
cfgFLOAT4.00–10
stepsINT301–1000
anonymization_degreeFLOAT1.250.01–10
face_alignoptFACEANON_ALIGN

Outputs (1)

NameTypeDescription
imageIMAGE