# CLI guide The command line interface is organized around the type of work you want to do. ```text remove-ai-watermarks [OPTIONS] COMMAND [ARGS] ``` Run `remove-ai-watermarks COMMAND --help` for the complete option list and defaults. This page focuses on choosing the right command. ## Command dependency map | Command or signal | Required installation | | --- | --- | | `metadata` and metadata-only `identify` | Default package | | `classify-source` | `remove-ai-watermarks[source-classify]` | | Visible signals in `identify` | `remove-ai-watermarks[visible]` (`pixels` is the minimal runtime) | | Open DWT-DCT signals in `identify` | `remove-ai-watermarks[detect]` | | Adobe TrustMark signals in `identify` | `remove-ai-watermarks[trustmark]` | | `visible` and `erase` with OpenCV | `remove-ai-watermarks[visible]` (`pixels` is the minimal runtime) | | `visible` or `erase` with MI-GAN | `remove-ai-watermarks[migan]` | | `visible` or `erase` with big-LaMa | `remove-ai-watermarks[lama]` | | `invisible` and `all` (needs CUDA) | `remove-ai-watermarks[qwen-zimage]` | | `video metadata` and `video identify --no-visible` | Default package | | `video identify` | `remove-ai-watermarks[video]` | | `video visible`, `video all`, and visible/all batch modes | `remove-ai-watermarks[video]` (includes FFmpeg and ffprobe) | | `video invisible` and `video all --invisible` | `remove-ai-watermarks[video,diffusion]` (includes FFmpeg and ffprobe) | | HEIC/HEIF/AVIF pixel input | Add `remove-ai-watermarks[heif]` | | Every production command and Python-compatible backend | `remove-ai-watermarks[all]` | | `mcp` | Default package; each tool needs the extra of the command it runs | `batch` requires the same extra as its selected mode. Extras can be combined in one installation, for example `remove-ai-watermarks[visible,detect,heif]`. ## Inspect an image ```bash remove-ai-watermarks identify image.png ``` `identify` always inspects supported metadata. When pixel extras are installed, it also evaluates supported visible and invisible pixel signals. When no signal is found, it reports the origin as unknown. It does not claim the image is clean. For C2PA files, the text report shows asset integrity, claim-signature, signer-trust, and signer-validity results separately. Confidence follows the binding: an intact asset binding and claim signature is high confidence, and an unanchored or expired signer is reported as a caveat rather than a lower score, because no trust anchor list ships with the reader. A failed asset binding or signature, or a revoked signing credential, does not confirm the claimed origin. When a structured C2PA soft binding is present, the report also names its exact algorithm and signed value. Removing the manifest does not remove a referenced pixel watermark, and a referenced content fingerprint may still be recomputed. A fingerprint is reported as a durable-provenance signal, not as a watermark or a pixel-removal target. Machine readable output: ```bash remove-ai-watermarks identify image.png --json ``` Metadata only inspection: ```bash remove-ai-watermarks identify image.png --no-visible ``` Despite the historical option name, `--no-visible` skips all pixel detectors, including visible marks, open DWT-DCT, and TrustMark. Metadata inspection still runs. ## Classify source/export pipeline from pixels (opt-in) To classify an image's likely AI generation/export pipeline and model version subfamily from pixels after metadata removal, install the `source-classify` extra and run `classify-source`. `identify` never runs this command, and it is not a SynthID detector: ```bash uv tool install --force "remove-ai-watermarks[source-classify]" remove-ai-watermarks classify-source image.png remove-ai-watermarks classify-source image.png --json ``` `classify-source` evaluates all 10 provider classes (`openai`, `google`, `bytedance`, `flux`, `stable_diffusion`, `meta`, `midjourney`, `ideogram`, `firefly`, `xai`) and abstains as `unknown` when no provider clears its calibrated margin threshold. When a provider is accepted, the stacked Stage-2 head also reports `version_subfamily` (for example `google:gemini_3_pro_image`, `openai:gpt_image_1_5`, `flux:flux_2_pro`, `stable_diffusion:sdxl`, `midjourney:v6_1`). `watermark_truth` is always `"unknown"`. Guide: [source-pipeline classification](source-classify.md). ## Remove known visible marks Install `remove-ai-watermarks[visible]` before using `visible` or `erase`. ```bash remove-ai-watermarks visible image.png -o clean.png ``` The default behavior: - checks every registered visible mark; - removes every detected match, except the weakly detected Jimeng label pill, which needs corroboration (see [supported signals](supported-signals.md)); - selects the best installed fill backend; - checks the filled region once without changing it or retrying the fill; - strips AI metadata from the output. The re-encode never costs display fidelity: the ICC colour profile and the EXIF orientation tag are carried over from the source (see [strip AI metadata](#strip-ai-metadata)). The automatic command reports `Removed and validated` when the detector no longer accepts an overlapping mark, `Partial` when an overlapping residual is still detected, and `Post-removal validation unavailable` when the check fails. The latter two still write the once-filled output and return success; they are result-quality statuses, not requests for an automatic second edit. Use a specific mark: ```bash remove-ai-watermarks visible image.png --mark gemini -o clean.png ``` Available mark names are printed by: ```bash remove-ai-watermarks visible --help ``` Keep metadata: ```bash remove-ai-watermarks visible image.png --keep-metadata -o clean.png ``` Use the strict visual gate without metadata or sibling corroboration: ```bash remove-ai-watermarks visible image.png --sensitivity strict -o clean.png ``` Act on a mark you can see but the detector will not confirm, by naming it and skipping the gate: ```bash remove-ai-watermarks visible image.png --mark gemini --no-detect -o clean.png ``` `--detect` is the default. `--no-detect` removes the named mark's footprint unconditionally, so it only makes sense together with an explicit `--mark`; on an image that never carried that mark it inpaints a region for nothing. Prefer `erase --region` when you know the geometry. When no known mark is detected, the command does not write a new output. Use `erase` if you can identify the affected region yourself. ## Erase a region ```bash remove-ai-watermarks erase image.png \ --region 1640,1930,400,100 \ -o clean.png ``` The region format is `x,y,width,height`. Repeat `--region` to erase more than one box: ```bash remove-ai-watermarks erase image.png \ --region 20,20,180,60 \ --region 1640,1930,400,100 \ -o clean.png ``` Choose the fill backend: ```bash remove-ai-watermarks erase image.png \ --region 1640,1930,400,100 \ --backend migan \ -o clean.png ``` `erase` accepts `cv2`, `migan`, and `lama`. The corresponding optional extra must be installed for a learned backend. Two more knobs tune the fill. `--dilate N` (default 3) grows every box by `N` pixels before inpainting, which helps when a mark has a soft edge or a drop shadow just outside the box you measured; it applies to every backend because it shapes the mask. `--inpaint-method telea|ns` selects the classical algorithm and only affects the `cv2` backend. Like `visible`, `erase` strips AI metadata from the output by default; pass `--keep-metadata` to retain it. The ICC colour profile and the EXIF orientation tag survive either way. ## Strip AI metadata Inspect metadata: ```bash remove-ai-watermarks metadata image.png --check ``` Remove AI metadata and write a new file: ```bash remove-ai-watermarks metadata image.png --remove -o clean.png ``` When `-o` is omitted, removal overwrites the source. Standard metadata is kept unless you pass `--remove-all`; that includes the display tags -- the ICC colour profile and the EXIF orientation -- which also survive every pixel-command re-encode (`all`, `visible`, `invisible`, `erase`), because colour and geometry are display fidelity, not provenance. Orientation is re-tagged, not re-applied: the raster is untouched, so what displayed upright still displays upright. A quiet `--check` or a successful `--remove` is not a clean verdict. The command only inspects and strips embedded AI metadata; a pixel watermark such as SynthID has no local decoder once that metadata proxy is gone. `identify` reports the same limit. The command also supports the audio and video containers listed in [supported signals](supported-signals.md). ffmpeg must be available for the non-ISOBMFF audio and video path, either from the `video` extra or the system. ## Identify and clean video Install the video pixel and timestamp runtime for visible identification, removal, and the complete pipeline: ```bash uv tool install --force "remove-ai-watermarks[video]" ``` Inspect every locally supported video signal: ```bash remove-ai-watermarks video identify input.mp4 remove-ai-watermarks video identify input.mp4 --json remove-ai-watermarks video identify input.mp4 --no-visible ``` The default scans the complete clip for stable registered visible marks and inspects supported metadata. A result with no signals is reported as unknown, not clean, because proprietary pixel watermarks have no public local decoder. `--no-visible` performs metadata-only inspection. Use the complete locally verifiable cleaning path: ```bash remove-ai-watermarks video all input.mp4 -o clean.mp4 ``` It removes a stable supported visible mark when found and always strips verified AI metadata. When neither signal is found, it writes a same-container passthrough instead of returning a missing output. The source is never overwritten. Invisible regeneration is deliberately opt-in: ```bash remove-ai-watermarks video all input.mp4 -o clean.mp4 --invisible ``` That option is supported only for MP4, MOV, and M4V. It is lossy and uses the same default SynthID profile as `video invisible`. To select the experimental Seedance recipe for an owned MP4: ```bash remove-ai-watermarks video all input.mp4 -o clean.mp4 --invisible --profile seedance-experimental remove-ai-watermarks video batch ./videos --invisible --profile seedance-experimental ``` The complete pipeline runs supported visible-mark removal before this pixel stage. Unsupported visible overlays still require separate preparation. `--profile seedance-experimental` requires `--invisible` in all/batch mode. The batch keeps one VAE runtime across files and reports unsupported containers as per-file failures. Process all supported files in a top-level directory: ```bash remove-ai-watermarks video batch ./videos --mode all remove-ai-watermarks video batch ./videos --mode visible remove-ai-watermarks video batch ./videos --mode metadata ``` The batch runs sequentially, preserves successful outputs when another file fails, and exits nonzero if any item failed. Visible no-op files are copied byte-for-byte so the output directory remains complete. `--invisible` is available only with `--mode all`. ## Identify and clean text Inspect deterministic text provenance and character steganography in plain text, Markdown, or HTML files: ```bash remove-ai-watermarks text identify article.md remove-ai-watermarks text identify article.md --json ``` `text identify` runs with no optional ML or pixel extras. It detects and decodes: - C2PA 2.3/2.4 Appendix A.8 `C2PATextManifestWrapper` (`C2PATXT\0` encoded in trailing Variation Selectors `U+FE00`..`U+FE0F` and `U+E0100`..`U+E01EF`, prefixed by `U+FEFF`); - C2PA 2.3/2.4 Appendix A.9 structured-text ASCII-armored manifest blocks (`-----BEGIN C2PA MANIFEST----- ... -----END C2PA MANIFEST-----`); - C2PA 2.3/2.4 Appendix A.7 HTML `