gemini-image-generation

Generate and edit image files from text prompts and input images.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill removes the manual effort of creating or editing image files by generating results directly from text prompts and optional source images.

Core Features & Use Cases

  • Text-to-image creation: produce one or more image files from a descriptive prompt.
  • Image editing / transformation: restyle, modify, extend, or transform one or more existing images using a prompt plus input image(s).
  • Configurable output: supports passing aspectRatio and imageSize to control generation output quality and format, and saves results to workspace paths.
  • Workflow-friendly results: prints both file paths and MEDIA:<image_path> so images render inline after the skill completes.

Quick Start

Use this skill to create an image by asking your AI to run gemini-image-generation with a prompt and an output path, e.g. "Generate a cinematic wide food photo of a nano banana dish and save it to outputs/banana-wide.png."

Frequently Asked Questions about gemini-image-generation

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

FAQPage Schema
How do I generate images from text prompts using Gemini?

To generate images from text prompts using Gemini, you run the provided generate-image.mjs script with your descriptive text and an output path. The skill processes your prompt and saves the resulting image file directly to your workspace.

Can I edit and transform an existing image file with a text prompt?

Yes, you can edit and transform existing image files with a text prompt by running the edit-image.mjs script. You provide the source image and a prompt describing the modifications, and the skill applies the transformation and saves the output.

Do I need an API key to use Gemini for image generation?

Yes, you need a valid GEMINI_API_KEY and GEMINI_MODEL_ID configured in your SKILL environment to use Gemini for image generation. You can also optionally set a GEMINI_BASE_URL for custom endpoints.

How can I control the aspect ratio and size of generated image outputs?

You can control the aspect ratio and size of generated image outputs by passing the aspectRatio and imageSize parameters in your request. This allows you to configure the generation output quality and format to meet your specific requirements.

What is the best way to automate text-to-image creation and save files to a workspace path?

The best way to automate text-to-image creation and save files to a workspace path is by executing the generate-image.mjs script. It processes your prompt, saves the image to the specified path, and prints a MEDIA tag for inline rendering.

Are there limitations when generating multiple images from a single prompt?

When generating multiple images from a single prompt, results must be saved to designated workspace paths. The skill handles multi-image generation, but outputs depend on the configured Gemini model and the complexity of your prompt instructions.