Automatically removes the Google Gemini star watermark from AI-generated images using AI inpainting — similar quality to Photoshop's content-aware fill, but fully automated.
| Before | After |
|---|---|
| Gemini star visible in bottom-right corner | Watermark removed, background filled naturally |
Google Gemini places a small 4-pointed star logo in the bottom-right corner of every image it generates. DeGem masks that region and uses the LaMa inpainting model to reconstruct the background — no manual editing required.
- Python 3.8 or higher
- pip
- ~200MB of free disk space (for the LaMa model, downloaded once on first run)
1. Clone the repo
git clone https://github.com/earlduque/DeGem.git
cd DeGem2. Install dependencies
pip install -r requirements.txtThat's it. The LaMa AI model (~200MB) will download automatically the first time you run the script.
- Drop your Gemini-generated images into the
input/folder - Run:
python degem.py- Cleaned images appear in
output/with_cleanadded to the filename (e.g.image.png→image_clean.png) - Successfully processed originals are moved to
processed/to keep your input folder clean
Start the watcher:
python degem.py --watchNow any image you drop into the input/ folder will be automatically processed, saved to output/, and the original moved to processed/. Press Ctrl+C to stop.
.jpg .jpeg .png .webp
Loading LaMa inpainting model (first run downloads ~200MB)...
Model ready.
Found 3 image(s) to process.
Processing photo1.png (2816x1536)...
Saved -> output\photo1_clean.png
Processing photo2.jpg (1024x1024)...
Saved -> output\photo2_clean.jpg
Processing photo3.webp (2048x2048)...
Saved -> output\photo3_clean.webp
Done. 3/3 images saved to output/
Originals moved to processed/
"simple-lama-inpainting not installed" error
Run pip install -r requirements.txt and try again.
The watermark is still faintly visible The mask includes padding around the watermark region for cleaner edges. If results aren't clean, the image may have an unusual size. Open an issue with the image dimensions.
Slow processing LaMa runs on CPU by default. If you have an NVIDIA GPU with CUDA installed, it will automatically be used for faster processing.
Output looks blurry or wrong in that corner This can happen with very complex backgrounds (e.g. fine text or detailed patterns right at the corner). LaMa generally handles this well but isn't perfect — for tricky cases Photoshop's content-aware fill may still give better results.
- Original images are moved to
processed/after successful processing — if something goes wrong, the original stays ininput/ - The
input/,output/, andprocessed/folder contents are gitignored — your images won't be committed if you fork this repo - The LaMa model is cached after the first download at
~/.cache/torch/hub/checkpoints/big-lama.pt
MIT