gemini-image-generator

Generate and edit images from text prompts using Google's Gemini API.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/surfingalien/FinSurfing --skill gemini-image-generator-surfingalien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-image-generator
Source: https://github.com/surfingalien/FinSurfing/tree/main/.claude/skills/gemini-image-generator
Command: npx skills add https://github.com/surfingalien/FinSurfing --skill gemini-image-generator-surfingalien

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, and includes scripts (resource) components.

What problem does it solve? Creating visual assets like app icons, banners, game sprites, and marketing graphics normally requires design tools or stock imagery. This Skill generates images directly from text prompts via the Gemini API, and also supports editing existing images and using reference images for style guidance. ## Core Features & Use Cases - Text-to-Image Generation: Create images from prompts with control over aspect ratio (1:1 to 21:9) and resolution up to 4K. - Image Editing & Style Reference: Modify existing images with text instructions or supply up to 14 reference images to guide style and content. - Use Case: You need a 16:9 hero banner for a landing page. Run the script with a descriptive prompt and aspect ratio flag, and it saves a ready-to-use PNG generated by the Gemini 3 Pro image model. ## Quick Start Set your GEMINI_API_KEY environment variable, then ask the assistant to generate an image from your prompt using the gemini-image-generator skill, optionally specifying an aspect ratio and output filename.

Frequently Asked Questions about gemini-image-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with the Gemini API in Python?

Install the google-genai package, set your GEMINI_API_KEY environment variable, and run the generate_image.py script with a -p prompt argument. The script calls the generate_content endpoint with response_modalities set to Image and saves the result as a PNG.

How do I edit an existing image with Gemini?

Pass the input image with the -i flag along with a text prompt describing the change, such as replacing a background or adjusting color grading. The script sends both the image bytes and prompt to the model and saves the edited output.

What aspect ratios and resolutions does Gemini image generation support?

Supported aspect ratios are 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9. Resolution options of 1K, 2K, and 4K are available only on the gemini-3-pro-image-preview model; the 2.5 flash model outputs up to 1024px.

Why does Gemini image generation return no image?

The model sometimes responds with text only instead of an image. Make the prompt more specific, add phrasing like "generate an image of", or try a different aspect ratio. Content policy violations can also block image output.

How many reference images can I use for style guidance?

You can supply up to 14 reference images using repeated -r flags. The script validates this limit and each file's existence before sending them to the API alongside your prompt.