English · 简体中文
OpenNoMark combines multi-expert watermark localization with content-aware LaMa inpainting. It keeps calibrated fast paths for Gemini, Doubao, Qwen, Jimeng, Kling, Tencent Yuanbao, Baidu, and similar generators, while adding a conservative generic path for compact visible text watermarks away from the corners. The complete workflow stays on your own machine.
The project removes visible overlays; it does not alter or remove invisible provenance metadata or content credentials.
Web workbench · Results · Install · Architecture · Verification
The responsive workbench is built for both single-image inspection and long-running batches. It keeps finished results available while the remaining images continue, shows per-file progress, and makes the next action clear on desktop and mobile.
| Batch without losing context | Review before saving | Local by default |
|---|---|---|
| Upload one image or a whole set. Each file has its own queued, uploading, processing, completed, or failed state. | Compare the original and processed image, retry individual failures, and download one result or every completed result as a ZIP. | Detection and reconstruction run locally. The application does not send images to a hosted inference API. |
The same processing core powers the Web UI, command-line interface, Python API, and cross-agent Skill. Start visually, automate later, and keep the same result semantics in every workflow.
- Drop or select PNG, JPEG, or WebP images.
- Start the pending files and follow each image independently.
- Open any completed item for a before/after comparison.
- Download one result immediately, retry a failure, or export all completed results as a ZIP.
- Add more images without reprocessing results that are already complete.
The interface includes an English and Simplified Chinese language switch.
These examples are repository artifacts, not design mockups. Every pair places the source image on the left and its corresponding OpenNoMark output on the right.
| Original | Processed |
|---|---|
![]() |
![]() |
| Original | Processed |
|---|---|
![]() |
![]() |
| Original | Processed |
|---|---|
![]() |
![]() |
LaMa reconstructs the masked area from its surroundings instead of blurring the watermark. Results still depend on the mark, contrast, and underlying texture; review important images in the comparison view.
Requirements: Python 3.10+, uv, and Node.js/npm. A machine with at least 16 GB of memory is recommended.
git clone https://github.com/NanmiCoder/OpenNoMark.git
cd OpenNoMark
# macOS / Linux
./start.sh
# Windows
start.batOpen http://localhost:48292. The launcher installs the API and frontend dependencies, then starts both development servers.
For manual startup:
# Terminal 1 · API
uv sync --extra api
uv run uvicorn opennomark.api:app --port 48291
# Terminal 2 · Web UI
cd frontend
npm install
npm run devInstall the command without cloning the repository:
uv tool install git+https://github.com/NanmiCoder/OpenNoMark.git
opennomark --versionProcess a file, several paths, a directory, or a glob:
opennomark image.png -o output/
opennomark img1.png img2.jpg -o output/
opennomark ./my-images/ -o output/
opennomark "./incoming/*.webp" -o output/
# Detection boxes and masks for debugging
opennomark ./my-images/ -o output/ --debug
# One machine-readable response for agents and scripts
opennomark ./my-images/ -o output/ --json
# Explicit device selection when needed
opennomark image.png -o output/ --device cpuThe first processing run downloads the required model weights: OWLv2 is approximately 500 MB and LaMa is approximately 196 MB. The generic text fallback lazily downloads the PP-OCRv5 mobile detector and recognizer (approximately 45 MB combined) only when needed.
OpenNoMark follows the cross-agent skills layout. Install the portable instruction layer for Codex, Claude Code, Cursor, OpenCode, and other supported agents:
# Detect installed agents automatically
npx skills add NanmiCoder/OpenNoMark --skill opennomark
# Non-interactive global install for selected agents
npx skills add NanmiCoder/OpenNoMark --skill opennomark -g \
-a codex -a claude-code -a cursor -yThe Skill invokes the same versioned CLI, directly when installed or through uvx; it does not maintain a second image-processing implementation.
from opennomark.pipeline import WatermarkRemovalPipeline
pipeline = WatermarkRemovalPipeline()
image, metadata = pipeline.process("image.png", "clean_image.png")
print(metadata["status"], metadata["watermarks_found"])
results = pipeline.process_batch(
["img1.png", "img2.jpg"],
output_dir="output/",
callback=lambda index, total, item: print(index, total, item["status"]),
)OpenNoMark separates where the watermark is from how the missing content is reconstructed. That boundary lets detection evolve across generators without duplicating the inpainting stack.
- One production contract: every detector returns
box,score,source, andmethodthrough the same region interface. The pipeline never routes by filename or provider directory. - Tiered localization: Gemini's lightweight spatial detector is calibrated on real positive images and hard negatives; it is not a fine-tuned foundation model. OWLv2 runs the established corner prompts and generic watermark prompts in separate passes so new vocabulary cannot dilute the calibrated platform signal. A local PP-OCRv5 fallback recognizes strong watermark phrases such as
SAMPLE,PREVIEW, andAI GENERATED, or edge-bound URLs and handles, and turns the recognized polygon into a tighter mask. - Conservative fusion: precise platform masks win overlapping proposals. Independent generic regions need strong semantic evidence or matching OCR evidence; up to four compact regions can be returned. Candidate-count and total-area budgets fail closed instead of partially erasing tiled or ambiguous overlays.
- Reconstruction and validation: LaMa runs against a compact local mask, then the same visual expert checks the repaired area. A residual triggers one mask-only retry; unresolved evidence is reported as
partialinstead of silently claiming success. - Inspectable edits: metadata reports both the detected watermark box and the exact feathered mask bounds used for reconstruction, allowing the verification harness to distinguish legitimate blending from edits that escape the claimed area.
- Safety boundary: the pipeline targets small-to-medium, high-confidence visible marks. It is not a general object-removal tool; broad or dense tiled candidates are explicitly blocked.
| Environment | Detection | Inpainting |
|---|---|---|
| NVIDIA CUDA | CUDA | CUDA |
| Apple Silicon | MPS when available | CPU fallback |
| CPU-only | CPU | CPU |
LaMa is loaded through CPU-compatible deserialization before being moved to a supported target. Requests for LaMa on MPS fall back to CPU because its TorchScript graph includes operations not supported reliably by MPS.
The Web UI uses bounded batch concurrency instead of loading a model per worker. Apple Silicon processes up to two images at once by default so MPS detection can overlap with CPU inpainting; CUDA and CPU-only environments default to one. Set OPENNOMARK_MAX_CONCURRENCY=1..4 before starting the API to override the detected limit.
The repository keeps real source images grouped by generator. Treat these directories as a regression corpus when changing candidate generation, scoring, masks, or inpainting:
| Corpus | Coverage focus |
|---|---|
examples/gemini/ |
Sparkle sizes, output tiers, anchors, contrast, and textured backgrounds |
examples/doubao/ |
Text labels and newer visible logo variants across portraits and complex scenes |
examples/qwen/ |
Qwen logo variants, scale changes, and diverse corner backgrounds |
examples/jimeng/ |
Jimeng icon-and-text signatures over motion, glare, and high-contrast effects |
examples/kling/ |
Kling 3.0 signatures over reflective desks and structured interiors |
examples/yuanbao/ |
Tencent Yuanbao text signatures in landscape and portrait aspect ratios |
examples/baidu/ |
Baidu AI-generated labels over monochrome portraits and hard tonal edges |
Do not infer quality from one showcase image or a fixed headline percentage. Run the automated suite, inspect every corpus result, and compare the modified area at full resolution.
The checked full-corpus report covers all 80 current original images: Gemini 20/20, Doubao 16/16, Qwen 21/21, Jimeng 7/7, Kling 4/4, Tencent Yuanbao 8/8, and Baidu 4/4. This is a regression result for the committed corpus, not a promise that every future watermark style will be recognized.
# Backend and integration tests
uv sync --extra api --extra dev
uv run pytest tests/ -v
# Frontend quality gates
cd frontend
npm install
npm run lint
npm run build
# Fast, filename-independent localization gate across every original image
cd ..
uv run python -m tests.dataset_evaluation --mode localize \
--output verify/localization.json
# Full release gate: localized pixel change, containment, and residual checks
uv run python -m tests.dataset_evaluation --mode full \
--output verify/full.json --results-dir verify/corpusOpenNoMark/
├── opennomark/
│ ├── pipeline.py # routing and processing metadata
│ ├── localizer.py # unified visual-evidence region contract
│ ├── detector.py # tiered open-vocabulary proposals
│ ├── text_detector.py # lazy PP-OCRv5 text watermark fallback
│ ├── gemini_alpha.py # Gemini detection and mask utilities
│ ├── inpainter.py # LaMa masking, local repair, and blending
│ ├── cli.py # command-line entry point
│ ├── api.py # FastAPI upload and download endpoints
│ └── assets/ # packaged detector data and alpha maps
├── frontend/ # React 19 + Vite Web workbench
├── skills/opennomark/ # cross-agent Skill
├── examples/ # Seven-provider real-image regression corpus
├── scripts/ # data-driven detector calibration
└── tests/ # unit, integration, API, CLI, and Skill tests
Install a source checkout for development with:
uv sync --extra api --extra dev
cd frontend && npm installWhen changing detection, evaluate false positives as carefully as successful removals. A missed mark leaves the source image intact; an incorrect mask can erase real content.
- Processing runs on your machine, but model weights are fetched from Hugging Face and GitHub Releases on first use.
- The local Web API writes uploads and results under your operating system's temporary directory. Do not expose the development server to an untrusted network; it has no authentication layer.
- Compact horizontal text marks, edge URLs/handles, and multiple small high-confidence regions have generic coverage, but low-contrast, vertical, diagonal, or logo-only marks can still be missed.
- When full-frame or dense tiled candidates are detected, the automatic-removal safety budget blocks them instead of cleaning a partial prefix; weak patterns may still be missed. Invisible provenance signals and arbitrary object removal remain outside the current scope.
- Inpainting is generative reconstruction. Fine text, faces, repeated patterns, and hard edges deserve manual review.
Use OpenNoMark only on images you own or are authorized to modify, and follow the source platform's terms and applicable law.
OpenNoMark is provided under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. In particular, the repository is licensed for non-commercial use; review the full license before redistributing or integrating it.







