---
name: image-nano
description: Generate images via CLIProxy (Gemini). Preflight auth, batch generation, ID consistency. Use ai-artist for prompts if available, else use bundled references.
version: 1.0.2
---

# image-nano

Generate images via CLIProxy using Gemini models.

## Prerequisites

- CLIProxy running on `http://127.0.0.1:8317`
- Authenticated via http://localhost:3000

## Workflow (Decision Tree)

```
1. Run preflight check:
   python scripts/gen_image.py --check

2. Build prompt:
   IF ai-artist skill available:
      → Use: python ai-artist/scripts/search.py "<concept>"
      → Adapt matched prompt to user's needs
   ELSE:
      → Read: references/gemini-nano-banana.md
      → Apply narrative style + emphasis techniques

3. Generate image:
   python scripts/gen_image.py --prompt "<enhanced_prompt>" --output ./output

4. For ID consistency (same person/character):
   python scripts/gen_image.py --prompt "<prompt>" --ref <anchor.jpg> --output ./output
```

## Commands

| Command | Description |
|:---|:---|
| `--check` | Preflight auth check |
| `--prompt "text"` | Single image generation |
| `--prompts file.txt` | Batch generation (one prompt per line) |
| `--ref img.jpg` | Reference image(s) for ID consistency |
| `--output ./dir` | Output directory (default: `./output`) |
| `--concurrent N` | Max parallel requests (default: 4) |

## Output Structure

```
./output/{YYYYMMDD}/
├── gen_001_timestamp.jpg
└── metadata.json
```

## References (Load as needed)

| Reference | When to use |
|:---|:---|
| [Nano Banana Pro](references/gemini-nano-banana.md) | Gemini-specific techniques, models, parameters |
| [Advanced Prompting](references/advanced-prompting.md) | When ai-artist unavailable |
| [Prompting Templates](references/prompting-templates.md) | Domain-specific templates |
| [CLIProxy API](references/cliproxy_api.md) | API troubleshooting |

## Configuration

`.env` in skill directory:
```bash
CLIPROXY_BASE=http://127.0.0.1:8317/v1
CLIPROXY_TOKEN=ccs-internal-managed
IMAGE_MODEL=gemini-3-pro-image-preview
```
