A Claude skill for generating and editing images with Google's gemini-3.1-flash-image-preview model through the Gemini REST API.
Global install (available in all projects):
curl -sSL https://raw.githubusercontent.com/camronh/gemini-image-generator/main/install.sh | bashProject install (available only in current project):
curl -sSL https://raw.githubusercontent.com/camronh/gemini-image-generator/main/install.sh | bash -s local- Download this repo as a zip from GitHub (Code -> Download ZIP)
- Extract and rename the folder from
gemini-image-generator-maintogemini-image-generator - Upload the folder to Claude via Settings -> Capabilities
Add your Google API key:
# For global install:
echo 'GOOGLE_API_KEY=your-key-here' > ~/.claude/skills/gemini-image-generator/.env
# For project install:
echo 'GOOGLE_API_KEY=your-key-here' > ./.claude/skills/gemini-image-generator/.envGet a key from Google AI Studio.
No SDK install is required. The script talks to the Gemini API directly.
Ask Claude to generate an image:
"Generate an image of a robot writing a blog post"
You can also run the script directly:
node generate-image.js "A glossy magazine cover for Nano Banana 2" -n cover.png -a 3:2- Filename: "save it as robot.png"
- Aspect ratio: "make it 16:9"
- Output dir: "save it to ./images/"
- Reference images: "edit this image" or "use this as a style reference"
Supported aspect ratios:
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
Edit existing images or use reference images for style transfer:
"Add a party hat to ./cat.png"
"Generate a portrait in the style of ./reference.jpg"
"Create a group photo of the people in person1.jpg and person2.jpg at a beach"
The current Gemini image docs allow up to 14 reference images with gemini-3.1-flash-image-preview.
Describe the scene, don't just list keywords. A narrative paragraph produces better results than disconnected words.
Photorealistic:
"A photorealistic close-up portrait of an elderly Japanese ceramicist with deep wrinkles and a warm smile, inspecting a freshly glazed tea bowl. Rustic workshop setting, golden hour light through window. 85mm portrait lens, soft bokeh."
Stylized:
"A kawaii-style sticker of a happy red panda wearing a tiny bamboo hat, munching on a bamboo leaf. Bold outlines, simple cel-shading, vibrant colors. White background."
Text/Logo:
"A modern, minimalist logo for a coffee shop called 'The Daily Grind'. Clean, bold sans-serif font. Black and white. Coffee bean integrated cleverly."
Commercial/Product:
"A studio-lit matte black ceramic mug on polished concrete, softbox lighting, slight 45-degree angle, realistic steam, premium product-photography look."
- Be specific: Instead of "fantasy armor", describe "ornate elven plate armor, etched with silver leaf patterns, pauldrons shaped like falcon wings"
- Iterate: "Make the lighting warmer" or "change the expression to more serious"
- Control the camera: Use terms like "wide-angle shot", "macro shot", "low-angle perspective"
- Be explicit with text: Gemini image models are strong at text rendering, so spell out exact wording and layout intent
MIT
