cd /news/ai-tools/what-i-learned-building-an-ai-tool-t… · home › topics › ai-tools › article
[ARTICLE · art-166808] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

What I learned building an AI tool to remove people from photos

A solo developer built SwiftRemover, a web tool that removes people from photos by combining LaMa inpainting for fast, cheap edits with a two-step FLUX Kontext Pro pipeline that generates a text description of the masked region before removing it. Testing four models on a crowded dinner photo, the developer found LaMa smeared structured backgrounds like chairs and murals, while Kontext Pro rebuilt the scene and even adjusted a neighboring subject's toast pose, at roughly $0.04 and 6-8 seconds per image. The mask-painting brush was open-sourced as mask-brush on GitHub.

read3 min views3 publishedNov 10, 2026

I'm a solo developer, and my second side project is a small web tool that lets you remove a person from a photo: you paint over a photobomber, tap Remove, and the AI fills the area with background. It sounds like a solved problem. It mostly is, until someone uploads a photo from a restaurant.

The first version uses LaMa, the classic inpainting model. You send an image and a black-and-white mask (white = remove), and it fills the hole using what it sees around it. On Replicate it runs in about 1.4 seconds and costs about $0.0003 per image, which is cheap enough to offer three free removals a day without thinking twice.

On simple backgrounds such as sand, sea, sky, grass or a plain wall, the result is genuinely hard to tell from the original.

My first real test was a dinner photo: six people around a round table, a carved wooden chair behind each of them, an ink-painting mural on the wall. I painted over the woman on the right and got… a smear. The chair turned into a brown cloud, the mural into grey mush, and the arm of the woman next to her, which was reaching out to toast, bent into something unnatural.

That is not a bug. LaMa does not know what a chair is. It continues textures. When the hole is large and the background has structure, there is nothing to continue.

I ran the same photo and the same mask through four models:

Model Result Cost
LaMa Smeared chair and wall ~$0.0003
Bria Eraser Clean chair and wall, but the neighbour still toasts an empty seat ~$0.04
FLUX Fill Pro (with a prompt) Good, but it added a glass of whisky $0.05
FLUX Kontext Pro (text instruction) The most natural: chair rebuilt, the neighbour's arm moved back $0.04

Kontext won because it understands the scene, not just the pixels. It even fixed the toast. But there was a catch.

Kontext takes an image and a sentence like "remove the woman in the dark navy top on the far right". It ignores masks. My users paint; they do not type descriptions. When I sent Kontext the photo with the red paint on it and asked it to "remove whatever is under the red paint", it removed the red paint and kept the woman.

So the Pro mode is a two-step pipeline: On four test scenes (a beach photobomber, a street bin, a power pole by a lake, the dinner photo) the descriptions were all right, for example "the large dark green wheeled trash bin on the right", and the removals looked natural. Total cost is about $0.04 per image and 6 to 8 seconds.

After a Standard result there is a "Try Pro on this photo" button that reruns the same painted area with Pro. Seeing the two side by side explains the difference better than any pricing page.

Retry-After, wait and retry, and if it still fails, give the user's credit back.

I open-sourced the brush that paints the mask (zero dependencies, touch-friendly, exports the black-and-white PNG): [mask-brush on GitHub](https://github.com/Ethan03015828/mask-brush).

If you want to try it, it is at [swiftremover.com](https://swiftremover.com). I would love to hear about photos where it fails.
── more in #ai-tools 4 stories · sorted by recency
── more on @swiftremover 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/what-i-learned-build…] indexed:0 read:3min 2026-11-10 · —