AI Face Swap (Fun Filter)

Drop a source face, drop a target scene, hit swap. AI detects 68 facial landmarks in both and warps the source face onto the target's head with a feathered mask and skin-tone match. Runs entirely in your browser.

Honest about quality: this is a fun filter, not a Hollywood-grade deepfake. Browser-side landmark warping produces an obvious paste-on — closer to a Snapchat lens than to anything that would fool a human. Don't use it to impersonate anyone. The model runs entirely on your device; nothing is uploaded, but the ethical responsibility is still yours.
1. Source face (the donor)
Drop a portrait — clear face, looking forward
PNG · JPEG · WEBP
No source yet
2. Target scene (where the face goes)
Drop the photo to receive the face
PNG · JPEG · WEBP · must contain a visible face
No target yet

How it works · limitations

Both images get passed through face-api.js — a TensorFlow.js port of the dlib face landmark model. Each face yields 68 (x, y) landmarks: jaw line, eyebrows, nose, mouth, eye contours.

  1. Compute a 6-DOF affine transform that aligns the source's eye-centre, eye-spacing, and chin to the target's same triplet.
  2. Warp the source face onto a working canvas of the target's size using that affine.
  3. Build a soft mask from the target's 17-point jaw outline, expanded slightly. Feather it with a blur whose radius is the "mask softness" slider.
  4. Sample average skin RGB from both faces and shift the warped source's mean to match the target's (per-channel, blended by the "skin-tone match" slider).
  5. Composite the warped + tinted source onto the target using the soft mask. Done.

It's a single global affine, not per-triangle warping, so it cannot match expression / head-tilt mismatches well. Best results: both faces looking roughly forward, similar size, similar lighting. Bad results: profile shots, sunglasses, hair partly covering the face, dramatic angle differences. All processing local; ~6 MB of models cached after first run.