Nodes/ComfyUI-Replicate/Replicate omniedgeio/face-swap
ComfyUI Node

Replicate omniedgeio/face-swap

One-shot face swapping in ComfyUI

By replicate·Created 2 years ago·Updated 2 years ago· 207
Replicate omniedgeio/face-swap
  • target_image
  • swap_image
  • IMAGE
disable_safety_checkerfalse
force_rerunfalse

This is the simplest possible face swap: give it a target image (the photo you want to change) and a swap image (the face you want to put in), and it returns the target with the face replaced. Two images in, one image out, no LoRA training, no fiddly setup. This node runs it on Replicate's cloud through ComfyUI-Replicate.

If you've used ReActor, Roop, or FaceFusion, this is the same idea and - importantly - almost certainly the same engine underneath.

How it works

Nearly every no-training face tool in this ecosystem sits on top of InsightFace: it detects the face, aligns it, and turns it into an ArcFace embedding (a vector encoding facial geometry), then a swapper model - the well-known inswapper - pastes that identity onto the target face. ReActor, Roop, FaceFusion, and swap nodes like this one are largely the same recognition backbone wearing different front ends. The node sends both images to Replicate and returns the swapped IMAGE.

Inputs and outputs that matter

Two required inputs and that's the whole point:

  • target_image (IMAGE) - the scene/photo you're editing. The face here gets replaced.
  • swap_image (IMAGE) - the source face you want in the result.

Output is an IMAGE. There's also disable_safety_checker (default false) and the standard force_rerun. Don't overthink the setup - the reason to use a node this bare is that it just works with two inputs.

How to install it

ComfyUI Manager: search ComfyUI-Replicate, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/replicate/comfyui-replicate
cd comfyui-replicate
pip install -r requirements.txt

Restart, and set your token first:

export REPLICATE_API_TOKEN="r8_************"; python main.py

Token: replicate.com/account/api-tokens.

Common issues

The single biggest thing to know is resolution. The open inswapper model is frozen at 128×128 and is officially unmaintained - the maintainers point anyone wanting higher resolution at their paid product. So the swapped face comes back low-res relative to the rest of the image, and on a large or close-up target it'll look soft or slightly pasted-on. The standard fix is to run a detail/upscale pass on the face after the swap (SUPIR or a face-restore step) rather than expecting the swap itself to be crisp.

There's also a licensing point worth flagging: the InsightFace models under all these swappers are non-commercial. Running the swap through Replicate doesn't change that - don't assume output is cleared for commercial use.

Quality-wise, swaps are best when the two faces share rough angle and lighting; a profile face swapped onto a front-facing target fights the model. And the pack basics: a missing REPLICATE_API_TOKEN errors on the first run, disable_safety_checker toggles Replicate's content filter, and each call bills on Replicate.

CategoryReplicate

Inputs (4)

NameTypeDefaultDescription
target_imageIMAGE
swap_imageIMAGE
disable_safety_checkeroptBOOLEANfalse
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE