Face Swap (InfiniteYou)
A FLUX face swap that isn't a pixel paste
- control_net
- model
- clip
- ref_image
- image
- vae
- mask
- MODEL
- positive
- negative
- latent
Face Swap (InfiniteYou) is the pack's most turnkey node, and it earns that. You hand it a target photo and a reference face, and it swaps the identity - not by pasting pixels the way ReActor and Roop do, but by regenerating the face region through FLUX using the same InfiniteYou identity machinery the rest of the pack uses. The target's pose, lighting and framing stay; the face becomes the reference's; and the skin, shadows and detail get redrawn to match the new geometry instead of being composited over it.
The easy part is that the node does the entire inpainting setup for you. No mask editing, no inpainting conditioning, no touching a VAE Encode node.
How it works
InsightFace detects the face in the target image and auto-builds a mask around it - the bounding box expanded by a third on each side, feathered with a Gaussian blur of blur_kernel (9 by default). The image gets encoded through the VAE with that mask as an inpainting condition (concat_latent_image, the same trick SDXL inpainting and FLUX Fill use), so only the masked region is regenerated and everything outside stays bit-identical. Meanwhile the reference face travels the standard InfiniteYou path - ArcFace embedding, Resampler projection, injected via decoupled cross-attention - and the target's own landmarks are drawn as the ControlNet condition, which is what keeps the swapped face looking in the same direction.
One thing that surprises people: this node writes its own prompt. It encodes " " as the positive and "ugly, blurry" as the negative, so you don't wire text conditioning in at all. That's exactly why clip is a required input - it needs a CLIP encoder (from your checkpoint loader or a CLIPLoader) to encode that empty prompt.
The inputs that matter
ref_image- the face you want to end up with.image- the target photo to swap into.clip- required, for the internal prompt encoding.blur_kernel(1–100, default 9) - how soft the mask edge is. Higher gives a softer transition; too soft and the face bleeds past its bounds.mask(optional) - if you don't like the auto-detected region, supply your own MASK and it overrides detection entirely.adapter_file,weight,start_at/end_at,control_net,model,vae- the shared InfiniteYou inputs, same pairing rules as the other two nodes.
Outputs
MODEL, positive, negative, latent, straight into one KSampler. The latent already carries the noise mask, so sampling it produces the swapped image - decode and save. There's a ready-made face_swap.json in the pack's workflows folder if you want the full wiring as a starting point.
Install
Same pack, same models as its siblings: FLUX.1-dev plus ae.safetensors, one ControlNet (~5.6 GB) into models/controlnet, the matching img_proj into models/InfiniteYou, antelopev2 into models/insightface/models/antelopev2, and the pack's pinned pip deps (numpy==1.26.4, opencv-python==4.11.0.86, insightface, facexlib, onnxruntime). ComfyUI Manager (search "ComfyUI_InfiniteYou") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZenAI-Vietnam/ComfyUI_InfiniteYou
pip install -r ComfyUI_InfiniteYou/requirements.txt
The models are the manual part - the pack's downloadmodel.py fetches them all in one go if you'd rather.
Where people get burned
No face found in either input throws the same "No face detected" error as the rest of the pack - fix it with a clearer photo, not by restarting ComfyUI. On first run, facexlib quietly downloads its own ArcFace weights, so that first run needs internet. And plan VRAM accordingly: it's a FLUX.1-dev pipeline, and a 16 GB Mac user has reported it dying partway through a sample. Finally, the swap inherits the FLUX look, so if you need pixel-perfect likeness on a known face, a LoRA is still the higher ceiling. This is the fast, zero-training path, and it's genuinely good at being that.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| control_net | CONTROL_NET | — | |
| model | MODEL | — | |
| clip | CLIP | — | |
| ref_image | IMAGE | — | |
| image | IMAGE | — | |
| adapter_file | COMBO | 0 options: | |
| weight | FLOAT | 1.000–5 | — |
| start_at | FLOAT | 0.0000–1 | — |
| end_at | FLOAT | 1.0000–1 | — |
| blur_kernel | INT | 91–100 | — |
| vae | VAE | — | |
| maskopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| latent | LATENT | — |