Skip to content

guillaumemeyer/watermarks-remover / skills/remove-ai-marks

remove-ai-marks

Verified

Remove multi-vendor AI provenance marks: invisible Unicode (Layer A), statistical text watermarks via rewrite (Layer B, always offer), and C2PA/EXIF/XMP/container metadata on PNG/JPEG/WebP/SVG/PDF/DOCX/ODT/HTML/MD/TEX. Covers Claude, Gemini/SynthID-class, OpenAI provenance, and open-LLM sampling marks. Use when the user asks to strip watermarks, remove C2PA/Content Credentials, clean AI metadata, remove invisible Unicode, anti-detect clean AI output, or runs /remove-ai-marks (aliases: /remove-claude-marks).

FileKindSize
SKILL.mdskill md19.2 KB
references/ethics.mdmarkdown1.8 KB
references/how-claude-marks.mdmarkdown1.6 KB
references/mark-classes.mdmarkdown4.2 KB
references/markdiffusion.mdmarkdown3.5 KB
references/removal-matrix.mdmarkdown7.6 KB
references/vendor-notes.mdmarkdown5.7 KB

references/markdiffusion.md

View on GitHub
# MarkDiffusion (THU-BPM) — reference

External research backend: [`THU-BPM/MarkDiffusion`](https://github.com/THU-BPM/MarkDiffusion)
(JMLR; Apache-2.0). A **generative watermarking** toolkit for latent diffusion
models — it *embeds* marks, it does not remove them. This repo uses it as a
controlled-experiment harness and as an optional regeneration-removal engine.

## What it covers (image-only scope)

Nine image algorithms in two categories:

| Category | Algorithms | Notes |
| --- | --- | --- |
| Pattern-based | Tree-Ring, Ring-ID, ROBIN, WIND, SFW | A fixed latent/FT pattern is injected at generation and inverted for detection |
| Key-based | Gaussian-Shading, GaussMarker, PRC, SEAL | A secret key modulates the noise/latent; detection needs the key |

(Video algorithms VideoShield / VideoMark are out of scope for this project.)

## What it gives the remover

- **Same-scheme detector** for the above algorithms via `AutoWatermark.load(...).detect_watermark_in_media()`. Covers the Tree-Ring-class gap in
  `removal-matrix.md`; it does **not** cover StegaStamp, StableSignature, or
  SynthID-media.
- **`DiffusionPurification`** — a blind regeneration attack (DiffPure-style:
  encode → partial noise → reverse-denoise) usable as a pixel-watermark remover.
  Exposed as `--remove-pixel diffusion` in `clean_image.py`.
- **`NeuralCodecCompression`** — codec round-trip (compressai). Not wired here.

## Hard honesty constraints

1. **Detection is same-scheme and same-model only.** Inversion-based detection
   requires the generating model (and for key-based schemes the key). It proves
   "this image came from *this* model/config/params" — it cannot certify that a
   vendor detector will fail on an arbitrary image. This is the same
   same-config-only caveat as the MarkLLM text harness.
2. **`DiffusionPurification` is blind regeneration.** It reuses the *same*
   pipeline, so it will not defeat a watermark that is robust to its own
   regeneration path, and it drifts image content (more than CtrlRegen's
   controllable ControlNet regeneration). Conservative intensity default (0.3),
   treated as a fallback/comparison engine, never a guarantee.
3. **Heavy stack.** torch ≥ 2.4,<2.11 + diffusers + a Stable Diffusion model
   download (~4–10 GB). GPU strongly recommended. Some HF models are gated →
   `HF_TOKEN` (env only, never argv).

## License / hygiene

Apache-2.0. Installed from PyPI at a pinned version
(`requirements-markdiffusion.txt`) or an editable checkout at a pinned commit
(`setup_markdiffusion.sh --checkout`). Never bundled into this repo.

## Harness usage

```bash
SCRIPTS=service/scripts
MD="$HOME/markdiffusion/.venv/bin/python"

"$SCRIPTS/setup_markdiffusion.sh"                     # PyPI pin default
# or: "$SCRIPTS/setup_markdiffusion.sh" --checkout    # editable pinned clone

# 1. watermark a test image with a scheme
echo "a red fox in snow" > /tmp/prompt.txt
"$MD" "$SCRIPTS/markdiffusion_harness.py" watermark /tmp/prompt.txt \
  -o /tmp/wm.png -o2 /tmp/plain.png --scheme tr --json

# 2. remove (blind regeneration)
"$MD" "$SCRIPTS/markdiffusion_harness.py" purify /tmp/wm.png \
  -o /tmp/wm.purified.png --purification-intensity 0.3 --json

# 3. re-detect with the SAME scheme config
"$MD" "$SCRIPTS/markdiffusion_harness.py" detect /tmp/wm.purified.png \
  --scheme tr --detector-type l1_distance --json
```

Exit codes: 0 ok · 1 runtime error · 2 bad input · 3 backend unavailable.

## References

- Paper: https://arxiv.org/abs/2509.10569
- Docs: https://markdiffusion.readthedocs.io
- HF models: https://huggingface.co/Generative-Watermark-Toolkits
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall