How to run batch AI generations and script workflows with the CLI

What you'll learn
What is batch generation with the CLI?
Common use cases
Run batch generations step by step
STEP 1: Create a manifest file
- On web: Go to picsart.com/cli → Download a sample manifest template
- On mobile: Not applicable — batch jobs run in terminal only
STEP 2: Configure batch settings
Set up your manifest and concurrency options:
- Manifest format: JSON array with prompt, model, and output path for each job
- Concurrency: Add --max-jobs 5 to run 5 generations in parallel (adjust based on your account limits)
- Resume mode: The CLI skips files that already exist, so you can re-run after failures
- Output directory: Use --output ./results to save all files to a specific folder

STEP 3: Run the batch job
Execute gen-ai batch --manifest prompts.json with your manifest file. The CLI processes all jobs in parallel based on your concurrency limit. Progress updates show how many jobs are complete, pending, or failed. Outputs save to your specified directory.
STEP 4: Review and verify
Check the output directory for completed files: Not perfect? Adjust prompts in your manifest and re-run. The CLI skips already-generated files and only processes new or failed jobs.
- Verify all expected files were created
- Check for failed jobs in the CLI output log
- Inspect a sample of outputs to confirm quality meets your standards
Tips for best results
💡 Start with low concurrency and scale up
Begin with --max-jobs 3 to test your manifest structure and verify outputs. Once you confirm everything works, increase to --max-jobs 10 or higher. Too much concurrency can hit API rate limits or exhaust your credit balance faster than expected.
💡 Use JSON output for piping to other tools
Add --json to get structured output you can pipe to jq, curl, or CI scripts. Example: gen-ai batch --manifest prompts.json --json | jq -r '.results[].url' extracts just the file URLs. Perfect for posting results to Slack, uploading to S3, or triggering downstream automation.
💡 Resume failed jobs without re-generating
If a batch job fails midway, re-run the same command. The CLI checks your output directory and skips files that already exist. Only failed or pending jobs get processed. This saves time and credits when handling large batches.
💡 Organize manifests by project or campaign
Keep separate manifest files for different projects: product-catalog.json, social-campaign.json, blog-images.json. This makes it easier to re-run specific batches, track credit usage per project, and version-control your generation workflows.
Manifest structure reference
Frequently asked questions

Ready to automate?
Install the CLI and start running batch jobs to process hundreds of generations in parallel.
Get started