Nodes/ReActor Node for ComfyUI/ReActor 🌌 Fast Face Swap
ComfyUI Node Runs on cloud

ReActor 🌌 Fast Face Swap

The one-node face swap for ComfyUI

By GourieffΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 1,747
ReActor 🌌 Fast Face Swap
  • input_image
  • source_image
  • face_model
  • face_boost
  • IMAGE
  • FACE_MODEL
β—„enabledtrueβ–Ί
β—„swap_modelβ–Ύβ–Ί
β—„facedetectionβ–Ύβ–Ί
β—„face_restore_modelβ–Ύβ–Ί
β—„face_restore_visibility1.00β–Ί
β—„codeformer_weight0.50β–Ί
β—„detect_gender_inputnoβ–Ί
β—„detect_gender_sourcenoβ–Ί
β—„input_faces_index0β–Ί
β—„source_faces_index0β–Ί
β—„console_log_level1β–Ί

You have a generated image and you want a specific face in it - not "a face that kind of resembles this person," an actual pixel-level swap. That's ReActor Fast Face Swap (class ReActorFaceSwap), the node most people mean when they say "reactor." Feed it a target image and a source photo; it detects the face in the target, lifts the identity out of the source, and paints it over. One node, two images, done.

The thing to understand up front: this is a post-process step, not a generation step. It runs on a finished image. That's the whole difference between ReActor and the generative identity tools (IP-Adapter FaceID, InstantID, PuLID) that steer the model while it paints. Those get a face that's roughly right and stylistically flexible; ReActor stamps the exact face on at the end. The community workflow that keeps showing up uses both: "ip adapter gets you 80% there, reactor gets you the rest of the way." Generate with FaceID or PuLID for the vibe, then ReActor for the final likeness.

How it works

Under the hood ReActor is a thin wrapper around InsightFace - the same face-analysis library sitting under FaceID, InstantID, PuLID, Roop and FaceFusion. It detects the face, turns it into an ArcFace identity embedding (facial geometry, not appearance), and hands that to the inswapper_128 model, which does the swap. Then, optionally, a face-restoration model cleans up the result.

The catch worth knowing before you're disappointed: the open inswapper model is 128Γ—128 resolution and has been frozen and unmaintained for years. Every InsightFace-based swapper shares that ceiling, so switching tools won't buy you sharper output. On a big image the raw swap looks soft, which is exactly why the built-in face restoration matters and why people upscale after.

The inputs and outputs that matter

There are a lot of knobs, but a beginner really sets three or four:

  • input_image and source_image - the target (the image getting a new face) and the source (the face to put on it). Both wire in from Load Image.
  • face_restore_model - leave this on none and your swap looks like a low-res sticker. Pick codeformer-v0.1.0.pth or GFPGANv1.4.pth and it sharpens up enormously. This is the single highest-impact setting. Pair it with codeformer_weight (fidelity vs. quality, 0.5 is a fine start) and face_restore_visibility (how hard the restoration blends in).
  • input_faces_index / source_faces_index - which face, when there's more than one. Index starts at 0, sorted largest-face-first by default. In a group shot, input_faces_index of 1 swaps the second-biggest face. You can map several, e.g. source 0,1 into input 1,0.

swap_model only has one real choice (inswapper_128.onnx), so ignore it. facedetection picks the detector (retinaface_resnet50 is the sensible default). detect_gender_input / detect_gender_source restrict swapping to a matching gender, handy in crowds. console_log_level is just verbosity.

Two optional inputs are worth a mention: face_model lets you feed a saved face embedding instead of a source image (build a blended one from several photos for better likeness), and face_boost connects the FaceBoost node to restore-and-scale the face before pasting.

Outputs are IMAGE (the swapped result, wire it to Save Image or an upscaler) and FACE_MODEL (the embedding it built, save it with the Save Face Model node to reuse later).

How to install it

ComfyUI Manager is the easy path: open Manager, Install Custom Nodes, search ReActor, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Gourieff/comfyui-reactor-node

then run install.bat (Windows) or install.py, and restart. The swap and detection models (inswapper_128.onnx, the buffalo_l pack) download on first run. Face-restoration models don't - grab codeformer / GFPGANv1.4 / GPEN from the ReActor HF dataset and drop them in ComfyUI/models/facerestore_models.

Common issues & troubleshooting

The node fails to import / disappears from the menu. The single most common ReActor problem, and it's almost always InsightFace. This library is notorious as one of the worst installs in the space - for years it needed a C++ toolchain (Visual Studio Build Tools on Windows) to compile. If the install choked, use Gourieff's prebuilt Insightface wheel for your exact Python version (the README links 3.10/3.11/3.12) and pip install it into ComfyUI's Python.

AttributeError: 'NoneType' object has no attribute 'get'. Per the README, your inswapper_128.onnx is corrupt or truncated. Re-download it and replace the one in ComfyUI/models/insightface.

A ControlNet Aux node breaks after installing ReActor. Classic opencv version clash. The README's fix: uninstall the various opencv-* packages and reinstall opencv-python==4.7.0.72.

It errors after an update, or on an old workflow. ReActor changes its input sockets between versions; the author's own first move is to delete the node and add it fresh.

Selling what you make? Don't, not on this. The inswapper and buffalo weights are non-commercial research only, and that's inherited by everything InsightFace-based - swapping ReActor for PuLID or FaceID changes nothing. Enforced by DMCA takedowns, not lawsuits, but still fatal to a shipped product. Personal and portfolio work is fine.

Category🌌 ReActor

Inputs (15)

NameTypeDefaultDescription
enabledBOOLEANtrueβ€”
input_imageIMAGEβ€”
swap_modelCOMBO1 options: inswapper_128.onnx
facedetectionCOMBO4 options: retinaface_resnet50, retinaface_mobile0.25, YOLOv5l, YOLOv5n
face_restore_modelCOMBO7 options: none, codeformer-v0.1.0.pth, GFPGANv1.3.pth, GFPGANv1.4.pth, GPEN-BFR-1024.onnx, GPEN-BFR-2048.onnx, +1
face_restore_visibilityFLOAT1.000.1–1β€”
codeformer_weightFLOAT0.500–1β€”
detect_gender_inputCOMBOno3 options: no, female, male
detect_gender_sourceCOMBOno3 options: no, female, male
input_faces_indexSTRING0β€”
source_faces_indexSTRING0β€”
console_log_levelCOMBO13 options: 0, 1, 2
source_imageoptIMAGEβ€”
face_modeloptFACE_MODELβ€”
face_boostoptFACE_BOOSTβ€”

Outputs (2)

NameTypeDescription
IMAGEIMAGEβ€”
FACE_MODELFACE_MODELβ€”