FaceSwapNode
The roop port ComfyUI forgot (and when to still use it)
- face
- image
- IMAGE
FaceSwapNode does exactly what it says: you give it a photo with a face, a photo you want that face dropped into, and it hands you back the swapped result. What the name doesn't tell you is that it's a direct port of s0md3v's sd-webui-roop extension, that it runs CPU-only, and that the repo hasn't been touched since May 2024. If you've landed here from a Google search expecting the modern face-swap experience, adjust expectations: this is the historical, dead-simple version, and the reason most people searching "comfyui faceswap" end up on ReActor instead.
Which isn't to say it's useless. It's one node, one input image, one output. No GPU, no separate model to hunt down - the install script downloads the swap model for you. For a quick, honest-to-god single swap on a machine with no NVIDIA card, it still works today. For anything beyond that, keep reading for what you're giving up.
How the swap actually works
Under the hood it's the same backbone as every other face-swap tool in this space, so the mechanics are worth knowing once. It loads InsightFace's buffalo_l model pack to detect faces and build ArcFace identity embeddings - the same recognition pipeline behind Roop, ReActor, FaceFusion, and even IP-Adapter FaceID. Then it feeds your source face into inswapper_128.onnx, the open swap model that does the pixel-level work.
The catch is in that filename. The public inswapper model is frozen at 128x128, and its own README admits it's no longer maintained - pointing users at the maintainers' paid service for higher resolution. So FaceSwapNode crops each face, smushes it through 128x128, and pastes the result back. Fine for a portrait at moderate resolution, "a bit janky at large res" in the author's own words.
Faces are detected and sorted left-to-right, and you select them by position. If no face is found in the source or target, the node silently returns the target image unchanged - no error, no crash, just nothing happening. That's usually what "it did nothing" means.
The inputs that matter
The node is gloriously small. Four inputs, one output:
- face (IMAGE): the image holding the face you want to copy.
- image (IMAGE): the image you want to swap into.
- source_face_index (INT, default 0): which face in the source photo to use. 0 is the leftmost, 1 the next one over, and so on.
- target_face_indices (STRING): which faces in the target to replace, 0-based and comma-separated -
"0"swaps the first face,"0,2"swaps the first and third. Don't put spaces after the commas; the parser quietly drops entries it can't parse.
The output is an IMAGE tensor, so wire it into a SaveImage or PreviewImage and you're done. Need to swap multiple faces in a scene? Chain a second FaceSwapNode, feeding the first node's output into the next one's image input.
Installing it
Easiest route is ComfyUI Manager - search for "FaceSwap" and install. Or clone it yourself:
cd <comfyui_root>/custom_nodes/
git clone https://github.com/imb101/ComfyUI-FaceSwap
Then restart ComfyUI. On startup the pack runs its own installer, which does two things: pip-installs its dependencies and downloads inswapper_128.onnx into ComfyUI/models/roop/ (around 110 MB, from the henryruhs/roop HuggingFace mirror). InsightFace's buffalo_l pack also auto-downloads to ~/.insightface/models on first use. So the first run needs internet - after that it's all local.
The install script even handles ComfyUI's portable python_embeded environment for you, which is more care than most nodes this age bother with.
What actually goes wrong
- The insightface install. This pack pins
insightface==0.7.3- the notorious pre-1.0 release that had no wheels on newer Python versions and demanded a C++ build toolchain (on Windows, Visual Studio build tools). InsightFace 1.0 (May 2026) finally dropped the C++ requirement, but this node won't use it, and mixing versions with other nodes that expect newer insightface is its own rabbit hole. If the pip step fails, this pin is the culprit. - It's slow. CPU only, via
CPUExecutionProvider. A single swap takes a few seconds on a decent CPU, which is fine for one-off work and painful for a batch. - Licensing, the boring kind. The InsightFace library code is MIT, but its model weights are non-commercial. That's true of every tool in this family (ReActor, PuLID, FaceID included), so don't build anything you plan to sell on it.
- It's abandonware. Last commit May 2024, no GPU support ever shipped despite being promised. If you have a GPU and want quality, ReActor is the maintained, accelerated, feature-complete alternative. If you want to learn how a face swap works or you're stuck on CPU, this node is a perfectly honest starting point - just don't expect it to grow.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| face | IMAGE | — | |
| image | IMAGE | — | |
| source_face_index | INT | 0 | — |
| target_face_indices | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |