aiinpainting.app

Neural inpainting

LaMa Inpainting in Your Browser

This page runs the real LaMa network — one of the strongest open inpainting models — on your own device. Brush over a large hole, a fence, a whole person, and LaMa reconstructs the missing structure. Free, no signup, and your photo never leaves the browser.

Heads-up on resource use: this page runs a real neural network on your device, which takes real resources. The first run downloads the ~208 MB LaMa model (cached in your browser afterwards) and inference holds roughly 0.5–1 GB of browser memory for up to about a minute. On memory-constrained devices, close other heavy tabs first — a desktop browser is recommended.

1 · Mark what to remove

Choose a photo, or try the sample. The image never leaves this page.

2 · Check the result

The filled result appears here, next to your original for comparison.

Choose a photo to start — it stays on this page.

Runs entirely in your browser — the photo is never uploaded. The real LaMa network (~208 MB) is downloaded once and cached, then used at fixed 512 × 512 resolution; first runs can take up to a minute.

What is LaMa?

LaMa (Large Mask inpainting) is a neural network published by Suvorov et al. at WACV 2022, “Resolution-robust Large Mask Inpainting with Fourier Convolutions”. It became the default open-source inpainting model because it handles the cases where classic algorithms fall apart: big holes, irregular textures, and structures that cross the masked region.

  • Fourier convolutions (FFC). Regular convolutions only see a small neighborhood, so structure fades inside large holes. LaMa mixes local convolution with a global Fourier transform, giving every pixel awareness of scene-wide patterns — periodic textures like fences, bricks and blinds survive the hole.
  • Trained with large masks. During training, huge random masks force the network to invent coherent structure instead of just smearing nearby pixels.
  • High-receptive-field perceptual loss. The training objective rewards matching textures at scene scale, not just pixel-by-pixel similarity.

The result is a generative model that stays close to your photo: it borrows aggressively from the surroundings and synthesizes texture only where there is nothing to borrow. It is far less prone to inventing phantom objects than smaller GAN models — but it is still generative, so check the filled area before shipping the result.

How LaMa runs here without a server

The LaMa weights are exported to ONNX and executed by onnxruntime-web, which compiles the network to WebAssembly running in a Web Worker on your device. The tool above bundles the packing, padding and compositing: your image is scaled to at most 512 px, padded to the model's fixed 512 × 512 input, filled, and cropped back.

Because the model is large, the first run downloads about 208 MB once and the browser caches it — the following runs work offline. Unlike online generators, there is no upload step, no queue, no per-image cost and no watermark. If you want the zero-download alternative, the site's default inpainting tool fills small holes instantly with patch matching.

LaMa or patch matching — which one for your photo?

Both tools run locally and keep your photo private; they differ in what they fill well. The fundamentals behind both are covered in our guides to image inpainting and the inpainting algorithm.

  • Choose LaMa when the hole is hard. Large regions, complex or irregular textures, and structures crossing the hole — cables, railings, brick courses, a person standing in front of foliage. LaMa's global context reconstructs what patch matching cannot.
  • Choose patch matching when the hole is easy. Small marks backed by simple or repetitive surfaces — walls, grass, water, sky, bokeh — fill instantly with no download, and the result is deterministic: the fill only reuses real pixels from your photo.
  • When in doubt, try both. They share the same interface, so the fastest workflow is a patch-matching pass first, and LaMa for whatever is left.

Where LaMa sits in the wider research landscape — from classic patch methods to transformers and diffusion — is mapped in our complete guide to inpainting techniques.

Tips for the best LaMa results

  • Cover the whole object plus a small margin — including the shadow it casts. LaMa is good at extending structure through slightly larger masks.
  • The working image is capped at 512 px on the long edge (the model's native resolution). Fine detail beyond that scale is beyond the model's reach, so results look best at this working size.
  • The first run needs a one-time ~208 MB model download plus a few seconds of loading; after that the session stays warm and repeat runs skip straight to inference. Desktop browsers are recommended — the model needs a few hundred MB of memory.

Frequently asked questions

Is the LaMa inpainting here really free and private?

Yes. The model runs on your device inside a Web Worker; there is no upload step, no account, and no watermark on the result. The only network traffic is the one-time model download.

Why is the model 208 MB?

That is the size of LaMa's network weights in full float32 precision — about 50 million parameters. It is downloaded once and stored in your browser's cache, so later runs start instantly and even work offline.

How long does a fill take?

On a typical laptop CPU, inference on the fixed 512 × 512 input takes up to about a minute in WebAssembly. Loading the model into memory after the download adds a few more seconds on the first run.

Does LaMa invent content?

It is a generative model, so it synthesizes texture from learned priors rather than copying pixels. In practice it stays close to the surrounding photo, and it invents objects far less often than lighter GAN models — but always check the filled region.

Can I run it on my phone?

Modern phones can, but the 208 MB download and the memory footprint make desktop browsers the more comfortable choice.

Keep going