Generate product photos, marketing visuals, and design concepts by describing what you want. Attach reference images for more control. All results are saved to your Pixa workspace.
Text-to-image
CLI
Create images from a text description:
pixa run model "a product photo of sneakers on a marble surface" \
--model nano-banana-2 \
--aspect-ratio 1:1 --json
Or use the prompt mode for the agent to pick the best model:
pixa run prompt "a product photo of sneakers on a marble surface" \
--aspect-ratio 1:1 --json
MCP
Use the generate_media tool with a prompt and model ID. Call models (action: list) first to find available model IDs:
Generate a studio product photo of a water bottle on a marble countertop.
The agent calls models to find a model, then generate_media with the chosen model ID and prompt.
Reference-based generation
Attach a product photo and describe the scene you want around it:
pixa run prompt "lifestyle scene of this product on a kitchen counter, morning light" \
--attachment product.png \
--model nano-banana-2 --json
The model uses your attachment as a visual reference while composing the new scene.
In MCP, pass image URLs or asset IDs in the attachments parameter of generate_media.
Generation settings
CLI flags
| Flag | Description | Example |
|---|
--model | Model ID for generation | nano-banana-2 |
--aspect-ratio | Output aspect ratio | 1:1, 16:9, 4:3, 9:16 |
--output-format | File format | png, jpg, webp |
--num-variations | Number of variations to produce | 1-4 |
--brand-library | Brand library ID for brand-consistent output | lib_abc123 |
MCP parameters
The generate_media tool accepts: prompt, model (required), aspect_ratio, media_type, output_format, num_variations, and attachments.
Browsing models
CLI
# List all models
pixa models list --json
# Search by capability
pixa models search "product photo" --json
# Get model details
pixa models get nano-banana-2 --json
MCP
The models tool supports list, search, get, and recommend actions. Use recommend with a natural language description of your use case to get ranked suggestions.
Batch generation
Generate multiple variations in a single call:
pixa run model "product lifestyle photo of this watch" \
--attachment watch.png \
--model nano-banana-2 \
--num-variations 4 \
--aspect-ratio 1:1 --json
To generate across different aspect ratios, run separate commands:
# Square for Instagram
pixa run model "lifestyle product shot" \
--attachment product.png --model nano-banana-2 --aspect-ratio 1:1 --json
# Landscape for web banner
pixa run model "lifestyle product shot" \
--attachment product.png --model nano-banana-2 --aspect-ratio 16:9 --json
# Portrait for stories
pixa run model "lifestyle product shot" \
--attachment product.png --model nano-banana-2 --aspect-ratio 9:16 --json
Prompt engineering tips
Write prompts as if briefing a photographer: subject first, then environment, lighting, and mood.
| Technique | Example |
|---|
| Be specific about the subject | ”white ceramic mug” instead of “a mug” |
| Describe the environment | ”on a rustic wooden table, blurred garden background” |
| Specify lighting | ”soft natural light from the left, gentle shadows” |
| Set the mood or style | ”minimal, editorial, high-end product photography” |
| Mention camera details | ”shot at eye level, shallow depth of field” |
When using --brand-library, the model pulls brand colors, fonts, and style references automatically. You can combine this with a descriptive prompt for brand-consistent output.