Skip to main content
Glama

batch

cli_batch

Batch-process all supported media files in a directory to remove AI provenance metadata and watermarks from images, video, audio, and text.

Instructions

Process all supported media files (images, videos, audio, text) in a directory.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "directory": "<directory>"
    },
    "name": "cli_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoProcessing mode.visible
seedNoRandom seed for reproducibility. Default 0: all profiles are certified at a fixed seed, because SynthID removal near the strength floor is seed-dependent.
tileNoProcess large images in overlapping tiles instead of one forward pass. This keeps the input's native dimensions instead of applying --max-resolution, but still regenerates every tile. Engages only when the long side exceeds --tile-size. Default off.
forceNoRun the diffusion scrub even when no invisible AI watermark is locally detectable. Default: skip it (regeneration only degrades a clean image; a skip never claims the image is watermark-free -- this package has no local SynthID pixel decoder).
presetNoCleaning preset: lossless-fast (metadata + fast visible), balanced (auto backend + verified signals), or deep-clean (full studio pixel/audio regeneration).
vendorNoKnown AI generator cohort (image: openai, google, microsoft, meta; audio/video: google, elevenlabs, suno, udio, openai, cartesia, meta, resemble, microsoft). Naming the cohort asserts the invisible mark is present and runs the certified scrub even when provenance metadata was already stripped.auto
backendNoFill backend for visible-mark removal (localize -> fill). auto: best available, LaMa > MI-GAN > cv2 (a learned backend needs the 'lama' or 'migan' extra; else cv2, with a warning). cv2: classical inpaint (no model download, smears texture). migan: MI-GAN ONNX (light, ~1 GB, the memory-tight pick). lama: big-LaMa ONNX (best quality, ~4.7 GB).auto
unsharpNoUnsharp-mask sharpening strength (0 = off, typical: 0.3-0.8).
hf_tokenNoHugging Face API token.
humanizeNoAnalog Humanizer film grain intensity (0 = off, typical: 2.0-6.0).
pipelineNoPipeline profile. qwen-zimage (DEFAULT, Apache-2.0) = Qwen-Image-2512 + Lightning + Canny, followed by SAM-masked Z-Image face repair; qwen21-zimage (NON-COMMERCIAL / PERSONAL & RESEARCH USE ONLY under the Qwen Research License) = Qwen-Image-2.1 + texture-fix VAE + Canny + the same Z-Image face stage; sdxl-zimage = the same recipe and the same face stage on an SDXL global pass, which needs more denoise; chroma-zimage = the same face stage on an Apache-2.0 Chroma1 global pass; auto = pick the commercial-safe engine from the provenance (sdxl-zimage for Google, chroma-zimage for Microsoft, qwen-zimage for OpenAI/Meta/unknown). All are CUDA-ONLY -- install the qwen-zimage extra. There is no CPU or MPS profile for invisible-watermark removal.qwen-zimage
strengthNoDenoising strength (0.0-1.0). Default: profile-adaptive (qwen-zimage uses resolution-adaptive denoise, with flat OpenAI 0.15625 / Google 0.35 / Microsoft InvisMark 0.15 / Meta Content Seal 0.1 floors; qwen21-zimage uses the same curve and floors with OpenAI 0.2, local quality acceptance and Google 0.45; sdxl-zimage uses OpenAI 0.15 / Google 0.5 / unknown 0.5; chroma-zimage uses OpenAI 0.2 / Microsoft 0.125 / Google 0.5 / Meta 0.17, from the C2PA issuer).
directoryYesdirectory
tile_sizeNoTile dimension in px for --tile. Default 1024.
output_dirNoOutput directory (default: <dir>_clean/).
cpu_offloadNoOffload model components to CPU between CUDA calls instead of keeping the whole pipeline in VRAM, at the cost of speed. Forces the face stack to offload instead of using automatic residency, on every profile. It reaches the global stack of qwen-zimage, qwen21-zimage, and sdxl-zimage, which also stream theirs automatically on a card too small to hold it; chroma-zimage keeps its global stack resident either way.
sensitivityNoHow hard to trust a borderline mark. auto: relax a mark only when metadata or a same-product sibling mark corroborates it (safe; clean images untouched). strict: high-precision visual gate only, never relaxed. To act on a mark YOU can see but the detector missed, use 'erase --region' or '--mark <name> --no-detect' rather than a blanket relaxation.auto
tile_overlapNoOverlap between adjacent tiles in px (feather-blended, no seam). Default 128.
max_resolutionNoCap long side (px) before diffusion; 0 = native and preserves the most detail. Raise only on GPU OOM.
adaptive_polishNoRestore the input's detail level after removal (capped unsharp + edge-masked grain targeting the input's sharpness, sparing text), countering the over-smoothed look. Unset follows the profile: ON for sdxl-zimage, OFF for qwen-zimage, whose upstream-matching output is left unchanged. It self-limits where there is no detail deficit (text/flat graphics). Independent of --unsharp/--humanize.
controlnet_scaleNoCanny ControlNet conditioning scale on the global stage (structure/text preservation strength). Higher = closer to original structure.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.64.0
    • addedInput schema / properties / preset
      Added value: +{
      +  "description": "Cleaning preset: lossless-fast (metadata + fast visible), balanced (auto backend + verified signals), or deep-clean (full studio pixel/audio regeneration).",
      +  "enum": [
      +    "lossless-fast",
      +    "balanced",
      +    "deep-clean"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / vendor / description
      Previous value: -"Strength cohort for the invisible-removal default, and it implies the scrub runs even without a local signal: naming the cohort asserts the pixel watermark is present. auto: derive from C2PA provenance, else resolution-adaptive. Set explicitly when the source is known but unreadable (e.g. meta for Muse Image Content Seal, which never carries C2PA)."New value: +"Known AI generator cohort (image: openai, google, microsoft, meta; audio/video: google, elevenlabs, suno, udio, openai, cartesia, meta, resemble, microsoft). Naming the cohort asserts the invisible mark is present and runs the certified scrub even when provenance metadata was already stripped."
    • changedInput schema / properties / vendor / enum
      Previous value: -[
      -  "auto",
      -  "openai",
      -  "google",
      -  "microsoft",
      -  "meta"
      -]New value: +[
      +  "auto",
      +  "openai",
      +  "google",
      +  "microsoft",
      +  "meta",
      +  "elevenlabs",
      +  "suno",
      +  "udio",
      +  "cartesia",
      +  "resemble"
      +]
  2. Addedv0.58.1

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The only annotation is openWorldHint=false, and the description does not disclose whether originals are modified, that output defaults to <dir>_clean/, what the processing pipeline does, or what resources are required. For a 21-parameter batch mutation tool, this leaves nearly all behavioral burden on the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence with no filler, and every word contributes to scope. Its brevity is a completeness problem rather than a conciseness problem, so it scores well here but not perfectly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 21-parameter batch mutation tool with no output schema and only an openWorldHint annotation, one generic sentence is far too thin. It does not explain output location, safety, resource requirements, or how the many mode/pipeline/backend options interact.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 21 parameters, including enums, defaults, and detailed behavior for pipeline, backend, strength, and seed. The description adds no parameter-level meaning beyond what the schema provides, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource and scope ('all supported media files (images, videos, audio, text) in a directory') and distinguishes the all-media batch from per-type siblings such as cli_audio_batch and cli_video_batch. However, the verb 'process' is vague and never states that the operation is cleaning/watermark removal, so the agent cannot tell what processing actually occurs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no when-to-use or when-not-to-use guidance. It does not route the agent to per-type batch tools, explain when the all-media batch is preferable, or mention prerequisites such as GPU availability or model downloads.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.