ReActor π Fast Face Swap
The one-node face swap for ComfyUI
- input_image
- source_image
- face_model
- face_boost
- IMAGE
- FACE_MODEL
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_imageandsource_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 onnoneand your swap looks like a low-res sticker. Pickcodeformer-v0.1.0.pthorGFPGANv1.4.pthand it sharpens up enormously. This is the single highest-impact setting. Pair it withcodeformer_weight(fidelity vs. quality, 0.5 is a fine start) andface_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_indexof1swaps the second-biggest face. You can map several, e.g. source0,1into input1,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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | β |
| input_image | IMAGE | β | |
| swap_model | COMBO | 1 options: inswapper_128.onnx | |
| facedetection | COMBO | 4 options: retinaface_resnet50, retinaface_mobile0.25, YOLOv5l, YOLOv5n | |
| face_restore_model | COMBO | 7 options: none, codeformer-v0.1.0.pth, GFPGANv1.3.pth, GFPGANv1.4.pth, GPEN-BFR-1024.onnx, GPEN-BFR-2048.onnx, +1 | |
| face_restore_visibility | FLOAT | 1.000.1β1 | β |
| codeformer_weight | FLOAT | 0.500β1 | β |
| detect_gender_input | COMBO | no | 3 options: no, female, male |
| detect_gender_source | COMBO | no | 3 options: no, female, male |
| input_faces_index | STRING | 0 | β |
| source_faces_index | STRING | 0 | β |
| console_log_level | COMBO | 1 | 3 options: 0, 1, 2 |
| source_imageopt | IMAGE | β | |
| face_modelopt | FACE_MODEL | β | |
| face_boostopt | FACE_BOOST | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| FACE_MODEL | FACE_MODEL | β |