Equip Claude Code with Nano Banana — give Claude the power to generate and edit images.
This is a Claude Code skill that integrates Google Gemini's Nano Banana image models, enabling Claude to generate images from text, edit existing images, iteratively refine images through multi-turn conversation, and output in 2K/4K resolution.
| Feature | Description |
|---|---|
| Text-to-Image | Generate images from text descriptions |
| Image Editing | Modify existing images with natural language instructions |
| Multi-turn Iteration | Refine images through conversation until you're satisfied |
| HD Output | Support 2K / 4K resolution via Pro model |
Go to Google AI Studio to create your API key.
Important: Nano Banana models do NOT support the free tier. You must bind a credit card and upgrade to a paid plan to use the image generation API.
Add your API key to ~/.zshrc or ~/.bashrc:
export GEMINI_API_KEY="your-api-key-here"pip install google-genai PillowClone this repo into Claude Code's skills directory:
git clone https://github.com/haotongl/gemini-image-skill.git ~/.claude/skills/gemini-imageRestart Claude Code and you're good to go.
Once installed, just talk to Claude Code in natural language:
> Draw a cyberpunk cat sitting on the moon
> Change the background of this image to a starry sky (drag in an image or specify a path)
> Make the colors brighter, add a glow effect (multi-turn iteration)
> Generate the final version in 2K HD
| Model | Codename | Use Case |
|---|---|---|
gemini-3.1-flash-image-preview |
Nano Banana 2 | Fast generation/editing, default |
gemini-3-pro-image-preview |
Nano Banana Pro | High quality, 2K/4K output |
If you're behind a proxy, set the environment variables in your shell config (~/.zshrc or ~/.bashrc):
export http_proxy="http://your-proxy:port"
export https_proxy="http://your-proxy:port"MIT