gemini-imagegen

Generate and edit images from text prompts via the Gemini API.

Updated Jan 3, 2026
One-click install
npx skills add https://github.com/haxudev/frontier-weekly --skill gemini-imagegen-haxudev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-imagegen
Source: https://github.com/haxudev/frontier-weekly/tree/main/.github/skills/gemini-imagegen
Command: npx skills add https://github.com/haxudev/frontier-weekly --skill gemini-imagegen-haxudev

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill automates image creation and refinement by using Gemini's image generation and editing capabilities. It translates text prompts into high-quality visuals and supports iterative refinements with minimal manual intervention.

Core Features & Use Cases

  • Text-to-image generation: Create images from natural language prompts using Gemini models.
  • Image editing & refinement: Modify existing images by describing changes and generating updated results.
  • Multi-image composition: Combine multiple inputs or reference images into a single, cohesive composition guided by instructions.
  • Interactive refinement: Iterate outputs in a chat-like flow to reach the desired result.

Quick Start

Install the dependencies, set GEMINI_API_KEY in your environment, and run examples:

  • Generate an image: python scripts/generate_image.py "A futuristic city at dusk" output.png
  • Edit an image: python scripts/edit_image.py input.png "Add a rainbow in the sky" edited.png
  • Compose images: python scripts/compose_images.py "Create a poster" group.png person1.png --aspect 16:9 --size 2K

Frequently Asked Questions about gemini-imagegen

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

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

Generate images from text prompts using the Gemini API by running a Python script with your descriptive string, outputting the translated visual directly to a PNG file.

Can I edit existing images by describing changes with the Gemini API?

Yes, you can edit existing images by providing the source file and a text prompt describing the desired modifications, which generates an updated output image through the Gemini API.

How do I compose multiple reference images into one cohesive picture?

Compose multiple reference images by passing several input files alongside instructional text prompts, combining them into a single cohesive composition with adjustable aspect ratios and resolutions.

Do I need a specific API key and Python libraries to use Gemini for image generation?

Yes, you need to set the GEMINI_API_KEY environment variable for authentication and install the google-genai and Pillow Python libraries to handle API calls and image processing.

What is the best way to iteratively refine AI art outputs without starting over?

The best way to iteratively refine AI art outputs is using an interactive refinement flow, applying successive text prompt edits to existing images until you reach the desired visual result.

Does this text-to-image workflow support custom aspect ratios and output sizes?

Yes, the text-to-image workflow supports custom aspect ratios and output sizes, allowing you to specify parameters like 16:9 aspect ratio and 2K resolution during image composition.