---
description: "deGenAi — show banner, pick a model with arrows, enter prompt, generate"
allowed-tools:
  - Bash
  - AskUserQuestion
---

Run an interactive deGenAi generation flow inside the chat.

**Navigation rule:** every AskUserQuestion below MUST include a `← Back` (or `Cancel` at the very top) option as the LAST choice. If user picks Back, return to the previous step. If user picks Cancel at the root, abort with a friendly "ok, cancelled" message and stop.

When asking the user for the prompt (free-text, not AskUserQuestion), tell them they can type `back` to return to the previous picker.

---

**Step 1 — Banner.** Paste this exactly to the user:

```
██████╗ ███████╗ ██████╗ ███████╗███╗   ██╗ █████╗ ██╗
██╔══██╗██╔════╝██╔════╝ ██╔════╝████╗  ██║██╔══██╗██║
██║  ██║█████╗  ██║  ███╗█████╗  ██╔██╗ ██║███████║██║
██║  ██║██╔══╝  ██║   ██║██╔══╝  ██║╚██╗██║██╔══██║██║
██████╔╝███████╗╚██████╔╝███████╗██║ ╚████║██║  ██║██║
╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝

     AI Image & Video on Base · pay per call (USDC)
```

---

**Step 2 — Category** (header "Type"):
1. "Image" — "Generate an AI image"
2. "Video" — "Generate an AI video (Veo 3 or Grok)"
3. "Tools" — "Upscale, remove background, magic eraser"
4. "Cancel" — "Exit without generating"

If `Cancel` → reply "Ok, cancelled." and stop.

---

**Step 2a — Image picker** (header "Image model") — when user picked Image:
1. "Nano Banana Flow — $0.005 (RECOMMENDED)" — "Cheapest. nano-banana, 1K, 16:9 / 9:16 / 4:3 / 3:4."
2. "GPT Image 2 — $0.015" — "OpenAI ChatGPT image flow. Strong on typography."
3. "More image models" — "Nano Banana $0.05, Nano Pro $0.15, Seedream $0.10."
4. "← Back" — "Back to category"

If `← Back` → re-run Step 2.

If `More image models` → ask "Premium image":
1. "Nano Banana — $0.05" — "Standard tier, all aspect ratios, up to 2K."
2. "Nano Pro — $0.15" — "Top quality with thinking, up to 4K."
3. "Seedream — $0.10" — "Creative-leaning, use only when explicitly needed."
4. "← Back" — "Back to image picker"

If `← Back` → re-run Step 2a.

---

**Step 2b — Video picker** (header "Video model") — when user picked Video:
1. "Veo 3 — $0.10" — "Google Veo, text-to-video / image-to-video, 16:9 or 9:16."
2. "Grok — $0.10" — "xAI Grok, 480p/720p, up to 5 reference images, 5 ratios."
3. "← Back" — "Back to category"

If `← Back` → re-run Step 2.

---

**Step 2c — Tools picker** (header "Tool") — when user picked Tools:
1. "Upscale" — "2x ($0.05) or 4x ($0.10), pick on next step."
2. "Remove BG — $0.02" — "Remove background from an image."
3. "Magic Eraser — $0.02" — "Erase objects from an image using a white mask."
4. "← Back" — "Back to category"

If `← Back` → re-run Step 2.

If `Upscale` → ask "Scale":
1. "2x — $0.05"
2. "4x — $0.10"
3. "← Back" — "Back to tools"

If `← Back` → re-run Step 2c.

---

**Step 3 — Get the prompt or input file.**

For **image / video** models: ask the user
"What do you want to generate? (describe in your own words — or type `back` to re-pick the model)" — wait for their text reply. This is the prompt — the сидка. If they type `back`, return to the relevant picker step.

For **upscale / remove-bg / magic-eraser**: ask for a file path to the input image (and a mask path for magic-eraser). Same `back` rule applies.

---

**Step 4 — Per-model extra params.**

For **Veo 3**: AskUserQuestion "Aspect ratio":
1. "16:9 — landscape"
2. "9:16 — portrait"
3. "← Back" — "Back to prompt"

For **Grok**: ask "Aspect ratio":
1. "16:9"
2. "9:16"
3. "1:1 / 3:2 / 2:3" — "Square or other ratios — pick next"
4. "← Back"

If `1:1 / 3:2 / 2:3`, ask sub-question with those three + `← Back`.

Then "Resolution":
1. "480p — default, faster"
2. "720p — HD"
3. "← Back"

For **image models**: skip extra params unless the model needs them (e.g. ask aspectRatio for non-Flow models).

---

**Step 5 — Run the CLI.** Map the choice to the right command:

- Flow image → `degenai generate -p "<prompt>" -o output.png`
- Nano Banana → `degenai generate -m nano-banana -p "<prompt>" --no-flow -o output.png`
- Nano Pro → `degenai generate -m pro -p "<prompt>" --no-flow -o output.png`
- Seedream → `degenai generate -m seedream -p "<prompt>" -o output.png`
- GPT Image 2 → `degenai generate -m gpt-image-2 -p "<prompt>" -o output.png`
- Veo 3 → `degenai video-veo3 -p "<prompt>" -a <ratio> -o video.mp4`
- Grok → `degenai video-grok -p "<prompt>" -a <ratio> -r <resolution> -o video.mp4`
- Upscale → `degenai upscale -i <input> -s <2|4> -o upscaled.png`
- Remove BG → `degenai remove-bg -i <input> -o nobg.png`
- Magic Eraser → `degenai magic-eraser -i <input> -k <mask> -o erased.png`

Always escape quotes in the prompt safely.

---

**Step 6 — Result.** Tell the user the saved file path and the price they paid. For videos, mention generation took a few minutes.

Important: never invent a prompt for the user — always ask them. The whole point is that the user supplies the сидка.
