
Gemini Imagegen
Generate and edit marketing, UI, and product visuals with Gemini Nano Banana Pro when you need fast assets without opening a separate design tool chain.
Overview
Gemini Imagegen is an agent skill most often used in Build (also Validate and Launch) that generates and edits images via the Gemini API from text prompts and references.
Install
npx skills add https://github.com/everyinc/compound-engineering-plugin --skill gemini-imagegenWhat is this skill?
- Default model gemini-3-pro-image-preview at 1K–4K with 11 aspect ratios
- Text-to-image, image editing, multi-turn refinement, and multi-reference composition
- Style transfer, logos with text, stickers, and product mockup workflows
- Google genai Client pattern with GEMINI_API_KEY environment variable
- Explicit when-to-use triggers for any Gemini API image generation or manipulation
- 3 resolution tiers: 1K, 2K, 4K
- 11 listed aspect ratios
Adoption & trust: 624 installs on skills.sh; 20.5k GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need on-brand images and edits inside your dev workflow but keep pasting screenshots into chat without reproducible API settings.
Who is it for?
Indie builders with a GEMINI_API_KEY who want the agent to own text-to-image, edits, and mockups from the repo.
Skip if: Teams that cannot use cloud image APIs or need print CMYK pipelines without Gemini-supported export settings.
When should I use this skill?
Creating or editing images with the Gemini API—text prompts, edits, style transfer, logos with text, stickers, mockups, or multi-reference composition.
What do I get? / Deliverables
You get consistent Gemini Pro image calls—with model, resolution, and aspect defaults—plus edit and refinement flows for shippable creatives.
- Generated or edited image assets per prompt and aspect settings
- Repeatable Python generate_content snippets for the repo
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Most asset creation happens during Build, but the same skill supports validate prototypes and launch-ready creatives without retooling. Frontend is the canonical shelf because outputs land as UI imagery, logos, stickers, and mockups wired into pages and app stores.
Where it fits
Generate concept UI shots and hero placeholders before committing to a design system.
Produce 1K or 4K assets with fixed aspect ratios for Next or mobile shells.
Render 9:16 and 16:9 campaign stills for social and landing promos.
Iterate sticker or thumbnail variants with multi-turn refinement prompts.
How it compares
An API-backed generator skill for Gemini stills, not a local SD checkpoint or a Figma MCP layout tool.
Common Questions / FAQ
Who is gemini-imagegen for?
Solo builders and small teams shipping UIs, landing pages, or store assets who want Gemini image generation scripted by their coding agent.
When should I use gemini-imagegen?
In Validate for prototype visuals, in Build for UI and mockups, and in Launch for distribution creatives whenever SKILL.md triggers match—text-to-image, editing, style transfer, or multi-reference composition.
Is gemini-imagegen safe to install?
Review the Security Audits panel on this page; the skill requires a GEMINI_API_KEY and sends prompts and images to Google's API.
SKILL.md
READMESKILL.md - Gemini Imagegen
# Gemini Image Generation (Nano Banana Pro) Generate and edit images using Google's Gemini API. The environment variable `GEMINI_API_KEY` must be set. ## Default Model | Model | Resolution | Best For | |-------|------------|----------| | `gemini-3-pro-image-preview` | 1K-4K | All image generation (default) | **Note:** Always use this Pro model. Only use a different model if explicitly requested. ## Quick Reference ### Default Settings - **Model:** `gemini-3-pro-image-preview` - **Resolution:** 1K (default, options: 1K, 2K, 4K) - **Aspect Ratio:** 1:1 (default) ### Available Aspect Ratios `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` ### Available Resolutions `1K` (default), `2K`, `4K` ## Core API Pattern ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["GEMINI_API_KEY"]) # Basic generation (1K, 1:1 - defaults) response = client.models.generate_content( model="gemini-3-pro-image-preview", contents=["Your prompt here"], config=types.GenerateContentConfig( response_modalities=['TEXT', 'IMAGE'], ), ) for part in response.parts: if part.text: print(part.text) elif part.inline_data: image = part.as_image() image.save("output.png") ``` ## Custom Resolution & Aspect Ratio ```python from google.genai import types response = client.models.generate_content( model="gemini-3-pro-image-preview", contents=[prompt], config=types.GenerateContentConfig( response_modalities=['TEXT', 'IMAGE'], image_config=types.ImageConfig( aspect_ratio="16:9", # Wide format image_size="2K" # Higher resolution ), ) ) ``` ### Resolution Examples ```python # 1K (default) - Fast, good for previews image_config=types.ImageConfig(image_size="1K") # 2K - Balanced quality/speed image_config=types.ImageConfig(image_size="2K") # 4K - Maximum quality, slower image_config=types.ImageConfig(image_size="4K") ``` ### Aspect Ratio Examples ```python # Square (default) image_config=types.ImageConfig(aspect_ratio="1:1") # Landscape wide image_config=types.ImageConfig(aspect_ratio="16:9") # Ultra-wide panoramic image_config=types.ImageConfig(aspect_ratio="21:9") # Portrait image_config=types.ImageConfig(aspect_ratio="9:16") # Photo standard image_config=types.ImageConfig(aspect_ratio="4:3") ``` ## Editing Images Pass existing images with text prompts: ```python from PIL import Image img = Image.open("input.png") response = client.models.generate_content( model="gemini-3-pro-image-preview", contents=["Add a sunset to this scene", img], config=types.GenerateContentConfig( response_modalities=['TEXT', 'IMAGE'], ), ) ``` ## Multi-Turn Refinement Use chat for iterative editing: ```python from google.genai import types chat = client.chats.create( model="gemini-3-pro-image-preview", config=types.GenerateContentConfig(response_modalities=['TEXT', 'IMAGE']) ) response = chat.send_message("Create a logo for 'Acme Corp'") # Save first image... response = chat.send_message("Make the text bolder and add a blue gradient") # Save refined image... ``` ## Prompting Best Practices ### Photorealistic Scenes Include camera details: lens type, lighting, angle, mood. > "A photorealistic close-up portrait, 85mm lens, soft golden hour light, shallow depth of field" ### Stylized Art Specify style explicitly: > "A kawaii-style sticker of a happy red panda, bold ou