cd /news/ai-tools/offline-watermark-remover-on-an-m1-m… · home › topics › ai-tools › article
[ARTICLE · art-181451] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Offline watermark remover on an M1 Mac (UNet++ + 2D lattice and LaMa)

A developer released unwatermark, an open-source command-line tool that removes watermarks from batches of photos entirely offline on Apple Silicon Macs, running in about 6 to 10 seconds per image on an M1. The tool combines UNet++ segmentation models from christophernavas/watermark-remover with a 256px seed scan and 2D lattice recovery to catch repeating glyphs, then inpaints each mask cluster in a tight local crop using big-lama.pt, avoiding artifacts such as grass texture painted into sky or erased fencing, crane cables and safety signs. It requires Python 3.12+ and uv, downloads weights once to ~/.cache/huggingface/hub and ~/.cache/unwatermark/big-lama.pt, and also runs on CUDA and plain CPU.

key takeaway

Running watermark removal locally on an M1 with PyTorch MPS fallback enabled, the tool splits work into a global/512px UNet++ scan, a 256px seed scan that only collects candidates for 2D lattice recovery, and per-cluster local-crop LaMa inpainting, processing an image in about 6 to 10 seconds.

read5 min views4 publishedDec 3, 2026
Offline watermark remover on an M1 Mac (UNet++ + 2D lattice and LaMa)
Image: Michielbdejong (auto-discovered)

Offline batch watermark remover, built on an M1 MacBook. No subscription, no credits, no up photos to a browser one at a time.

I had a folder of watermarked photos to clean up for a project. I wasn't paying €25 a month for a tool I'd use twice.

I tried the usual options first:

  1. "Free" web removers. Upload one photo, wait twenty seconds, then find out the HD download needs an account and 15 monthly credits.
  2. Desktop trial apps. Download a 400MB.dmg that looks like it was compiled in 2014. Run a photo through it. Watch it stamp its own, bigger watermark over the original.
  3. Free cloud GPU Spaces. Worked well for four photos. Then Hugging Face cut me off for hitting the daily ZeroGPU limit.

Running it locally was the obvious answer. The catch was doing it on an M1 with 16GB of unified memory. No NVIDIA GPU, no CUDA, and a PyTorch MPS backend that quietly falls back to CPU the moment it sees an FFT.

So I built a CLI that runs offline on Apple Silicon, works through whole folders, and costs nothing. CUDA and plain CPU work too.

Plugging open-source segmentation models into LaMa gets you most of the way in an afternoon. The last 20% is where local removal usually falls over:

  • Small letters left behind. A standard 512px pass takes out big logos and banners, then leaves twenty little repeating letters scattered across the sky.
  • Real things getting erased. The aggressive specialist models (lines ,repeated ,logo ) and 256px tiles both catch smaller marks. They also remove Heras fencing, crane cables and red"DANGER KEEP OUT" signs, because a zoomed-in tile has no idea what the rest of the photo looks like.
  • Grass in the sky. Givebig-lama a full 1300px+ photo in one go and its global FFT convolutions pull texture from the bottom of the frame and paint a patch of grass into clear sky.

The fix was to stop putting everything into one noisy mask and split the jobs up:

  1. Primary scan at global and 512px. Uses theuniversal and gatedoverlay UNet++ models fromchristophernavas/watermark-remover . Fences, cables and safety signs survive. Photos that are already clean come out untouched (0.0% mask).
  2. 256px seed scan, then repeating-glyph and 2D lattice recovery. The 256px pass never writes to the final mask. It only collects candidates. When enough of them match each other in high-pass luminance, the engine averages them into a clean template, fits the repeating grid (rectangular, staggered or diagonal, nothing hardcoded to a particular agency) and goes back for the marks it missed: faint ones, ones behind objects and ones cut off at the edge.
  3. Local-crop LaMa inpainting (big-lama.pt). Each mask cluster gets inpainted in its own tight crop, feathered outward only. If LaMa is painting sky, it only sees sky. Solid dark stock-photo footer bars are handled separately so they don't smear black into the foreground. Use--crop-footer to cut them off completely.

It all runs locally on MPS (PYTORCH_ENABLE_MPS_FALLBACK=1 is set for you). Weights download once into ~/.cache/huggingface/hub and ~/.cache/unwatermark/big-lama.pt. After that it's fully offline. On an M1 it takes about 6 to 10 seconds an image.

Needs Python 3.12+ and uv.

uv tool install git+https://github.com/otterolie/unwatermark.git

Or run it without installing:

uvx --from git+https://github.com/otterolie/unwatermark.git unwatermark ./photos -r --format original
git clone https://github.com/otterolie/unwatermark.git
cd unwatermark

mkdir -p ~/.local/bin
ln -sf "$(pwd)/unwatermark" ~/.local/bin/unwatermark

unwatermark --download-models

Run it from inside any folder of images:

unwatermark . -r --format original

unwatermark . -r --format original --crop-footer

unwatermark . -r --format original --overwrite

unwatermark photo1.jpg photo2.png -o ./cleaned --save-masks
Flag Default Purpose
-r, --recursive off Walk subfolders and mirror the folder structure in the output
-o, --out DIR <input>_cleaned Output folder
--format png original ,png ,jpg orwebp
--overwrite off Reprocess files already in the output. Skipped by default, so an interrupted batch picks up where it stopped
--crop-footer off Crop off solid dark stock-photo footer bars
--threshold 0.48 Detection threshold. 0.35 to0.42 catches fainter marks,0.50+ is stricter
--expand /--feather 4 /2 Mask dilation and outward-only edge feathering, in pixels
--passes 1 Cleanup passes. 1 is usually enough with lattice recovery on
--local-models full full (universal,overlay ),fast (universal ),aggressive ,all , or comma-separated model keys
--no-repeat-propagation off Turn off repeating-glyph and 2D lattice recovery
--save-masks off Write <name>_mask.png next to each output
--json off Print a JSON summary to stdout. Progress logs go to stderr
--device auto auto (MPS, CUDA, then CPU),mps ,cuda orcpu

Use --json when calling it from a script or an agent, so stdout is clean JSON:

unwatermark ./photos -r --format original --crop-footer --json

Or import the engine in Python:

from PIL import Image
from local_engine import LocalWatermarkRemover

remover = LocalWatermarkRemover(model_spec="full", device="auto")
res = remover.remove_watermarks(Image.open("input.jpg"), crop_footer=True)
res.image.save("cleaned.jpg", quality=95)
print(f"detected={res.had_detection} mask={res.coverage_pct:.1f}%")

Exit codes, the JSON schema and architecture notes are in AGENTS.md.

Local mode is the default, and it's what I use. The remote Hugging Face Space presets from earlier experiments are still there if you want a generative edit pass. These upload your images, so don't use them on anything you can't share.

unwatermark --list-presets
Preset Backend Notes
local(default) Offline UNet++ + big-lama.pt Multi-scale scan, 2D lattice recovery, local-crop LaMa. No uploads, no quotas
local-mask Offline big-lama.pt Local LaMa inpainting with your own --mask mask.png
qwen Qwen/Qwen-Image-Edit (HF ZeroGPU) Remote generative fallback. Set HF_TOKEN for a bigger daily quota
auto nimeshakalanka24/watermark-remover Remote HF Space, CPU
zip-batch Faraztbt/watermark-remover Remote HF Space, batch ZIP
mask xTHExBEASTx/watermark-remover Remote HF Space, mask-based

Built by otterolie.

── more in #ai-tools 4 stories · sorted by recency
── more on @unwatermark 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/offline-watermark-re…] indexed:0 read:5min 2026-12-03 · —