- Blog
- Florence-2 + LaMA: Two-Step AI Watermark Removal Pipeline
Florence-2 + LaMA: Two-Step AI Watermark Removal Pipeline
Florence-2 + LaMA: Two-Step AI Watermark Removal Pipeline
From Sora 2 to Runway Gen-4.5, AI video generation tools all stamp their watermarks on the final output. Some are semi-transparent logos in the corner, some are text labels that fade in and out over time, and some, like Google Veo, embed invisible SynthID fingerprints alongside the visible mark.
For users who need to repurpose footage for commercial release, education, or secondary editing, these watermarks are a real obstacle. One of the most noteworthy open-source solutions in 2026 combines Microsoft's Florence-2 with the LaMA inpainting model — WatermarkRemover-AI, an MIT-licensed tool designed specifically for removing watermarks from AI-generated content.
Florence-2: Microsoft's Vision-Language Model
Florence-2 is a multimodal vision-language model (VLM) released by Microsoft Research in 2024 under the MIT license. Its core capability isn't "watermark removal" — it's understanding what's in an image and where.
Florence-2 uses a prompt-based architecture: you tell it what to look for, and it annotates the image accordingly. Supported tasks include:
- Object detection: Drawing bounding boxes around specific objects in the scene
- Segmentation: Pixel-level separation of different image regions
- Captioning: Natural language descriptions of image content
- Phrase grounding: Mapping text descriptions to image regions
The model was trained on FLD-5B — an autonomously generated dataset with 5.4 billion annotations across 126 million images. The large variant, Florence-2-large, has 0.77B parameters — compact but powerful.
In the watermark removal context, Florence-2 acts as the detector: given an image with a watermark and "watermark" as the detection prompt, it precisely locates the watermark region and outputs a bounding box.
LaMA: The Large-Area Inpainting Expert
LaMA (Large Mask Abstraction Model) comes from Samsung Research and is a benchmark model in the inpainting domain. Inpainting is straightforward: given an image and a masked area, the model regenerates the missing region so the entire image looks natural and coherent.
LaMA's key breakthrough is high-resolution generalization. Traditional inpainting models either train at low resolution and lose details, or train at extremely high resolution with prohibitive costs. LaMA took a middle path: train at low resolution, but architecturally enable generalization to high resolution.
Specifically, LaMA uses:
- Frequency-domain abstraction: Converting intermediate features to the frequency domain to avoid high-frequency detail loss
- Fourier layers: Introducing frequency-domain information during feature fusion to improve large-area restoration quality
This means even when a watermark covers a large portion of the frame, LaMA can reconstruct reasonable content based on surrounding pixel textures and semantic information.
The Combination: WatermarkRemover-AI's Pipeline
WatermarkRemover-AI (D-Ogi's GitHub project) chains these two models into a complete workflow:
Step 1: Florence-2 detects watermark positions
After uploading an image or video, Florence-2 uses "watermark" as the detection prompt to identify watermark bounding boxes in each frame. The tool supports custom detection prompts (--detection-prompt), allowing you to target specific watermark types with different keywords.
Step 2: LaMA repairs the masked regions
Once the watermark's precise location is identified, LaMA performs inpainting on the marked area — reconstructing the content hidden beneath the watermark using surrounding pixel information.
Step 3: Frame-by-frame processing (video mode)
For videos, the tool executes the above two steps frame by frame, with optimization options:
--detection-skip: Detect watermark position every N frames to reduce computation--fade-in/--fade-out: Handle fade-in/fade-out watermarks by automatically extending the mask range--max-bbox-percent: Limit maximum detection area as a percentage of the image (default: 10%)
The project also ships with a GUI (built on PyWebview), supporting Windows (run.bat), Linux/macOS (./run.sh), with built-in support for English, Chinese, Japanese, French, and Portuguese.
Real-World Performance
Use Cases
- Sora / Sora 2 video watermarks: Corner logos and text labels
- Runway-generated video watermarks: Fixed-position semi-transparent brand marks
- Image watermarks: Platform-exported watermarked thumbnails and previews
- Dynamic watermarks: Floating watermarks that shift position across frames (requires per-frame processing)
Hardware Requirements
- Recommended GPU: NVIDIA with CUDA acceleration, 4GB+ VRAM minimum
- Video processing requires FFmpeg (
sudo apt install ffmpeg) - Image processing runs on CPU but at slower speeds
Limitations
- Invisible fingerprints cannot be removed: Encryption-level watermarks like Google SynthID are undetectable by Florence-2 and cannot be eliminated by LaMA
- Complex background limitations: When watermarks obscure faces or fine-textured regions, restoration results may appear blurry or unnatural
- Video processing is time-consuming: Per-frame inpainting is computationally intensive — a one-minute 1080P video can take several hours
Comparison with Other Solutions
| Solution | Detection | Restoration | Open Source | Video Support |
|---|---|---|---|---|
| WatermarkRemover-AI | Florence-2 AI detection | LaMA inpainting | ✅ MIT | ✅ |
| LaMa Cleaner | Manual annotation | LaMA / MAT / ZITS | ✅ MIT | ❌ |
| HitPaw Remover | AI detection | Proprietary algorithm | ❌ Closed | ✅ |
| CapCut/PR Gaussian blur | Manual selection | Blur processing | ✅ Free | ✅ |
| WuhenAI (wuhenai.com) | AI detection | Proprietary model | ❌ Closed | ✅ |
WatermarkRemover-AI's core advantage is the combination of fully open-source + automatic detection + high-quality restoration. LaMa Cleaner offers more model flexibility but requires manual region annotation; commercial tools provide better UX but typically have usage limits and costs.
How to Run
# Clone the project
git clone https://github.com/D-Ogi/WatermarkRemover-AI.git
cd WatermarkRemover-AI
# Windows: double-click run.bat (auto-downloads portable Python)
# Linux/macOS: requires Python 3.10+
./run.sh
# CLI batch processing
python remwm.py --overwrite input.mp4
python remwm.py --transparent input.jpg # Output transparent PNG
python remwm.py --detection-prompt "logo" input.png # Custom detection keyword
Summary
The Florence-2 + LaMA combination represents a detect-then-repair two-stage paradigm for watermark removal: use a vision-language model to locate the problem, then use an inpainting model to fix it. The modularity is the key benefit — the detector can be swapped for any object detection model, and the restorer can be replaced with Stable Diffusion inpainting or newer alternatives.
For users who need to handle AI-generated content watermarks, WatermarkRemover-AI is currently the most complete open-source solution. However, it still cannot handle invisible watermarks (like SynthID) or guarantee perfect restoration on complex backgrounds.
Watermark removal technology continues to evolve rapidly. From manual blurring to AI inpainting, to multi-model combinations, each advance diminishes the protective value of visible watermarks — which is precisely why more AI content platforms are shifting toward invisible fingerprinting technologies.
