Batch Text-to-Image

Batch generate brand new images from multiple text prompts. Supports both directory scan mode and config file mode, suitable for large-scale content generation.

meitu batch text-to-image

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 generation)
meitu batch text-to-image \
  --input-dir ./prompts \
  --output-dir ./generated \
  --size 2K \
  --ratio 16:9 \
  --json

# Scenario 2: Config file mode (customized parameters)
meitu batch text-to-image \
  --config ./batch.text-to-image.yaml \
  --output-dir ./generated \
  --json

# Scenario 3: High-concurrency batch generation
meitu batch text-to-image \
  --input-dir ./prompts \
  --output-dir ./generated \
  --model praline_pro \
  --concurrency 5 \
  --max-retries 2 \
  --skip-exist \
  --json-output ./result.json

Config File Example

version: 1
defaults:
  outputDir: ./generated
  size: 2K
  ratio: 16:9
  model: gummy
items:
  - prompt: an orange cat sitting on a windowsill, simple illustration style
  - prompt: futuristic city skyline, cyberpunk style
    size: 4K
    model: praline_pro
  - prompt: alpine lake at sunrise, photorealistic style
    ratio: 4:3

Parameter Reference

ParameterRequiredDescription
--input-dirNoInput directory, scans text files (one prompt per line)
--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
--sizeNoType: string; Options: 1K / 2K / 4K; Output resolution
--ratioNoType: string; Aspect ratio
--modelNoType: string; Default: auto; Options: auto / gummy / praline_pro