Gemini Image Generator
Use this skill to turn a user prompt (and optional images) into Gemini image generation calls via the bundled Python scripts.
Workflow
- Collect the user prompt and any images (local paths or URLs).
- Infer the operation mode and translate parameters into CLI flags.
- Run the appropriate script to generate or edit images.
- Return the output file paths.
Defaults and Rules
- Default model:
gemini-2.5-flash-image (CLI value flash).
- Default aspect ratio:
9:16.
- Default count:
1 (max 3).
- Default image size:
1K, but only apply it for the Pro model.
- If the user specifies a size (
1K|2K|4K), switch to Pro (gemini-3-pro-image-preview).
- If the user explicitly asks for Pro or higher quality, use Pro.
- If the user supplies multiple reference images (2+), switch to Pro.
- Logo overlay always uses Pro (even if the user asks for Flash).
- Only set
--size when using Pro.
Allowed Values
- Aspect ratios:
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.
- Image sizes (Pro only):
1K, 2K, 4K.
- Reference images (Pro): up to 14 total. Gemini guidance: up to 6 object images + up to 5 human images.
Script
Scripts
Text-to-image
Run:
python scripts/generate_image.py \
--prompt "<user prompt>" \
--aspect 9:16 \
--count 1 \
--model flash \
--out-dir outputs
Only add flags when the user asks for them. The script reads GEMINI_API_KEY from the environment.
Image editing / image-to-image
Use when the user supplies a base image to edit or transform.
Run:
python scripts/edit_image.py \
--input /path/to/base.png \
--prompt "<edit instructions>" \
--reference /path/to/ref1.png \
--reference https://example.com/ref2.png \
--aspect 9:16 \
--count 1 \
--model flash \
--out-dir outputs
Logo overlay
Use when the user wants to place a logo onto a base image.
Run:
python scripts/logo_overlay.py \
--base /path/to/base.png \
--logo /path/to/logo.png \
--aspect 9:16 \
--count 1 \
--model pro \
--out-dir outputs
Examples
User: "Generate a portrait of a dancer in a foggy forest."
Claude:
- Use defaults (flash, 9:16, count 1).
- Run:
python scripts/generate_image.py --prompt "Generate a portrait of a dancer in a foggy forest."
User: "Make a 2K 16:9 cinematic still of a neon city, give me 3 options."
Claude:
- Use Pro with size 2K, aspect 16:9, count 3.
- Run:
python scripts/generate_image.py --prompt "Make a 2K 16:9 cinematic still of a neon city" --aspect 16:9 --size 2K --count 3 --model pro
User: "Edit this image to remove the background and make it studio white." (with one image)
Claude:
- Use edit script with Flash.
- Run:
python scripts/edit_image.py --input /path/to/image.png --prompt "Remove the background and make it studio white."
User: "Put this logo on the shirt in the photo." (with base + logo images)
Claude:
- Use logo overlay script (Pro).
- Run:
python scripts/logo_overlay.py --base /path/to/photo.png --logo /path/to/logo.png
Notes
- If the script fails with a missing module, install
google-genai and retry.
- Dependencies live in
scripts/requirements.txt (install with pip install -r scripts/requirements.txt).
- Output files are written into the
outputs/ directory using timestamped names.
- For prompt best practices and templates, read
references/prompt-guide.md.
- For logo-specific guidance, read
references/logo-overlay.md.
- For edit/image-to-image guidance, read
references/image-editing.md.
- For watermarking guidance, read
references/watermarking.md.
1---2name: gemini-image-generator-43description: Generate, edit, or transform images with Gemini Nano Banana using bundled Python scripts (Flash or Pro) including aspect ratio, resolution, image-to-image edits, logo overlays, and reference images. Use when users request image generation, image edits, image-to-image transformations, logo placement, or specific aspect ratios or resolutions.4---5
6# Gemini Image Generator
7
8Use this skill to turn a user prompt (and optional images) into Gemini image generation calls via the bundled Python scripts.
9
10## Workflow
11
121. Collect the user prompt and any images (local paths or URLs).
132. Infer the operation mode and translate parameters into CLI flags.
143. Run the appropriate script to generate or edit images.
154. Return the output file paths.
16
17## Defaults and Rules
18
19- Default model: `gemini-2.5-flash-image` (CLI value `flash`).
20- Default aspect ratio: `9:16`.
21- Default count: `1` (max `3`).
22- Default image size: `1K`, but only apply it for the Pro model.
23- If the user specifies a size (`1K|2K|4K`), switch to Pro (`gemini-3-pro-image-preview`).
24- If the user explicitly asks for Pro or higher quality, use Pro.
25- If the user supplies multiple reference images (2+), switch to Pro.
26- Logo overlay always uses Pro (even if the user asks for Flash).
27- Only set `--size` when using Pro.
28
29## Allowed Values
30
31- Aspect ratios: `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`.
32- Image sizes (Pro only): `1K`, `2K`, `4K`.
33- Reference images (Pro): up to 14 total. Gemini guidance: up to 6 object images + up to 5 human images.
34
35## Script
36
37## Scripts
38
39### Text-to-image
40
41Run:
42
43```bash
44python scripts/generate_image.py \
45 --prompt "<user prompt>" \
46 --aspect 9:16 \
47 --count 1 \
48 --model flash \
49 --out-dir outputs
50```
51
52Only add flags when the user asks for them. The script reads `GEMINI_API_KEY` from the environment.
53
54### Image editing / image-to-image
55
56Use when the user supplies a base image to edit or transform.
57
58Run:
59
60```bash
61python scripts/edit_image.py \
62 --input /path/to/base.png \
63 --prompt "<edit instructions>" \
64 --reference /path/to/ref1.png \
65 --reference https://example.com/ref2.png \
66 --aspect 9:16 \
67 --count 1 \
68 --model flash \
69 --out-dir outputs
70```
71
72### Logo overlay
73
74Use when the user wants to place a logo onto a base image.
75
76Run:
77
78```bash
79python scripts/logo_overlay.py \
80 --base /path/to/base.png \
81 --logo /path/to/logo.png \
82 --aspect 9:16 \
83 --count 1 \
84 --model pro \
85 --out-dir outputs
86```
87
88## Examples
89
90User: "Generate a portrait of a dancer in a foggy forest."
91Claude:
92- Use defaults (flash, 9:16, count 1).
93- Run:
94 `python scripts/generate_image.py --prompt "Generate a portrait of a dancer in a foggy forest."`
95
96User: "Make a 2K 16:9 cinematic still of a neon city, give me 3 options."
97Claude:
98- Use Pro with size 2K, aspect 16:9, count 3.
99- Run:
100 `python scripts/generate_image.py --prompt "Make a 2K 16:9 cinematic still of a neon city" --aspect 16:9 --size 2K --count 3 --model pro`
101
102User: "Edit this image to remove the background and make it studio white." (with one image)
103Claude:
104- Use edit script with Flash.
105- Run:
106 `python scripts/edit_image.py --input /path/to/image.png --prompt "Remove the background and make it studio white."`
107
108User: "Put this logo on the shirt in the photo." (with base + logo images)
109Claude:
110- Use logo overlay script (Pro).
111- Run:
112 `python scripts/logo_overlay.py --base /path/to/photo.png --logo /path/to/logo.png`
113
114## Notes
115
116- If the script fails with a missing module, install `google-genai` and retry.
117- Dependencies live in `scripts/requirements.txt` (install with `pip install -r scripts/requirements.txt`).
118- Output files are written into the `outputs/` directory using timestamped names.
119- For prompt best practices and templates, read `references/prompt-guide.md`.
120- For logo-specific guidance, read `references/logo-overlay.md`.
121- For edit/image-to-image guidance, read `references/image-editing.md`.
122- For watermarking guidance, read `references/watermarking.md`.