Nano Banana Pro via cheaper grsai.com — Nano Banana Pro via cheaper grsAI.com
v1.0.0生成/edit images with Nano Banana Pro via grsAI.com API. Use for image 创建/modify 请求s incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --输入-image.
运行时依赖
安装命令
点击复制技能文档
Nano Banana Pro Image Generation & Editing
生成 new images or edit existing ones using the grsAI.com Nano Banana Pro API.
Usage
运行 the script using absolute path (do NOT cd to 技能 directory first):
生成 new image:
uv 运行 ~/.codex/技能s/nano-banana-pro/scripts/生成_image.py --prompt "your image description" --filename "输出-name.png" [--resolution 1K|2K|4K] [--API-key KEY]
Edit existing image:
uv 运行 ~/.codex/技能s/nano-banana-pro/scripts/生成_image.py --prompt "editing instructions" --filename "输出-name.png" --输入-image "path/to/输入.png" [--resolution 1K|2K|4K] [--API-key KEY]
导入ant: Always 运行 from the user's current working directory so images are saved where the user is working, not in the 技能 directory.
Default 工作流 (draft → iterate → final)
Goal: fast iteration without burning time on 4K until the prompt is correct.
Draft (1K): quick feedback loop uv 运行 ~/.codex/技能s/nano-banana-pro/scripts/生成_image.py --prompt "" --filename "yyyy-mm-dd-hh-mm-ss-draft.png" --resolution 1K Iterate: adjust prompt in small diffs; keep filename new per 运行 If editing: keep the same --输入-image for every iteration until you're h应用y. Final (4K): only when prompt is locked uv 运行 ~/.codex/技能s/nano-banana-pro/scripts/生成_image.py --prompt "" --filename "yyyy-mm-dd-hh-mm-ss-final.png" --resolution 4K Resolution Options 1K (default) - ~1024px resolution 2K - ~2048px resolution 4K - ~4096px resolution
Map user 请求s to API parameters:
No mention of resolution → 1K "low resolution", "1080", "1080p", "1K" → 1K "2K", "2048", "normal", "medium resolution" → 2K "high resolution", "high-res", "hi-res", "4K", "ultra" → 4K Aspect Ratio Options
Pass via --aspect-ratio. Supported values: auto (default), 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9
API Key
The script 检查s for API key in this order:
--API-key argument (use if user provided key in chat) GRSAI_API_KEY 环境 variable
If neither is avAIlable, the script exits with an error message.
Preflight + Common 失败s (fast fixes)
Preflight:
command -v uv (must exist) test -n "$GRSAI_API_KEY" (or pass --API-key) If editing: test -f "path/to/输入.png"
Common 失败s:
Error: No API key provided. → 设置 GRSAI_API_KEY or pass --API-key Error loading 输入 image: → wrong path / unreadable file HTTP 401 → wrong or expired API key Generation fAIled: → content moderation or invalid 输入; rephrase prompt Filename Generation
生成 filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png
格式化: {timestamp}-{descriptive-name}.png
Timestamp: Current date/time in 格式化 yyyy-mm-dd-hh-mm-ss (24-hour 格式化) Name: Descriptive lowercase text with hyphens Keep the descriptive part concise (1-5 words typically) Use 上下文 from user's prompt or conversation If unclear, use random identifier (e.g., x9k2, a7b3)
Examples:
Prompt "A serene Japanese garden" → 2025-11-23-14-23-05-japanese-garden.png Prompt "sun设置 over mountAIns" → 2025-11-23-15-30-12-sun设置-mountAIns.png Prompt "创建 an image of a ro机器人" → 2025-11-23-16-45-33-ro机器人.png Unclear 上下文 → 2025-11-23-17-12-48-x9k2.png Image Editing
When the user wants to modify an existing image:
检查 if they provide an image path or reference an image in the current directory Use --输入-image parameter with the path to the image The prompt should contAIn editing instructions (e.g., "make the sky more dramatic", "移除 the person", "change to cartoon style") Common editing tasks: 添加/移除 elements, change style, adjust colors, blur background, etc. Prompt Handling
For generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.
For editing: Pass editing instructions in --prompt (e.g., "添加 a rAInbow in the sky", "make it look like a watercolor pAInting")
Preserve user's creative intent in 机器人h cases.
Prompt Templates (high hit-rate)
Use templates when the user is vague or when edits must be precise.
Generation template:
"创建 an image of: . Style: