Nodes/ComfyUI Roop Custom Nodes/Roop Face Swap (Image)
ComfyUI Node

Roop Face Swap (Image)

Face swap in one node — no training, no LoRA, just two images

By glitchinthemetrix16·Created about a year ago·Updated about a year ago· 1
Roop Face Swap (Image)
  • source_image
  • target_image
  • swapped_image
roop_dir/content/roop
output_nameroop_output.png
many_facesfalse

You've got a face you want on someone else's body, you don't want to train anything, and you don't want to fight with a five-node detailer chain. That's what this node is for. Feed it a source image (the face you want to keep) and a target image (the photo whose face gets replaced), and you get a swapped tensor straight out. It's the classic Roop face swap from 2023, wrapped up as a single ComfyUI node.

Before you get too excited, know what you're buying. Roop is the tool that made face swap a one-liner - it exploded in mid-2023 precisely because it skipped training entirely. Under the hood it's InsightFace's inswapper model, which detects a face, aligns it, and pastes the swapped identity back in. That model is frozen at 128x128 resolution and has been unmaintained for years, so output tends to be soft, a little blotchy, and more "strong resemblance" than "perfect photoreal". ReActor is the actively-maintained successor in ComfyUI and is usually the better default. This pack earns its keep if you're already running roop (especially in a Colab) or you want the batch/video/webhook siblings that ship alongside it.

How it actually works

Here's the important part most people miss: this node does not import roop. It shells out. It saves your source and target tensors to roop_dir/temp_io, runs the roop command-line tool as a subprocess, and then loads the resulting PNG back into a tensor:

python run.py -s source.png -t target.png -o output.png \
  --execution-provider cuda --frame-processor face_swapper

So the node is only as good as the roop checkout it's pointing at. It also hard-codes --execution-provider cuda - there is no CPU path. No GPU, no swap.

The inputs that matter

  • source_image - the face you want to appear on the target. A clean, front-facing shot works best.
  • target_image - the photo being modified.
  • many_faces - flip to true if there are multiple faces in the target and you want them all swapped.
  • roop_dir - the path to your roop checkout. The default is /content/roop, which is a Google Colab path, not your machine. If you leave it, the node fails before it starts.
  • output_name - the temp filename in roop_dir/temp_io. It auto-increments (_1, _2…) so you won't overwrite earlier runs.

Output: swapped_image (IMAGE) - wire it into a Save Image or Preview Image node like any other image. One gotcha: the swap is written to disk and read back through a PNG, so it's RGB, lossy-ish, and a little slower than a pure in-memory op.

Installing it

Clone the pack into ComfyUI's custom nodes folder and restart ComfyUI:

cd ComfyUI/custom_nodes
git clone https://github.com/glitchinthemetrix16/ComfyUI-Roop

ComfyUI Manager may find it if you search "ComfyUI-Roop", but this is an old, low-traffic pack, so if Manager doesn't list it, the clone above is the reliable route. The README also wants the usual suspects - torch, torchvision, pillow, requests - which you already have if ComfyUI runs.

The real dependency is roop itself, which this pack does not bundle. The README uses Furkan Gözükara's Colab fork:

git clone https://github.com/FurkanGozukara/roop /content/roop
cd /content/roop
pip install onnxruntime-gpu && pip install -r requirements.txt

The first time you run a swap, roop downloads its inswapper_128.onnx model automatically. Wait for that; it's not stuck.

Where people get burned

  • "No such file: run.py" - roop_dir doesn't point at a real roop checkout. Update it to your actual path; the Colab default bites everyone on a local install.
  • Black output image - roop's built-in NSFW filter decided the frame was unspeakable and produced nothing; the node returns a black tensor with a console warning instead of crashing. Check the ComfyUI console for [Warning] Roop did not produce output.
  • Wrong Python environment - the node calls the bare python command, so it runs whatever's on your PATH. If roop is installed in a venv that isn't active, you get an import error inside the subprocess.
  • Blurry, waxy faces - that's the 128x128 ceiling, not a broken install. Run the output through the enhancer variant or an upscaler after.

One licensing note worth knowing: roop runs on InsightFace, whose code is MIT but whose model weights are non-commercial. Fine for personal use; a real problem if you ever want to sell the results.

CategoryRoop/Basic

Inputs (5)

NameTypeDefaultDescription
source_imageIMAGE
target_imageIMAGE
roop_dirSTRING/content/roop
output_nameSTRINGroop_output.png
many_facesBOOLEANfalse

Outputs (1)

NameTypeDescription
swapped_imageIMAGE