DEV Community

FacePika
FacePika

Posted on AI-assisted

How we built an on-device face swap app for Android with open-weight ML models (no cloud uploads)

When we started building FacePika, we had one hard constraint: users' photos and videos should never leave their phone.

Most face swap tools today upload your media to a remote server, run the model in the cloud, and send the result back — that works, but it creates obvious privacy tradeoffs. We wanted to build something that worked fully offline, on mid-range Android phones, without needing a data center behind it.

What we learned deploying open-weight models on-device

The biggest challenge wasn't running the model itself — it was making it fast enough and small enough to feel usable on a regular phone:

  • We started with an open-source face swap model, and quantized it down from FP32 to INT8, cutting the model size by 75% without noticeable quality loss.
  • We used Android's NNAPI to offload inference to the device's GPU/NPU, which cut processing time for a single photo swap from 12 seconds to under 2 seconds on a mid-range 2024 phone.
  • Face alignment was trickier than we expected: prepping the face landmarks before feeding them to the model ended up being 30% of our total processing time, and we ended up writing our own lightweight landmark detector to replace a heavier library.

Why on-device matters

The best part of this approach is there's no upload step at all: a user picks a photo, the swap happens entirely in app, and the output never touches a remote server. For a tool that processes people's faces, that privacy guarantee isn't an afterthought — it's the whole point.

We're still refining the model and adding more template support, and we're planning to write more about our mobile ML optimization process here as we go.

The app we built is called FacePika — you can check it out here: facepika.app

Top comments (0)