Nodes/ComfyUI-InstaSwap/InstaSwap Fast Face Swap 🥸
ComfyUI Node

InstaSwap Fast Face Swap 🥸

The one-node ReActor fork that actually works

By abdozmantar·Created 3 years ago·Updated 2 years ago· 57
InstaSwap Fast Face Swap 🥸
  • input_image
  • source_image
  • face_model
  • IMAGE
  • FACE_MODEL
â—„enabledtrueâ–º
◄swap_model▾►
◄facedetection▾►
◄face_restore_model▾►
â—„face_restore_visibility1.00â–º
â—„codeformer_weight0.50â–º
â—„detect_gender_sourcenoâ–º
â—„detect_gender_inputnoâ–º
â—„source_faces_index0â–º
â—„input_faces_index0â–º
â—„console_log_level1â–º

You've got one photo of a person and a whole folder of images you want them "in." InstaSwap Fast Face Swap 🥸 is the node for exactly that: feed it an input image (or a video frame sequence), point it at a source face, and it pastes that face across everything. No training, no LoRA, no per-image fiddling. It's a post-processing pixel swap, not a generative tool, so the rest of your workflow - your checkpoint, your sampler, your prompt - stays completely untouched.

Straight talk about where this pack comes from, because it matters before you install anything. InstaSwap is ReActor's code rebranded. The README's own badges link over to Gourieff's comfyui-reactor-node, and the ReActor author has publicly called this pack "stolen code" without credit. Last commit was October 2024, so it's dormant. None of that stops it from working - it's the same engine ReActor runs - but if you already have ReActor installed, there's no reason to switch. If you don't, and you want a single clean node instead of ReActor's multi-node rig, InstaSwap is fine. Just know what you're installing.

How it works

Under the hood it's the same stack as ReActor, Roop, and FaceFusion: InsightFace's buffalo_l model pack detects faces and turns each one into an ArcFace embedding, and inswapper_128.onnx does the actual pixel-level swap. The "128" is the catch - inswapper operates at 128×128, so on a big image you get a soft, slightly waxy face. That's why the node has an optional restoration pass (CodeFormer or GFPGAN) to sharpen the swapped region back up. Skip it on small images; turn it on for anything you're posting at full res.

The inputs that matter

There are a lot of knobs, but a beginner only touches these:

  • input_image (required) - the image or video frames you're swapping into. Feed it IMAGE from ComfyUI's Load Image, or from VHS Video Helper Suite for video.
  • source_image or face_model - one of these is mandatory; they're where the face comes from. source_image is a single reference photo, face_model is a previously saved model from Load Face Model.
  • swap_model - dropdown of the swap ONNX in your models/insightface folder, normally inswapper_128.onnx.
  • facedetection - which detector runs first: retinaface variants are the usual default, the YOLOv5 ones are faster on video.
  • detect_gender_source / detect_gender_input - set to female or male and the swap only fires when the detected face matches. Handy for batch jobs.
  • source_faces_index / input_faces_index - comma-separated, zero-indexed, faces numbered left-to-right then top-to-bottom. 0,1 in source and 1,0 in input means the second face in the input takes the first face's identity, and vice versa.
  • face_restore_model - none by default; pick codeformer.pth or GFPGANv1.4.pth once you've dropped them in models/facerestore_models.

enabled is your bypass: flip it off and the node passes input_image through untouched.

Outputs

  • IMAGE - the swapped frames. Preview with Preview Image, save with Save Image, or combine back to a clip with VHS Video Combine.
  • FACE_MODEL - the computed source face, if you want to save it for later instead of keeping the reference photo around.

Installation

Easiest is ComfyUI Manager: search "ComfyUI-InstaSwap" and hit install. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/abdozmantar/ComfyUI-InstaSwap
cd ComfyUI-InstaSwap
python install.py        # or double-click install.bat on Windows

install.py grabs inswapper_128.onnx into models/insightface automatically and installs insightface==0.7.3, onnxruntime, and OpenCV. The catch: this pack pins InsightFace 0.7.3, which predates the 1.0 release that finally dropped the C++ build requirement - so on Windows you still need Visual Studio C++ build tools or insightface won't compile. That's the #1 install failure here.

Common issues

  • AttributeError: 'NoneType' object has no attribute 'get' - your inswapper_128.onnx is corrupt or truncated. Re-download it from the facefusion-assets release link in the README and replace the file in models/insightface.
  • instaswap.execute() got an unexpected keyword argument 'reference_image' - stale node from an old version. Delete the node and add it fresh.
  • Blurred face output - reported by users since launch. It's the 128×128 inswapper ceiling: use a high-res source image, and enable a face restorer.

One more honest take: because this is ReActor's engine, results are effectively identical to ReActor, warts and all. Use this node for the single-node convenience; use ReActor if you want the actively maintained original.

CategoryInstaSwap

Inputs (14)

NameTypeDefaultDescription
enabledBOOLEANtrue—
input_imageIMAGE—
swap_modelCOMBO0 options:
facedetectionCOMBO4 options: retinaface_resnet50, retinaface_mobile0.25, YOLOv5l, YOLOv5n
face_restore_modelCOMBO1 options: none
face_restore_visibilityFLOAT1.000.1–1—
codeformer_weightFLOAT0.500–1—
detect_gender_sourceCOMBOno3 options: no, female, male
detect_gender_inputCOMBOno3 options: no, female, male
source_faces_indexSTRING0—
input_faces_indexSTRING0—
console_log_levelCOMBO13 options: 0, 1, 2
source_imageoptIMAGE—
face_modeloptFACE_MODEL—

Outputs (2)

NameTypeDescription
IMAGEIMAGE—
FACE_MODELFACE_MODEL—