Batch Image Cutout
Separates foreground from background in batch, extracting subjects or people with transparent background output. Supports both directory scan mode and config file mode.
meitu batch image-cutout
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 (simple batch cutout)
meitu batch image-cutout \
--input-dir ./images \
--output-dir ./cutouts \
--prompt "Extract the subject" \
--json
# Scenario 2: Config file mode (custom parameters)
meitu batch image-cutout \
--config ./batch.image-cutout.yaml \
--output-dir ./cutouts \
--json
# Scenario 3: High-concurrency batch processing
meitu batch image-cutout \
--input-dir ./products \
--output-dir ./cutouts \
--concurrency 5 \
--max-retries 1 \
--skip-exist \
--json-output ./result.jsonConfig File Example
version: 1
defaults:
outputDir: ./cutouts
items:
- input: ./images/product1.jpg
prompt: Cut out the product subject
- input: ./images/person1.jpg
prompt: Cut out the person
- input: ./images/model.jpg
prompt: Fine cutout, preserve hair detailParameter 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; Cutout guidance prompt |