Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gemini Image Generator

A Claude skill for generating and editing images with Google's gemini-3.1-flash-image-preview model through the Gemini REST API.

Install command

Install

Claude Code

Global install (available in all projects):

curl -sSL https://raw.githubusercontent.com/camronh/gemini-image-generator/main/install.sh | bash

Project install (available only in current project):

curl -sSL https://raw.githubusercontent.com/camronh/gemini-image-generator/main/install.sh | bash -s local

Claude.ai / Claude Cowork

  1. Download this repo as a zip from GitHub (Code -> Download ZIP)
  2. Extract and rename the folder from gemini-image-generator-main to gemini-image-generator
  3. Upload the folder to Claude via Settings -> Capabilities

Setup

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/.env

Get a key from Google AI Studio.

No SDK install is required. The script talks to the Gemini API directly.

Usage

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

Options

  • 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

Image Editing And References

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.

Prompting Tips

Describe the scene, don't just list keywords. A narrative paragraph produces better results than disconnected words.

Examples

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."

Best Practices

  • 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

License

MIT

About

A Claude skill for generating and editing images using Google Gemini AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages