gemini-image

Generate PNG images from natural-language prompts via the Gemini Image Generation API.

3|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/spf13/gemini-image --skill gemini-image-spf13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-image
Source: https://github.com/spf13/gemini-image/tree/main
Command: npx skills add https://github.com/spf13/gemini-image --skill gemini-image-spf13

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google.golang.org/genai, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you quickly create visual assets from text prompts without needing specialized image design tools.

Core Features & Use Cases

  • Prompt-to-image generation: Turn detailed descriptions into generated images with controllable aspect ratios.
  • Model selection: Choose speed, cost, or higher-quality/professional results using different Gemini image models.
  • Disk output + pipeline-friendly path: Writes the generated image to disk as a PNG and returns the saved file path for downstream steps.

Quick Start

Set your GEMINI_API_KEY environment variable, then run the Skill command from the scripts directory using your prompt and desired aspect ratio to generate an image and capture the printed output file path.

Frequently Asked Questions about gemini-image

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

FAQPage Schema
How do I generate images from text prompts in the terminal?

To generate images from text prompts in the terminal, run the Skill command from the scripts directory with your prompt and desired aspect ratio. It calls the Gemini API and saves the PNG output to disk, returning the saved file path.

Do I need an API key to generate PNG images with Gemini?

Yes, you need a GEMINI_API_KEY environment variable set to generate PNG images. The Skill validates prompt and key presence before calling the Gemini Image Generation API with the IMAGE modality.

Can I set a custom aspect ratio for prompt-to-image generation?

Yes, you can set a custom aspect ratio for prompt-to-image generation. The Skill processes your detailed descriptions and natural-language prompts to create generated images with your specified aspect ratio dimensions.

What types of creative assets can I create using prompt-to-image generation?

Prompt-to-image generation applies to creating icons, hero or cover images, diagram-like visuals, concept art, and studio-style product shots. It generates PNG images for creative and product visualization needs.

Does prompt-to-image generation support different models for speed versus quality?

Yes, prompt-to-image generation supports model selection, allowing you to choose speed, cost, or higher-quality professional results using different Gemini image models for your generated PNG assets.

How do I capture the output file path after generating an image?

To capture the output file path after generating an image, check the stdout printed by the Skill. It writes the returned image bytes to your specified output path as a PNG and prints the saved file path.