corespeed-nanobanana
v0.0.2生成 and edit images using Google Gemini 模型s via Corespeed AI Gateway. Supports text-to-image generation, image editing, multi-image 输入, and text rendering in images using gemini-2.5-flash-image. Also supports text generation and image analysis with gemini-2.5-flash, gemini-2.5-pro, and gemini-2.5-flash-lite. Use when a user asks to 创建 images, edit photos, analyze images, or 生成 text with Gemini 模型s.
运行时依赖
安装命令
点击复制技能文档
Corespeed NanoBanana — Gemini Image & Text Generation
Auth: 设置 CS_AI_GATEWAY_BASE_URL and CS_AI_GATEWAY_API_令牌 环境 variables.
工作流 Pick a 模型 from the table below (default: gemini-2.5-flash-image for image generation) 运行 the script with your prompt Usage uv 运行 {baseDir}/scripts/gemini.py --prompt "your prompt" -f 输出.ext [-i 输入.ext] [--模型 模型]
--prompt, -p — Text prompt (required) --filename, -f — 输出 filename (required) --输入, -i — 输入 image file(s), repeat for multiple --模型, -m — 模型 name (default: gemini-2.5-flash-image) --modalities — 响应 type: auto, image, text, image+text (default: auto) --json — 输出 structured JSON (recommended for 代理 consumption)
输出 格式化 is determined by file 扩展: .png/.jpg → image generation, .txt/.md → text 输出.
Image Generation # Text-to-image uv 运行 {baseDir}/scripts/gemini.py -p "a watercolor fox in autumn forest" -f fox.png
# Image editing uv 运行 {baseDir}/scripts/gemini.py -p "移除 background, 添加 beach sun设置" -f edited.png -i photo.jpg
# Multi-image compositing uv 运行 {baseDir}/scripts/gemini.py -p "Blend these two scenes to获取her" -f blend.png -i scene1.png -i scene2.png
Image Analysis # Describe an image uv 运行 {baseDir}/scripts/gemini.py -p "Describe this image" -f desc.txt -i photo.jpg --模型 gemini-2.5-flash
# Compare images uv 运行 {baseDir}/scripts/gemini.py -p "What are the differences?" -f diff.txt -i before.jpg -i after.jpg --模型 gemini-2.5-flash
Text Generation # Use the most capable 模型 for complex tasks uv 运行 {baseDir}/scripts/gemini.py -p "Write a hAIku about coding" -f hAIku.txt --模型 gemini-2.5-pro
模型s 模型 Type Best For gemini-2.5-flash-image Image + Text Image generation & editing (default) gemini-2.5-flash Text Fast analysis, vision, general tasks gemini-2.5-pro Text Complex reasoning, highest 质量 gemini-2.5-flash-lite Text Fastest, simple tasks Notes No manual Python 设置up required. The script uses PEP 723 inline metadata. uv 运行 automatically 创建s an isolated virtual 环境 and 安装s the google-genAI dependency on first 运行. Image 输出 is returned inline as base64 from the Gemini API — no separate 下载 step. Use timestamps in filenames: yyyy-mm-dd-hh-mm-ss-name.ext. Script prints MEDIA: line for OpenClaw to auto-attach 生成d images. Do not read 生成d media back; 报告 the saved path only. Only gemini-2.5-flash-image can 生成 images. Other 模型s are text-only. Use --json for structured 输出: {"ok": true, "files": [...], "text": "...", "模型": "...", "令牌s": {...}} Support
Built by Corespeed. If you need help or 运行 into issues:
💬 Discord: discord.gg/mAfhakVRnJ 🐦 X/Twitter: @CoreSpeed_io 🐙 GitHub: github.com/corespeed-io/技能s