image-gen
하는 일
이 스킬은 작성한 설명을 바탕으로 OpenRouter를 통해 Google의 Nano Banana 이미지 모델로 그림을 만듭니다. AI가 그린 일러스트, 도표, 장면을 원하는 사람을 위한 것입니다.
사용하는 경우
- ✓AI에게 그림, 일러스트, 렌더링을 요청할 때.
- ✓짧은 설명으로 도표나 장면을 생성하고 싶을 때.
- ✓설명과 하나 이상의 입력 그림으로 이미지를 만들고 싶을 때.
스킬 링크
https://github.com/EverMind-AI/Raven/blob/main/demos/skill_retrieval/skills/image-gen/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“나무 아래에서 책을 읽는 친근한 만화 여우를 그려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 설명을 OpenRouter를 통해 이미지 모델에 보내고, 이미지 출력을 요청한 뒤, 돌려받은 그림을 파일로 저장합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
어떤 모델을 사용하나요?
Google의 Gemini 2.5 Flash Image 모델과 최신 Gemini 3.1 Flash Image 프리뷰 모델을 사용합니다.
계정이 필요한가요?
네. 환경에 설정된 OpenRouter API 키가 필요합니다.
내 사진을 사용할 수 있나요?
네. 텍스트 프롬프트와 함께 하나 이상의 입력 이미지를 받을 수 있습니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 6.0k
- 순위
- #14472
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
deck-to-pptx
6.0k에이전트가 python-pptx로 아이콘, 차트, 수식을 갖춘 실제 PowerPoint .pptx 파일을 만들도록 가르칩니다.
ppt-script-authoring
6.0k에이전트가 명확한 이야기를 가진 슬라이드 덱을 설계하고, 자체 레이아웃을 갖춘 python-pptx 프로그램으로 만들도록 가르칩니다.
multi-agent-coding
6.0k에이전트가 코딩 작업을 적합한 코딩 에이전트에 넘기고, 작업마다 새로 시작해 결과를 파일로 전달하도록 돕습니다.
raven-self-config
6.0k에이전트가 Raven 앱의 설정, 예를 들어 에이전트와 채팅 앱 연결을 보고 바꾸도록 하며, 기능이 없는 이유를 설명합니다.