gemini-imagegen

gemini-imagegen is a skill for Claude Code, Codex from dp-archive/archive. It costs 114 tokens per session (1,378 once invoked), scanned A, original, Apache-2.0.

An image-generation and editing skill built around Google Gemini’s image models, including Nano Banana and Nano Banana Pro. It supports creating images from text and editing or combining reference images.

In plain words
What is it for?
Use it for text-to-image generation, photo or image edits, multi-image compositions, and images that need consistent characters or rendered text.
Why use it?
It lets developers use Gemini to create or modify images from code, while choosing between faster drafts and higher-resolution generation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

Skill Compose is an open-source platform for building and running AI agents that use modular skills. It is intended for creating skill-powered agents without workflow graphs or a command-line interface, and the catalogue skills are examples of those agent capabilities.

dp-archive/archive · 1,106 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dp-archive/archive/gemini-imagegen
Any agent
npx skills add dp-archive/archive --skill gemini-imagegen
Clone the repo
git clone --depth 1 https://github.com/dp-archive/archive

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gemini-imagegen

README.md
[![agentmods](https://agentmods.dev/badge/skills/dp-archive/archive/gemini-imagegen.svg)](https://agentmods.dev/skills/dp-archive/archive/gemini-imagegen)
Your own site
<a href="https://agentmods.dev/skills/dp-archive/archive/gemini-imagegen"><img src="https://agentmods.dev/badge/skills/dp-archive/archive/gemini-imagegen.svg" alt="Measured on agentmods" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,378 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00114 $0.01378
Opus 5 $0.00057 $0.00689
Sonnet 5 $0.00023 $0.00276
Haiku 4.5 $0.00011 $0.00138

Measured 7d ago against content hash dcd623eb3763, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

gemini-imagegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

seed_skills/gemini-imagegen/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gemini Image Generation

Generate and edit images via Google Gemini's native multimodal image generation.

Model Selection

Model ID Codename Best for Max resolution
gemini-2.5-flash-image Nano Banana Fast drafts, high-volume, low-latency 1K
gemini-3-pro-image-preview Nano Banana Pro Studio-quality, text rendering, complex prompts 4K

Default: gemini-3-pro-image-preview (Pro) unless speed/cost is a concern.

Setup

# Install (once)
# pip install google-genai

from google import genai
import os, base64

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

If GEMINI_API_KEY is missing, instruct the user to set it as an environment variable. Never ask the user to paste the key in chat.

Text-to-Image

from google import genai
from google.genai import types
import os

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

response = client.models.generate_content(
    model="gemini-3-pro-image-preview",
    contents="A photorealistic cat on a rainbow sofa",
    config=types.GenerateContentConfig(
        response_modalities=["TEXT", "IMAGE"],
    ),
)

# Extract and save
for part in response.candidates[0].content.parts:
    if part.inline_data is not None:
        with open("output.png", "wb") as f:
            f.write(part.inline_data.data)
        break

Aspect Ratio

Set via image_config:

config=types.GenerateContentConfig(
    response_modalities=["TEXT", "IMAGE"],
    image_config=types.ImageConfig(
        aspect_ratio="16:9",  # for slides / widescreen
    ),
)

Supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

Common choices:

  • Slides / presentations → 16:9
  • Social media / portraits → 9:16 or 4:5
  • Square thumbnails → 1:1

Image Editing (with reference image)

from google.genai import types
from pathlib import Path
import base64

ref_bytes = Path("input.jpg").read_bytes()

response = client.models.generate_content(
    model="gemini-3-pro-image-preview",
    contents=[
        types.Part(inline_data=types.Blob(mime_type="image/jpeg", data=base64.b64encode(ref_bytes).decode())),
        types.Part(text="Remove the background and replace with a sunset gradient"),
    ],
    config=types.GenerateContentConfig(
        response_modalities=["TEXT", "IMAGE"],
    ),
)

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 172 lines · 114 tokens per session scan A dcd623eb3763

Subscribe to this mod's changes

gemini-imagegen is a skill published in the GitHub repository dp-archive/archive (1,106 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 114 tokens to every session and 1,378 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

chengfeng-check-updates

剪辑环境的唯一管理者:就绪检查(skills 是否最新 → Runtime 是否配套)、Skills 更新激活、Runtime 安装与体检。用户说检查更新、安装剪辑环境、装播放器、检查剪辑环境、剪辑环境就绪了吗、配置转录凭证时使用;业务 Skill(剪口播/字幕/画面/导出)第 0 步也引用本 Skill 的就绪检查。不用于剪辑、字幕、画面、导出本身或项目数据迁移。.

Agentchengfeng/chengfeng-videocut-skills · 120 tokens