Nodes/Fat Mex Nodes/Fat Mex Face Swap
ComfyUI Node

Fat Mex Face Swap

A face swap in one node — with two very different speeds

By FatMex·Created 7 months ago·Updated 7 months ago· 3
Fat Mex Face Swap
  • target_image
  • face_reference
  • model
  • clip
  • vae
  • swapped_image
face_index0
blend_strength1.00
methodauto
denoise0.60
feather13
steps4
upscale_facetrue

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_image and face_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 in model/clip/vae from 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_l detection pack (auto-downloaded to models/insightface/ on first run) and inswapper_128.onnx, which the node searches for in models/insightface/ and models/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.pt in models/ultralytics/bbox/ and, for the face upscale, 4xFaceUpDAT.pth in models/upscale_models/. Missing files don't crash the node - it warns and skips that step.

Where people get burned

  • onnxruntime-gpu in 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, install onnxruntime (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, and steps rather than hunting for a prompt box that isn't there.
CategoryFat Mex

Inputs (12)

NameTypeDefaultDescription
target_imageIMAGEThe generated image to swap a face onto.
face_referenceIMAGEClear photo of the face you want to use.
modeloptMODELFor quality mode: connect MODEL from a Qwen Image Edit loader.
clipoptCLIPFor quality mode: connect CLIP from the same loader.
vaeoptVAEFor quality mode: connect VAE from the same loader.
face_indexoptINT00–10Which face to swap (0 = largest).
blend_strengthoptFLOAT1.000–1Quick mode: blend strength. Quality mode: ignored.
methodoptCOMBOautoauto = quality if MODEL connected, else quick.
denoiseoptFLOAT0.600.1–1Quality mode: how much to regenerate the face (0.6 = natural).
featheroptINT130–50Quality mode: mask edge feathering in pixels.
stepsoptINT41–30Quality mode: sampling steps for face inpaint.
upscale_faceoptBOOLEANtrueQuality mode: upscale face region with 4xFaceUpDAT.

Outputs (1)

NameTypeDescription
swapped_imageIMAGE