Edit images using direct tool commands or natural-language prompts. All results are saved to your workspace.
Background removal
CLI
# Direct tool
pixa run remove-bg product.png --json
# Via prompt
pixa run prompt "remove the background" \
--attachment product.png --json
The output is a transparent PNG with the subject cleanly isolated.
MCP
Use edit_image with action: "remove_background":
Remove the background from this product photo.
Supports batch processing — pass an array of images to process them in parallel.
Upscale
Increase image resolution with AI upscaling:
CLI
# 2x upscale (default)
pixa run upscale photo.png --json
# 4x upscale
pixa run upscale photo.png --scale 4 --json
MCP
Use edit_image with action: "upscale" and optional scale parameter ("2" or "4").
Expand / outpaint
Extend an image beyond its original borders with AI-generated content:
CLI
# Expand by pixel count
pixa run expand product.png --right 200 --bottom 100 --json
MCP
Use edit_image with action: "expand". You can specify pixel amounts per direction (left, right, top, bottom) or use aspect_ratio (e.g., "16:9") to auto-calculate the padding:
Expand this square image to 16:9 for a website banner.
Prompt-based editing
Use the prompt mode for natural-language editing instructions:
# Change background
pixa run prompt "place on a clean white studio background with soft shadows" \
--attachment product.png --json
# Multiple steps
pixa run prompt "remove the background, then upscale 4x" \
--attachment product.png --json
Chaining operations
Run multiple editing steps in sequence by using the output of one command as input to the next:
# Step 1: Remove background
pixa run remove-bg product.png --json
# Parse the asset ID from the JSON output
# Step 2: Upscale the result
pixa run upscale ast_result123 --scale 4 --json
When chaining operations in an agent workflow, parse the asset ID from each step’s JSON output and pass it to the next command. Both CLI commands and MCP tools accept asset IDs as input.
For repeatable multi-step workflows, consider creating a pipeline instead.
Batch editing (MCP)
The MCP edit_image tool accepts an array of images for batch processing:
Upscale all the images in my 'Product Shots' collection to 4x.
The agent calls assets to list the collection contents, then edit_image with an array of asset IDs.
| Operation | CLI command | MCP action |
|---|
| Background removal | pixa run remove-bg <image> | edit_image action: remove_background |
| Upscale (2x/4x) | pixa run upscale <image> --scale 4 | edit_image action: upscale |
| Expand/outpaint | pixa run expand <image> --right 200 | edit_image action: expand |