Generate and edit images using Gemini's image generation model via the `nanobanana` CLI. Use this skill whenever the user asks to create, generate, edit, or modify images, illustrations, icons, logos, thumbnails, posters, or any visual content.
Generate and edit images via nanobanana CLI, which calls the Gemini API.
nanobanana command in PATHGEMINI_API_KEY environment variable setnanobanana "prompt" [flags]
| Flag | Values | Default | Description |
|---|---|---|---|
--resolution | 1K, 2K, 4K | 2K | Output resolution |
--aspect | 16:9, 1:1, 9:16, , etc. |
4:316:9 |
| Aspect ratio |
--output | directory path | ./generated_images | Output directory |
--reference | image file path | — | Reference image (repeatable, max 14) |
--model | model name | gemini-3-pro-image-preview | Gemini model |
Output files are saved with timestamp filenames (e.g. 20251130_153045.png). Extension is determined by the API response MIME type.
Write prompts in English as natural sentences, not keyword lists. Include: subject, composition, action, location, style, and lighting as relevant.
Example:
"cool car, neon, city, night, 8k""A cinematic wide shot of a futuristic sports car speeding through rainy Tokyo streets at night, neon reflections on wet asphalt"Use --reference to pass existing images for editing, style transfer, or character consistency.
nanobanana "Change the background to a sunset beach" --reference ./photo.png
nanobanana "Redraw in watercolor style" --reference ./original.jpg
For character consistency, explicitly instruct identity preservation in the prompt (e.g. "keep the exact facial features from the reference image").
--aspect and --resolution for the use case--reference if editing or using existing images