Batch Background Replacement
Replaces image backgrounds / scenes in batch while preserving the foreground subject. Supports text-based description of the target background.
meitu batch image-background-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-background-replace \
--input-dir ./images \
--output-dir ./outputs \
--prompt "Replace with a white background" \
--json
# Scenario 2: Config file mode
meitu batch image-background-replace \
--config ./batch.image-background-replace.yaml \
--output-dir ./outputs \
--jsonConfig File Example
version: 1
defaults:
outputDir: ./outputs
items:
- input: ./images/product1.jpg
prompt: Replace with a white e-commerce background
- input: ./images/person1.jpg
prompt: Replace with a city night scene backgroundParameter Reference
| Parameter | Required | Description |
|---|---|---|
--input-dir | No | Input directory, recursively scans image files |
--output-dir | Yes | Output directory |
--config | No | Path to YAML/JSON config file |
--concurrency | No | Type: number; Default: 3; Number of concurrent executions |
--max-retries | No | Type: number; Default: 0; Number of retries on failure |
--skip-exist | No | Skip existing output files |
--dry-run | No | Preview the plan without executing |
--no-progress | No | Disable per-task progress logging |
--json | No | Output results in JSON format |
--json-output | No | Write results to a specified JSON file |
--skill-name | No | Skill name attributed on the server side |
--prompt | No | Type: string; Description of the target background |