Fat Mex Face Swap
A face swap in one node — with two very different speeds
- target_image
- face_reference
- model
- clip
- vae
- swapped_image
Swapping a face is one of those jobs where ComfyUI gets genuinely annoying - the InsightFace detection nodes, the swap node, the mask plumbing, all wired in the right order or you get a face-shaped smear. Fat Mex Face Swap puts the whole thing behind two inputs: a target image and a face reference. Two modes under the hood, and the node picks between them automatically.
Quick is the InsightFace inswapper paste - detect the faces, blend the reference face over the target, done in seconds. No diffusion model involved. Quality is a different animal entirely: YOLOv8 detects the face, the node crops it, masks it with a feathered edge, re-renders the face region with a diffusion editing model using a fixed face-matching prompt, composites it back, and optionally upscales the face region 4x. That's the "detailer loop" the community's been using for years - detector decides the region, model re-renders it - and it's what you want when Quick leaves a plastic, pasted-on look.
method defaults to auto: quality if you've connected MODEL/CLIP/VAE, otherwise quick. That's the whole design - connect the big guns when you want quality, leave them unplugged for a fast paste.
The inputs that matter
target_imageandface_reference- the photo to edit and the clear photo of the face to use. Quality of the reference does most of the work.method-auto/quick/quality. Force it if auto picks wrong.face_index- which face to swap when there are several (0 = largest). Quick mode only.blend_strength- quick mode, how hard the swap pastes (1.0 = full, lower = ghosted mix with the original).denoise(0.6),feather(13),steps(4),upscale_face(on) - quality mode: how much to regenerate the face, how soft the mask edge, how many sampling steps, and whether to run the 4xFaceUpDAT pass. For quality mode you also wire inmodel/clip/vaefrom a Qwen Image Edit loader.
Output: swapped_image.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/FatMex/ComfyUI-FatMex-Nodes.git FatMex-Nodes
pip install -r FatMex-Nodes/requirements.txt
Or ComfyUI Manager → search "Fat Mex Nodes" → Install → restart. Then the models:
- Quick mode: the
buffalo_ldetection pack (auto-downloaded tomodels/insightface/on first run) andinswapper_128.onnx, which the node searches for inmodels/insightface/andmodels/reactor/. The inswapper file doesn't download itself - grab it the same way ReActor users do and drop it in one of those folders. - Quality mode:
face_yolov8m.ptinmodels/ultralytics/bbox/and, for the face upscale,4xFaceUpDAT.pthinmodels/upscale_models/. Missing files don't crash the node - it warns and skips that step.
Where people get burned
onnxruntime-gpuin requirements.txt. The pack's install line installs it globally, and it fails on CPU-only or Apple Silicon machines. If you're not on CUDA, installonnxruntime(CPU) instead - the node picks providers at runtime.- The 128×128 ceiling. The inswapper model operates at 128×128 internally, and that resolution ceiling is baked into every tool built on it (ReActor, Roop, FaceFusion - same backbone, same limit). That's exactly why Quality mode exists: the diffusion re-render is how you escape the blurry-paste look.
- License reality. InsightFace's weights are non-commercial even though the library is MIT. Fine for personal work, a real problem if you're trying to sell a product - the KB flags this for every tool in the family.
- No face in the reference just returns the target unchanged with a warning. If nothing seems to happen, check your reference actually contains a detectable face.
- Quality mode ignores your prompts. The face-matching prompt is fixed inside the node; you don't get to type it. If the face looks off, tune
denoise,feather, andstepsrather than hunting for a prompt box that isn't there.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| target_image | IMAGE | The generated image to swap a face onto. | |
| face_reference | IMAGE | Clear photo of the face you want to use. | |
| modelopt | MODEL | For quality mode: connect MODEL from a Qwen Image Edit loader. | |
| clipopt | CLIP | For quality mode: connect CLIP from the same loader. | |
| vaeopt | VAE | For quality mode: connect VAE from the same loader. | |
| face_indexopt | INT | 00–10 | Which face to swap (0 = largest). |
| blend_strengthopt | FLOAT | 1.000–1 | Quick mode: blend strength. Quality mode: ignored. |
| methodopt | COMBO | auto | auto = quality if MODEL connected, else quick. |
| denoiseopt | FLOAT | 0.600.1–1 | Quality mode: how much to regenerate the face (0.6 = natural). |
| featheropt | INT | 130–50 | Quality mode: mask edge feathering in pixels. |
| stepsopt | INT | 41–30 | Quality mode: sampling steps for face inpaint. |
| upscale_faceopt | BOOLEAN | true | Quality mode: upscale face region with 4xFaceUpDAT. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| swapped_image | IMAGE | — |