How in-browser AI cutout works (and why your photo never leaves your device)
A plain-English explanation of how an AI model can cut people out of photos inside your web browser, what came before it, and what it means for your privacy.
When you add a photo to Layr, the people and objects are cut out in a second or two, and your photo never leaves your device. This article explains how that works, without the jargon.

The job: "segmentation"
Cutting a subject out of a photo is called segmentation: for every pixel, decide "subject" or "background". The result is a mask — a black-and-white image where white means subject. Layr uses the mask to draw a copy of the subject on top of your text.
What came before
- By hand (1990s–2010s): designers traced around the subject in Photoshop with the pen tool or a mask brush. Accurate, but slow — especially hair.
- Magic wand and colour tools: select by colour. Fast, but only works when the background is one plain colour.
- Green screens: film and TV shoot people in front of a bright green wall so a computer can remove it. Great results, but you need the green wall.
- Online background removers (2010s–2020s): AI on a company's server. You upload the photo, they send back the cutout. Fast and easy, but your photo goes to someone else's computer.
What changed: AI that runs in the browser
Two things made in-browser AI possible:
- Smaller, smarter models. Researchers built segmentation models that are accurate but small enough to download — tens of megabytes instead of gigabytes.
- Faster browsers. Modern browsers can run AI models directly using WebAssembly (fast code on the processor) and WebGPU (access to the graphics card).
So instead of sending your photo to the AI, the website sends the AI to your photo.
The two models Layr uses
1. IS-Net: automatic cutout
IS-Net comes from research on "dichotomous image segmentation" — separating a foreground object from the background in fine detail. It looks at the whole photo and produces a soft mask: for each pixel, how sure it is that the pixel belongs to the main subject. Layr then turns that confidence into clean edges (that is what the Edge solidity slider controls).
2. SlimSAM: tap to select
When you use Fix cutout → Add object, Layr uses SlimSAM, a compressed version of Meta AI's "Segment Anything" model. It works in two steps: first it reads the whole photo once (a few seconds), then each tap takes a fraction of a second, because it only has to answer "which object is under this point?".
Both models are open source. You can see their licences on our Licences page, and Layr's own code is public too.
Graphics card or processor?
An AI model is billions of small multiplications. A graphics card (GPU) does thousands of them at the same time, so on a good GPU the cutout takes about 1–2 seconds. Layr checks your device:
- Good GPU available (most modern laptops and tablets with Chrome or Edge): uses the GPU with a half-precision model (about 88 MB).
- No suitable GPU (many phones): uses the processor with a lighter 8-bit model (about 44 MB). Slower — around 20–40 seconds on a phone — but it works everywhere.
The GPU works only for the few seconds the cutout runs, and only on your photo. Nothing runs in the background and your device never works for anyone else.
Where your data goes
- Your photo: stays in your browser's memory on your device. It is never uploaded.
- The AI model: downloaded once from Hugging Face (a public library of AI models), then saved in your browser's cache.
- The website itself: a few small files from our host, Cloudflare.
Close the tab and the photo is gone from memory. Full details are in our Privacy Policy.
What it achieved
- Privacy: no upload means nobody else sees your photos.
- Free to run: there is no expensive AI server to pay for, so the tool can stay free.
- Speed: after the first download, there is no waiting for an upload or a queue.
- Works offline-ish: once the model is cached, the cutout itself needs no internet connection.
Its limits
- The first visit needs a model download, which can take a while on slow connections.
- Older phones are slower because they run the model on the processor.
- Like every AI, it can make mistakes, especially on busy digital art. That is why the Fix cutout tools exist. See Photo tips for a clean AI cutout.
See it in action →Free · runs in your browser · photos never uploaded
More guides
How to put text behind a person in a photo (free, no Photoshop)A step-by-step guide to the popular "text behind subject" effect: what it is, why it works, and how to make it in a minute in your browser.6 min read
12 text-behind-photo ideas for Instagram, WhatsApp and postersTwelve practical ideas for the text-behind-subject effect — for birthdays, travel, sports, sales and more — with tips on which word, font and colour to use.7 min read
Text-behind-photo ads for small businesses: car dealers, cafés and shopsHow small businesses can make eye-catching photo ads for WhatsApp, Instagram and Facebook with the text-behind-subject effect — no designer needed.7 min read