Image generation with gen-ai (CLI & MCP)
This skill covers every image generation task you can accomplish via the Picsart gen-ai CLI or the @picsart/gen-ai-mcp MCP server. Both call the same backend — pick whichever is closer to where you're working.
When to use
Activate whenever the user asks to:
- Generate / render / create / make / illustrate an image
- Produce a hero, OG image, poster, icon, avatar, background, thumbnail, social tile, ad creative, lifestyle shot, or packshot
- Pick between Flux, Recraft, Nano Banana, Imagen, Seedream, Ideogram, or Hunyuan
- Resize / reframe / upscale / replace or remove a background
- Batch-process a directory of images
- Swap a product's background, recolor a product, composite a product into a scene
- Generate brand-consistent variants from a reference image
CLI vs MCP — both work
- Use the CLI when it's installed (
gen-ai --version works) and you're scripting in a terminal, CI, or piping JSON.
- Use the MCP server (
@picsart/gen-ai-mcp) when the user is in Claude Code, Codex, Cursor, Windsurf, or ChatGPT and the CLI isn't installed — the MCP exposes the same capabilities as native tool calls. Ask in plain English; the agent calls gen-ai_generate directly.
Throughout this skill, each recipe shows the CLI form. When invoked via MCP, the agent translates the same arguments into a gen-ai_generate tool call — identical behavior.
Model selection cheat sheet
Prefer family aliases over exact version pins whenever possible — recraft-v4 always resolves to the latest stable within the family, so your scripts stay forward-compatible as new models ship. Run gen-ai models to see what's current.
| Model / alias |
Strength |
Typical cost |
When to pick |
recraft-v4 |
Design-forward, posters, editorial, on-brand art |
~2c |
Default for marketing visuals, OG images, editorial |
recraft-v4-vector |
Clean SVG output |
2c |
Logos, app icons, onboarding illustrations |
recraft-v4-pro |
Higher-fidelity Recraft |
4c |
Premium hero art, print |
flux-2-pro |
Photoreal, strong prompt adherence |
1c |
Default for photoreal — product, lifestyle, portrait |
flux-2-max |
Flagship photoreal |
2c |
Hero art where realism must not break |
nano-banana (gemini-2.5-flash-image) |
Fast, cheap |
1c |
Thumbnails, previews, throwaway variants |
nano-banana-pro (gemini-3-pro-image) |
Stronger composition |
2c |
Polished Gemini renders |
imagen-4.0 |
Google photoreal |
2c |
Alt to Flux when Flux refuses a prompt |
seedream-5.0-lite / seedream-4.5 |
Stylized, creative |
1-2c |
Illustrative, brand-forward art |
ideogram-v3 |
Text-in-image, posters, signage |
1c |
Anything that must contain readable text |
ideogram-character |
Consistent subject across renders |
1c |
Headshots, mockups, POD, mascots |
hunyuan-v3 |
Tencent model, varied styles |
1c |
Asian-market styles |
qwen-image-edit-plus |
Edit in place, text/motif swaps |
1c |
Recolor, localize, seasonal refresh |
recraft-replace-bg |
Background replace only |
2c |
Catalog styling, lifestyle compose |
topaz-upscale-image |
4K upscale |
varies |
Print, press, post-gen polish |
Future-proofing: if the user names a model directly, honor it. Otherwise pick by intent. New models land in the Picsart registry continuously — use gen-ai models (or the MCP tool gen-ai_list_models) to see what's available right now.
Quick decision tree
Photoreal product / lifestyle? → flux-2-pro (flux-2-max if premium)
Editorial / poster / brand art? → recraft-v4 (recraft-v4-pro if premium)
Must contain readable text? → ideogram-v3
Logo or scalable icon? → recraft-v4-vector
Keep a face / subject consistent? → ideogram-character (pass -i ref.png)
Swap background only? → recraft-replace-bg (pass -i product.png)
Recolor / localize existing image? → qwen-edit-plus (pass -i source.png)
Fast throwaway / preview? → nano-banana
Need 4K or print-ready? → topaz-upscale-image post-gen
Unsure? → gen-ai models compare flux-2-pro recraft-v4, then run candidate prompts
Prompting best practices
The five-slot recipe
Every good image prompt covers subject, composition, lighting, style, and technical constraints. Missing any one produces generic output.
- Subject. Be specific — not "mug" but "ceramic mug, matte finish, handle on right."
- Composition. Framing and angle — "centered, shallow depth of field, 3/4 angle, 50mm."
- Lighting. "Editorial side-light with soft shadow," "neon magenta rim-light," "golden-hour natural light."
- Style. Declare it. "Editorial magazine photography," "flat vector illustration," "photoreal product photography," "dark cinematic."
- Technical. Aspect, materials, surface, palette. "Walnut table surface, deep navy background #0A1628."
Family-specific tricks
| Family |
What it responds to |
Avoid |
| Flux |
Photographic terms — "50mm, f/1.8, soft key-light, neutral grade" |
Heavy stylized adjectives |
| Recraft |
Style words — "editorial, magazine, minimalist, high contrast" |
Camera settings (ignored) |
| Nano Banana |
Short, concrete, 1-2 sentences |
Long paragraph prompts |
| Imagen |
Scene-focused, natural language |
Style-word stacks |
| Ideogram |
Spell every on-image word in escaped quotes: "headline reads: \"Generate anything\"" |
Vague text direction |
| Seedream |
Stylized adjectives — "dreamy, surreal, cinematic" |
Strict photoreal prompts |
| Qwen Edit Plus |
Declare what to change; preserve what to keep |
Re-describing the whole scene |
Brand colors & dark-mode assets
- Brand colors: include hex codes explicitly.
"background #121212, magenta #FF47FF and cyan #00FFED gradient accents".
- Dark mode: don't rely on the model to read CSS tokens. Say
"dark background #121212, high contrast, neon accents".
- Negative prompts:
--negative-prompt "text, watermark, extra limbs, logo, signature" — works on Flux, Recraft, Imagen.
Aspect ratios by use case
| Use |
--ar |
| OG image, Twitter card, LinkedIn share |
1200x630 |
| LinkedIn card |
1200x627 |
| IG post, Shopify PDP square |
1:1 |
| IG story, reel thumbnail, TikTok |
9:16 |
| LP hero (16:9), YouTube thumbnail |
16:9 |
| Shopify PDP hero, Etsy listing |
4:5 |
| Print poster |
2:3 |
| App icon |
1:1 (output as SVG via recraft-v4-vector) |
Common recipes
Single hero, 16:9, photoreal
gen-ai generate -m flux-2-pro \
-p "editorial hero — ceramic espresso cup on walnut counter, morning light, shallow depth of field, brand palette magenta #FF47FF and cyan #00FFED rim-light" \
--ar 16:9 --json --no-input | jq -r '.url' | xargs curl -L -o hero.webp
Ask in chat (MCP):
"Render a 16:9 editorial hero of a ceramic espresso cup on a walnut counter with morning light. Use Flux 2 Pro. Save as hero.webp."
OG image with readable title text
gen-ai generate -m ideogram-v3 \
-p "editorial poster, the headline reads: \"Generate anything from your terminal.\", dark background, magenta and cyan type, center-aligned" \
--ar 1200x630 --json --no-input | jq -r '.url' | xargs curl -L -o og.webp
Six brand-consistent variants from a reference
gen-ai generate -m recraft-v4 -i hero.webp --count 6 --ar 1:1
Pass -i <reference> whenever brand consistency matters — it locks palette, composition, and mood across the whole variant set, much better than re-describing.
Consistent face across multiple renders
gen-ai generate -m ideogram-character -i selfie.png \
-p "linkedin headshot, id photo, editorial portrait, casual outdoor" \
--count 4 --ar 1:1
Batch — replace background across a product catalog
gen-ai generate --input-dir ./catalog/raw -m recraft-replace-bg \
-p "soft studio gradient, warm natural light" \
--batch --download ./catalog-styled
Color / material variants from one packshot
gen-ai generate -m qwen-edit-plus -i hero.png \
-p "red, navy, olive, cream" --count 4
Localize a hero across markets
cat > localize.json <<EOF
{
"jobs": [
{
"id": "de",
"model": "qwen-image-edit-plus",
"imageUrls": ["hero.png"],
"prompt": "Localize for Germany with a Bavarian Alps motif"
},
{
"id": "ja",
"model": "qwen-image-edit-plus",
"imageUrls": ["hero.png"],
"prompt": "Localize for Japan with a Kyoto bamboo motif"
},
{
"id": "br",
"model": "qwen-image-edit-plus",
"imageUrls": ["hero.png"],
"prompt": "Localize for Brazil with a Rio coastline motif"
}
]
}
EOF
gen-ai batch run localize.json -o ./localized
Agent-friendly JSON mode — URL out for piping
# Return one URL
gen-ai generate -m recraft-v4 -p "$PROMPT" --json --no-input | jq -r '.url'
# Cost per call
gen-ai pricing recraft-v4
# Pipe stdin
echo "$PROMPT" \
| gen-ai generate -m recraft-v4 --json --no-input \
| jq -r '.url' | xargs curl -L -o inline.webp
Inline upscale after generation
gen-ai generate -m flux-2-pro -p "$HERO" --ar 16:9 --json --no-input \
| jq -r '.url' | xargs curl -L -o hero.webp
gen-ai upscale -m topaz-upscale-image -i hero.webp --scale 4 --json --no-input \
| jq -r '.url' | xargs curl -L -o hero-4k.webp
Compare model schemas before committing
gen-ai models compare flux-2-pro recraft-v4
gen-ai models compare flux-2-pro imagen-4.0
MCP / natural-language patterns
When the CLI isn't installed, the MCP server gives the agent the same capabilities via native tool calls. Good prompts to pass to Claude Code / Codex / Cursor / Windsurf / ChatGPT:
- "Render a 16:9 editorial hero for the blog at ./draft.md using Flux. Save as hero.webp."
- "Generate 6 on-brand product tiles (1:1) from hero.webp with Recraft V4 — save to ./assets."
- "Replace the background on product.png with a warm marble studio scene. Keep the product pixel-accurate."
- "Make 4 color variants of hero.png in red, navy, olive, cream — keep lighting identical."
- "Read clipboard and render one inline visual that matches the paragraph."
- "Compare flux-2-pro, recraft-v4, and imagen-4.0 on this prompt; save all three and tell me which feels most on-brand."
The agent should:
- Call
gen-ai_pricing first on any batch > 10 images and multiply by job count to confirm spend.
- Call
gen-ai_whoami once per session before the first generation.
- Prefer
recraft-v4 default unless the user specifies photoreal (then flux-2-pro).
- Pass the user's reference image via
-i whenever one exists locally — don't re-describe it.
- If the user names a file but it doesn't exist, ask for clarification rather than inventing a path.
Cost control
Before any batch > 10 images, check pricing and validate the manifest:
gen-ai pricing flux-2-pro
gen-ai batch run manifest.json --dry-run
Auto-proceed cost bands (rule of thumb):
- Under $1 — just run.
- $1–$5 — run; note estimated cost in chat.
- $5–$20 — show estimate, ask for confirmation.
- Over $20 — show estimate, break into smaller batches, ask.
Draft → final pattern: generate all drafts with nano-banana (1c), only re-render approved ones with the flagship family. Cuts cost 5–10× with no quality loss on the final.
Output hygiene
- Resolution floor: 1024×1024 for social; 1920×1080 for hero; 1200×630 for OG; 4K for print.
- Format:
.webp for web (smaller, lossy and lossless both work)
.png when alpha transparency is required
.svg for vector models (recraft-v4-vector)
- Verify with a second model if output looks off — providers have off-days.
gen-ai models compare <a> <b> compares capabilities; run candidate generations explicitly for visual comparison.
Brand governance
Commit a brand.md to the repo describing palette, typography, voice, icon style, and forbidden patterns. The CLI does not have a policy gate flag, so include those constraints in the prompt:
PROMPT="$(cat brand.md)
$PROMPT"
gen-ai generate -m flux-2-pro -p "$PROMPT" --json --no-input
Review results before shipping brand-sensitive work.
Troubleshooting
| Symptom |
Fix |
| Blurry output |
Raise resolution (--ar 1920x1080 or --scale 2); switch to *-pro / *-max variant |
| Text is gibberish |
Switch to ideogram-v3; put on-image words in escaped quotes |
| Wrong palette |
Include hex codes explicitly; pass brand reference via -i |
| Subject drifts across variants |
Switch to ideogram-character or recraft-v4 with -i reference |
| Too expensive |
Drop to nano-banana for drafts; re-render only finals with the flagship |
| Model rejects prompt |
Check model capabilities with gen-ai models info <id> or try another model family |
| Unexpected watermark |
Some free-tier models add them; switch to flux-2-pro or recraft-v4 |
| Text in image should be localized |
Pass --locale <xx> or add the translated text verbatim in the prompt |
For agents
- Always confirm auth with
gen-ai whoami (or the gen-ai_whoami MCP tool) before the first generation in a session.
- Always check pricing before batches > 10 images.
- Default to Recraft V4 unless the user says photoreal.
- Prefer reference images (
-i) whenever brand / subject consistency matters — beats re-describing.
- Never hardcode a specific model version when a family alias exists (
recraft-v4 beats recraft-v4.0.7).
- Emit JSON via
--json --no-input when piping into another tool — never scrape logs.
- Respect
brand.md if one exists in the repo — include relevant constraints directly in prompts.
- If the CLI isn't installed and MCP is available, call the MCP tool directly — don't tell the user to install the CLI unless they ask.
1---2name: gen-ai-images3description: Generate images via the Picsart gen-ai CLI or MCP server. AUTO-TRIGGER whenever the user asks to generate, create, render, make, illustrate, or design an image, hero, product shot, OG image, poster, icon set, avatar, background, thumbnail, illustration, wallpaper, ad creative, social tile, lifestyle shot, or packshot; wants to pick between Flux / Recraft / Nano Banana / Imagen / Seedream / Ideogram / Hunyuan; wants to resize, reframe, upscale, remove background, replace background, or batch-process images.4---56# Image generation with gen-ai (CLI & MCP)78This skill covers **every image generation task** you can accomplish via the Picsart gen-ai CLI or the `@picsart/gen-ai-mcp` MCP server. Both call the same backend — pick whichever is closer to where you're working.910## When to use1112Activate whenever the user asks to:1314- Generate / render / create / make / illustrate an image15- Produce a hero, OG image, poster, icon, avatar, background, thumbnail, social tile, ad creative, lifestyle shot, or packshot16- Pick between Flux, Recraft, Nano Banana, Imagen, Seedream, Ideogram, or Hunyuan17- Resize / reframe / upscale / replace or remove a background18- Batch-process a directory of images19- Swap a product's background, recolor a product, composite a product into a scene20- Generate brand-consistent variants from a reference image2122## CLI vs MCP — both work2324- **Use the CLI** when it's installed (`gen-ai --version` works) and you're scripting in a terminal, CI, or piping JSON.25- **Use the MCP server** (`@picsart/gen-ai-mcp`) when the user is in Claude Code, Codex, Cursor, Windsurf, or ChatGPT and the CLI isn't installed — the MCP exposes the same capabilities as native tool calls. Ask in plain English; the agent calls `gen-ai_generate` directly.2627Throughout this skill, each recipe shows the CLI form. When invoked via MCP, the agent translates the same arguments into a `gen-ai_generate` tool call — identical behavior.2829## Model selection cheat sheet3031Prefer family aliases over exact version pins whenever possible — `recraft-v4` always resolves to the latest stable within the family, so your scripts stay forward-compatible as new models ship. Run `gen-ai models` to see what's current.3233| Model / alias | Strength | Typical cost | When to pick |34|---|---|---|---|35| `recraft-v4` | Design-forward, posters, editorial, on-brand art | ~2c | **Default for marketing visuals**, OG images, editorial |36| `recraft-v4-vector` | Clean SVG output | 2c | Logos, app icons, onboarding illustrations |37| `recraft-v4-pro` | Higher-fidelity Recraft | 4c | Premium hero art, print |38| `flux-2-pro` | Photoreal, strong prompt adherence | 1c | **Default for photoreal** — product, lifestyle, portrait |39| `flux-2-max` | Flagship photoreal | 2c | Hero art where realism must not break |40| `nano-banana` (gemini-2.5-flash-image) | Fast, cheap | 1c | Thumbnails, previews, throwaway variants |41| `nano-banana-pro` (gemini-3-pro-image) | Stronger composition | 2c | Polished Gemini renders |42| `imagen-4.0` | Google photoreal | 2c | Alt to Flux when Flux refuses a prompt |43| `seedream-5.0-lite` / `seedream-4.5` | Stylized, creative | 1-2c | Illustrative, brand-forward art |44| `ideogram-v3` | Text-in-image, posters, signage | 1c | Anything that must contain readable text |45| `ideogram-character` | Consistent subject across renders | 1c | Headshots, mockups, POD, mascots |46| `hunyuan-v3` | Tencent model, varied styles | 1c | Asian-market styles |47| `qwen-image-edit-plus` | Edit in place, text/motif swaps | 1c | Recolor, localize, seasonal refresh |48| `recraft-replace-bg` | Background replace only | 2c | Catalog styling, lifestyle compose |49| `topaz-upscale-image` | 4K upscale | varies | Print, press, post-gen polish |5051**Future-proofing:** if the user names a model directly, honor it. Otherwise pick by intent. New models land in the Picsart registry continuously — use `gen-ai models` (or the MCP tool `gen-ai_list_models`) to see what's available right now.5253## Quick decision tree5455```56Photoreal product / lifestyle? → flux-2-pro (flux-2-max if premium)57Editorial / poster / brand art? → recraft-v4 (recraft-v4-pro if premium)58Must contain readable text? → ideogram-v359Logo or scalable icon? → recraft-v4-vector60Keep a face / subject consistent? → ideogram-character (pass -i ref.png)61Swap background only? → recraft-replace-bg (pass -i product.png)62Recolor / localize existing image? → qwen-edit-plus (pass -i source.png)63Fast throwaway / preview? → nano-banana64Need 4K or print-ready? → topaz-upscale-image post-gen65Unsure? → gen-ai models compare flux-2-pro recraft-v4, then run candidate prompts66```6768## Prompting best practices6970### The five-slot recipe7172Every good image prompt covers **subject, composition, lighting, style, and technical constraints**. Missing any one produces generic output.73741. **Subject.** Be specific — not "mug" but "ceramic mug, matte finish, handle on right."752. **Composition.** Framing and angle — "centered, shallow depth of field, 3/4 angle, 50mm."763. **Lighting.** "Editorial side-light with soft shadow," "neon magenta rim-light," "golden-hour natural light."774. **Style.** Declare it. "Editorial magazine photography," "flat vector illustration," "photoreal product photography," "dark cinematic."785. **Technical.** Aspect, materials, surface, palette. "Walnut table surface, deep navy background #0A1628."7980### Family-specific tricks8182| Family | What it responds to | Avoid |83|---|---|---|84| Flux | Photographic terms — "50mm, f/1.8, soft key-light, neutral grade" | Heavy stylized adjectives |85| Recraft | Style words — "editorial, magazine, minimalist, high contrast" | Camera settings (ignored) |86| Nano Banana | Short, concrete, 1-2 sentences | Long paragraph prompts |87| Imagen | Scene-focused, natural language | Style-word stacks |88| Ideogram | Spell every on-image word in escaped quotes: `"headline reads: \"Generate anything\""` | Vague text direction |89| Seedream | Stylized adjectives — "dreamy, surreal, cinematic" | Strict photoreal prompts |90| Qwen Edit Plus | Declare what to change; preserve what to keep | Re-describing the whole scene |9192### Brand colors & dark-mode assets9394- **Brand colors**: include hex codes explicitly. `"background #121212, magenta #FF47FF and cyan #00FFED gradient accents"`.95- **Dark mode**: don't rely on the model to read CSS tokens. Say `"dark background #121212, high contrast, neon accents"`.96- **Negative prompts**: `--negative-prompt "text, watermark, extra limbs, logo, signature"` — works on Flux, Recraft, Imagen.9798### Aspect ratios by use case99100| Use | `--ar` |101|---|---|102| OG image, Twitter card, LinkedIn share | `1200x630` |103| LinkedIn card | `1200x627` |104| IG post, Shopify PDP square | `1:1` |105| IG story, reel thumbnail, TikTok | `9:16` |106| LP hero (16:9), YouTube thumbnail | `16:9` |107| Shopify PDP hero, Etsy listing | `4:5` |108| Print poster | `2:3` |109| App icon | `1:1` (output as SVG via `recraft-v4-vector`) |110111## Common recipes112113### Single hero, 16:9, photoreal114115```bash116gen-ai generate -m flux-2-pro \117 -p "editorial hero — ceramic espresso cup on walnut counter, morning light, shallow depth of field, brand palette magenta #FF47FF and cyan #00FFED rim-light" \118 --ar 16:9 --json --no-input | jq -r '.url' | xargs curl -L -o hero.webp119```120121**Ask in chat (MCP):**122> "Render a 16:9 editorial hero of a ceramic espresso cup on a walnut counter with morning light. Use Flux 2 Pro. Save as hero.webp."123124### OG image with readable title text125126```bash127gen-ai generate -m ideogram-v3 \128 -p "editorial poster, the headline reads: \"Generate anything from your terminal.\", dark background, magenta and cyan type, center-aligned" \129 --ar 1200x630 --json --no-input | jq -r '.url' | xargs curl -L -o og.webp130```131132### Six brand-consistent variants from a reference133134```bash135gen-ai generate -m recraft-v4 -i hero.webp --count 6 --ar 1:1136```137138Pass `-i <reference>` whenever brand consistency matters — it locks palette, composition, and mood across the whole variant set, much better than re-describing.139140### Consistent face across multiple renders141142```bash143gen-ai generate -m ideogram-character -i selfie.png \144 -p "linkedin headshot, id photo, editorial portrait, casual outdoor" \145 --count 4 --ar 1:1146```147148### Batch — replace background across a product catalog149150```bash151gen-ai generate --input-dir ./catalog/raw -m recraft-replace-bg \152 -p "soft studio gradient, warm natural light" \153 --batch --download ./catalog-styled154```155156### Color / material variants from one packshot157158```bash159gen-ai generate -m qwen-edit-plus -i hero.png \160 -p "red, navy, olive, cream" --count 4161```162163### Localize a hero across markets164165```bash166cat > localize.json <<EOF167{168 "jobs": [169 {170 "id": "de",171 "model": "qwen-image-edit-plus",172 "imageUrls": ["hero.png"],173 "prompt": "Localize for Germany with a Bavarian Alps motif"174 },175 {176 "id": "ja",177 "model": "qwen-image-edit-plus",178 "imageUrls": ["hero.png"],179 "prompt": "Localize for Japan with a Kyoto bamboo motif"180 },181 {182 "id": "br",183 "model": "qwen-image-edit-plus",184 "imageUrls": ["hero.png"],185 "prompt": "Localize for Brazil with a Rio coastline motif"186 }187 ]188}189EOF190gen-ai batch run localize.json -o ./localized191```192193### Agent-friendly JSON mode — URL out for piping194195```bash196# Return one URL197gen-ai generate -m recraft-v4 -p "$PROMPT" --json --no-input | jq -r '.url'198199# Cost per call200gen-ai pricing recraft-v4201202# Pipe stdin203echo "$PROMPT" \204 | gen-ai generate -m recraft-v4 --json --no-input \205 | jq -r '.url' | xargs curl -L -o inline.webp206```207208### Inline upscale after generation209210```bash211gen-ai generate -m flux-2-pro -p "$HERO" --ar 16:9 --json --no-input \212 | jq -r '.url' | xargs curl -L -o hero.webp213gen-ai upscale -m topaz-upscale-image -i hero.webp --scale 4 --json --no-input \214 | jq -r '.url' | xargs curl -L -o hero-4k.webp215```216217### Compare model schemas before committing218219```bash220gen-ai models compare flux-2-pro recraft-v4221gen-ai models compare flux-2-pro imagen-4.0222```223224## MCP / natural-language patterns225226When the CLI isn't installed, the MCP server gives the agent the same capabilities via native tool calls. Good prompts to pass to Claude Code / Codex / Cursor / Windsurf / ChatGPT:227228- *"Render a 16:9 editorial hero for the blog at ./draft.md using Flux. Save as hero.webp."*229- *"Generate 6 on-brand product tiles (1:1) from hero.webp with Recraft V4 — save to ./assets."*230- *"Replace the background on product.png with a warm marble studio scene. Keep the product pixel-accurate."*231- *"Make 4 color variants of hero.png in red, navy, olive, cream — keep lighting identical."*232- *"Read clipboard and render one inline visual that matches the paragraph."*233- *"Compare flux-2-pro, recraft-v4, and imagen-4.0 on this prompt; save all three and tell me which feels most on-brand."*234235The agent should:2362371. Call `gen-ai_pricing` first on any batch > 10 images and multiply by job count to confirm spend.2382. Call `gen-ai_whoami` once per session before the first generation.2393. Prefer `recraft-v4` default unless the user specifies photoreal (then `flux-2-pro`).2404. Pass the user's reference image via `-i` whenever one exists locally — don't re-describe it.2415. If the user names a file but it doesn't exist, ask for clarification rather than inventing a path.242243## Cost control244245Before any batch > 10 images, check pricing and validate the manifest:246247```bash248gen-ai pricing flux-2-pro249gen-ai batch run manifest.json --dry-run250```251252**Auto-proceed cost bands** (rule of thumb):253254- Under $1 — just run.255- $1–$5 — run; note estimated cost in chat.256- $5–$20 — show estimate, ask for confirmation.257- Over $20 — show estimate, break into smaller batches, ask.258259**Draft → final pattern**: generate all drafts with `nano-banana` (1c), only re-render approved ones with the flagship family. Cuts cost 5–10× with no quality loss on the final.260261## Output hygiene262263- **Resolution floor**: 1024×1024 for social; 1920×1080 for hero; 1200×630 for OG; 4K for print.264- **Format**:265 - `.webp` for web (smaller, lossy and lossless both work)266 - `.png` when alpha transparency is required267 - `.svg` for vector models (`recraft-v4-vector`)268- **Verify with a second model** if output looks off — providers have off-days. `gen-ai models compare <a> <b>` compares capabilities; run candidate generations explicitly for visual comparison.269270## Brand governance271272Commit a `brand.md` to the repo describing palette, typography, voice, icon style, and forbidden patterns. The CLI does not have a policy gate flag, so include those constraints in the prompt:273274```bash275PROMPT="$(cat brand.md)276277$PROMPT"278gen-ai generate -m flux-2-pro -p "$PROMPT" --json --no-input279```280281Review results before shipping brand-sensitive work.282283## Troubleshooting284285| Symptom | Fix |286|---|---|287| Blurry output | Raise resolution (`--ar 1920x1080` or `--scale 2`); switch to `*-pro` / `*-max` variant |288| Text is gibberish | Switch to `ideogram-v3`; put on-image words in escaped quotes |289| Wrong palette | Include hex codes explicitly; pass brand reference via `-i` |290| Subject drifts across variants | Switch to `ideogram-character` or `recraft-v4` with `-i reference` |291| Too expensive | Drop to `nano-banana` for drafts; re-render only finals with the flagship |292| Model rejects prompt | Check model capabilities with `gen-ai models info <id>` or try another model family |293| Unexpected watermark | Some free-tier models add them; switch to `flux-2-pro` or `recraft-v4` |294| Text in image should be localized | Pass `--locale <xx>` or add the translated text verbatim in the prompt |295296## For agents297298- **Always confirm auth** with `gen-ai whoami` (or the `gen-ai_whoami` MCP tool) before the first generation in a session.299- **Always check pricing** before batches > 10 images.300- **Default to Recraft V4** unless the user says photoreal.301- **Prefer reference images** (`-i`) whenever brand / subject consistency matters — beats re-describing.302- **Never hardcode a specific model version** when a family alias exists (`recraft-v4` beats `recraft-v4.0.7`).303- **Emit JSON via `--json --no-input`** when piping into another tool — never scrape logs.304- **Respect `brand.md`** if one exists in the repo — include relevant constraints directly in prompts.305- **If the CLI isn't installed and MCP is available**, call the MCP tool directly — don't tell the user to install the CLI unless they ask.