image-gen
Skill này làm gì
Skill này tạo một bức ảnh từ mô tả bằng văn bản của bạn bằng các mô hình tạo ảnh Nano Banana của Google qua OpenRouter. Skill dành cho bất kỳ ai muốn một minh họa, sơ đồ hoặc cảnh do AI vẽ.
Khi nào nên dùng
- ✓Khi bạn yêu cầu AI vẽ, minh họa hoặc render một bức ảnh.
- ✓Khi bạn muốn một sơ đồ hoặc cảnh được tạo từ một mô tả ngắn.
- ✓Khi bạn muốn một ảnh được tạo từ mô tả cộng với một hoặc nhiều ảnh đầu vào.
Liên kết skill
https://github.com/EverMind-AI/Raven/blob/main/demos/skill_retrieval/skills/image-gen/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Vẽ một chú cáo hoạt hình dễ thương đang đọc sách dưới gốc cây.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi mô tả của bạn đến mô hình tạo ảnh qua OpenRouter, yêu cầu đầu ra là ảnh, và lưu bức ảnh trả về vào một file.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Skill dùng mô hình nào?
Skill dùng mô hình Gemini 2.5 Flash Image của Google và bản xem trước Gemini 3.1 Flash Image mới hơn.
Tôi có cần tài khoản không?
Có. Skill cần khóa API của OpenRouter được thiết lập trong môi trường.
Skill có dùng được ảnh của tôi không?
Có. Skill có thể nhận một hoặc nhiều ảnh đầu vào cùng với mô tả bằng văn bản.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 6.0k
- Vị trí xếp hạng
- #14472
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
deck-to-pptx
6.0kDạy agent của bạn tạo một file PowerPoint .pptx thật bằng python-pptx, gồm icon, biểu đồ, công thức và các công cụ của thiết lập này.
ppt-script-authoring
6.0kDạy agent của bạn thiết kế một bộ slide với câu chuyện rõ ràng và xây dựng nó thành một chương trình python-pptx với bố cục riêng.
multi-agent-coding
6.0kGiúp agent của bạn giao công việc code cho một agent code phù hợp, khởi động một agent mới cho mỗi tác vụ và chuyển kết quả giữa các bước qua file.
raven-self-config
6.0kCho phép agent của bạn xem và thay đổi cài đặt của chính ứng dụng Raven, như kết nối agent và ứng dụng chat, và giải thích vì sao một khả năng bị thiếu.
Skill tương tự
gifgrep
394kCho phép agent của bạn tìm thư viện GIF, xem trước kết quả, tải một GIF, và lấy một khung hình tĩnh hoặc bảng ghép nhiều khung hình.
meme-maker
394kCho phép agent của bạn chọn một mẫu meme, thêm chú thích của riêng bạn và tạo meme dưới dạng ảnh SVG hoặc PNG.
ios-icon-gen
280kGiúp agent tạo biểu tượng cho ứng dụng iOS. Dùng biểu tượng của Apple hoặc từ các nguồn khác để tạo đúng định dạng tệp.