ComfyUI Node

Face Warp

Landmark-based warping, not a neural face swap

By cubiq·Created 2 years ago·Updated about a year ago· 553
Face Warp
  • analysis_models
  • image_from
  • image_to
  • IMAGE
  • MASK
keypoints
grow0
blur13

Worth clearing up first, because it's the most common misread of this node: Face Warp is not a face-swap node in the ReActor/inswapper sense. It doesn't generate anything and it isn't a neural network doing identity transfer. It's a classic computer-vision warp - take the landmark points from one face, take the landmark points from another, and geometrically stretch the first face's pixels to match the second face's shape and position. Same family of technique, much older and more literal than the generative face-swap tools this pack sits alongside in most people's node graphs.

The mechanism

Face Analysis Models detects landmark keypoints on both image_from and image_to. Face Warp then computes the geometric transform that maps one set of points onto the other, and applies it to the actual pixels of image_from. The result is image_from's face pixels, reshaped to sit where and how image_to's face sits. There's no "understanding" of the face happening - it's point correspondence and interpolation, which is exactly why it's fast and predictable, and also why it can look uncanny if the two source faces have wildly different geometry to begin with. This works best when both faces are reasonably similar in pose and framing going in - running both through Face Align first tends to help a lot here.

The inputs

  • analysis_models (ANALYSIS_MODELS) - the loader.
  • image_from / image_to (IMAGE) - image_from is the face getting warped; image_to supplies the target shape and position it's warped onto.
  • keypoints - a 3-way choice of how much of the face gets used for the warp: main features, full face, or full face+forehead (if available). More points generally means a tighter, more accurate warp, but "if available" is a real caveat - the forehead points only exist if your backend returns them. Dlib's 81-point model has them; its 68-point model doesn't, and whether InsightFace or AuraFace supply forehead points depends on the specific model loaded in Face Analysis Models. If your full face+forehead result looks identical to full face, that's a missing-landmark situation, not a bug.
  • grow (INT, default 0) - expands or shrinks the warped region.
  • blur (INT, default 13) - feathers the edge of the warped area so it blends rather than looking pasted-in.

The outputs

IMAGE - the warped result. MASK - the region that was actually warped, which is the useful part if you want to composite this back into a larger scene rather than use the raw output directly. Feed the mask into whatever blending node you're already using and you get control over the transition that the node itself doesn't expose as a parameter.

Installing it

  • ComfyUI Manager - search "Face Analysis for ComfyUI", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_FaceAnalysis, restart.

No model files specific to Face Warp - same as the rest of the pack, it rides on whatever backend you set up in Face Analysis Models, and for the forehead-landmark option specifically, Dlib's 81-point predictor is the one to grab if that's what you're after.

Common issues

Most disappointing results come from mismatched source material rather than a node problem: two faces at very different angles or scales warp badly because there simply isn't a clean point correspondence between them - align both images first if you're getting distortion. The keypoints setting silently falling back when forehead points aren't available is the other recurring confusion; if you're specifically relying on hairline coverage and it's not showing up, check what landmark model your backend is actually loading before assuming the setting is broken. And because this is a geometric warp and not a generative swap, don't expect it to fix lighting, skin tone, or texture mismatches between the two faces - that's outside what this node does, and if that's what you actually need, you're looking for a proper face-swap tool, not this one.

CategoryFaceAnalysis

Inputs (6)

NameTypeDefaultDescription
analysis_modelsANALYSIS_MODELS
image_fromIMAGE
image_toIMAGE
keypointsCOMBO3 options: main features, full face, full face+forehead (if available)
growINT0-4096–4096
blurINT131–4096

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK