Batch Text Replacement in Images

Batch replace text content on images. Supports standard printed text as well as decorative, handwritten, and stylized complex text replacement.

meitu batch image-text-replace

Note: Batch processing is available from meitu-cli v2.1.1 onward. Please upgrade if you're on an older version.

Usage Examples

# Scenario 1: Directory scan mode
meitu batch image-text-replace \
  --input-dir ./images \
  --output-dir ./edited \
  --source-words "old text" \
  --target-words "new text" \
  --json

# Scenario 2: Config file mode
meitu batch image-text-replace \
  --config ./batch.image-text-replace.yaml \
  --output-dir ./edited \
  --json

Config File Example

version: 1
defaults:
  outputDir: ./edited
items:
  - input: ./images/banner1.jpg
    sourceWords: original price 100
    targetWords: now 50
  - input: ./images/poster1.jpg
    prompt: change the date to January 1, 2024

Parameter Reference

ParameterRequiredDescription
--input-dirNoInput directory, recursively scans image files
--output-dirYesOutput directory
--configNoPath to YAML/JSON config file
--concurrencyNoType: number; Default: 3; Number of parallel tasks
--max-retriesNoType: number; Default: 0; Number of retries on failure
--skip-existNoSkip existing output files
--dry-runNoPreview the plan without execution
--no-progressNoDisable per-task progress logging
--jsonNoOutput results in JSON format
--json-outputNoWrite results to a specified JSON file
--skill-nameNoSkill name for server-side attribution
--source-wordsNoType: string; Source text to replace
--target-wordsNoType: string; Target replacement text
--promptNoType: string; Text replacement description