image-gen
What it does
This skill creates a picture from your written description using Google's Nano Banana image models through OpenRouter. It is for anyone who wants an illustration, diagram or scene drawn by AI.
When to use it
- ✓When you ask your AI to draw, illustrate or render a picture.
- ✓When you want a diagram or scene generated from a short description.
- ✓When you want an image made from a description plus one or more input pictures.
Skill link
https://github.com/EverMind-AI/Raven/blob/main/demos/skill_retrieval/skills/image-gen/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Draw a friendly cartoon fox reading a book under a tree.”
5 new skills a week. 1 minute to read.
How it works
The agent sends your description to the image model through OpenRouter, asks for image output, and saves the returned picture to a file.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
image-gen — Nano Banana via OpenRouter
Generates one or more images from a text prompt (and optionally one or more input images) by calling Google's Nano Banana family on OpenRouter:
google/gemini-2.5-flash-image— original (Nano Banana)google/gemini-3.1-flash-image-preview— latest (Nano Banana 2)
OpenRouter speaks the OpenAI-compatible chat-completions API for these models, with two extras:
- The request must include
"modalities": ["image", "text"]so the server knows to return image bytes, not just a description. - The response carries images in a top-level
message.imagesarray (NOT incontent— that field still holds optional commentary text).
Quick recipe
import os, base64, json, urllib.request
KEY = os.environ["OPENROUTER_API_KEY"]
MODEL = "google/gemini-2.5-flash-image" # or 3.1 for "Nano Banana 2"
def generate_image(prompt: str, out_path: str = "out.png") -> str:
req = urllib.request.Request(
"https://openrouter.ai/api/v1/chat/completions",
data=json.dumps({
"model": MODEL,
"messages": [{"role": "user", "content": prompt}],
"modalities": ["image", "text"],
}).encode(),
headers={
"Authorization": f"Bearer {KEY}",
"Content-Type": "application/json",
},
method="POST",
)
with urllib.request.urlopen(req, timeout=120) as resp:
data = json.loads(resp.read())
msg = data["choices"][0]["message"]
# ``message.images[i].image_url.url`` is a data URI:
# "data:image/png;base64,<base64-bytes>"
url = msg["images"][0]["image_url"]["url"]
b64 = url.split(",", 1)[1]
with open(out_path, "wb") as f:
f.write(base64.b64decode(b64))
text_note = msg.get("content") or ""
return f"Wrote {out_path} ({len(b64)//1024} KB). Model said: {text_note[:200]!r}"
Request shape (full)
{
"model": "google/gemini-2.5-flash-image",
"messages": [
{"role": "user", "content": "A red circle on white background"}
],
"modalities": ["image", "text"]
}
For image input + image output (edit / vary / extend), use the standard
multipart content form OpenAI clients accept. The image part can be either
a remote URL or a base64 data URI:
{
"role": "user",
"content": [
{"type": "text", "text": "Make this watercolor style"},
{"type": "image_url",
"image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
]
}
Response shape
{
"choices": [{
"message": {
"role": "assistant",
"content": "optional text commentary",
"images": [
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,<bytes>"
}
}
]
}
}],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 1295,
"total_tokens": 1303,
"cost": 0.0383,
"completion_tokens_details": {"image_tokens": 1290}
}
}
Cost (observed)
~$0.04 per 1024×1024 PNG at the time of writing (1290 image tokens × $0.00003/tok via the v2.5 flash-image model). Burst test: 10 images ≈ $0.40. Budget gates accordingly when looping in agent code.
When to use this skill
Trigger keywords / patterns you should recognize:
- "generate / create / make / draw / render / illustrate (an image / a picture / a logo / ...)"
- "show me what X looks like"
- "design a banner / poster / icon for ..."
- "make it watercolor / cyberpunk / pencil sketch / pixel art" (edit existing)
- "vary this image" / "more like this but with ..."
Don't use this skill for:
- Charts / plots from data → prefer a Python plotting skill (matplotlib / plotly) rather than a generative image. Charts need accurate numbers; Nano Banana will hallucinate axes.
- Diagrams with precise structure (UML, DAGs) → use mermaid / graphviz instead.
Troubleshooting
- Empty
imagesarray: you forgot"modalities": ["image", "text"]. OpenRouter falls back to text-only without it. - HTTP 403 with "not available in your region": OpenRouter blocks
Anthropic + some Google models from China-mainland IPs. Set
HTTPS_PROXYto a proxy that exits via a non-blocked region. - Response includes
refusal: prompt was content-filtered. Rewrite the prompt; don't retry the same string. - PNG opens to blank / corrupt: you wrote the data URI verbatim
FAQ
Which models does it use?
It uses Google's Gemini 2.5 Flash Image model and the newer Gemini 3.1 Flash Image preview.
Does it need an account?
Yes. It needs an OpenRouter API key set up in the environment.
Can it use my own pictures?
Yes. It can take one or more input images along with the text prompt.
Details
Original description by the author
Generate images via Nano Banana (Gemini 2.5/3.1 Flash Image) on OpenRouter. Use when the user asks to draw, illustrate, render or generate any kind of picture/diagram/scene.
repo: EverMind-AI/Raven
Popularity
- GitHub stars
- 6.0k
- Ranking position
- #14472
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
deck-to-pptx
6.0kTeaches your agent to build a real PowerPoint .pptx file with python-pptx, including icons, charts, formulas and the tools this setup has.
ppt-script-authoring
6.0kTeaches your agent to design a slide deck with a clear story and build it as a python-pptx program with its own layout.
multi-agent-coding
6.0kHelps your agent hand coding work to a suitable coding agent, starting a fresh agent for each task and passing results between steps through files.
raven-self-config
6.0kLets your agent view and change the Raven app's own settings, such as connecting agents and chat apps, and explains why an ability is missing.
Similar skills
gifgrep
394kLets your agent search GIF libraries, preview results, download a GIF, and pull out a still frame or a contact sheet of frames.
meme-maker
394kLets your agent pick a meme template, add your own captions, and create the meme as an SVG or PNG image.
ios-icon-gen
280kLets your agent generate icons for iOS apps. It uses Apple symbols or icons from other sources to create the correct files.