{"skill":{"slug":"nano-banana-pro-grsai","displayName":"Nano Banana Pro via cheaper grsai.com","summary":"Generate/edit images with Nano Banana Pro via grsai.com API. Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K...","description":"---\nname: nano-banana-pro\ndescription: Generate/edit images with Nano Banana Pro via grsai.com API. Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.\n---\n\n# Nano Banana Pro Image Generation & Editing\n\nGenerate new images or edit existing ones using the grsai.com Nano Banana Pro API.\n\n## Usage\n\nRun the script using absolute path (do NOT cd to skill directory first):\n\n**Generate new image:**\n```bash\nuv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"your image description\" --filename \"output-name.png\" [--resolution 1K|2K|4K] [--api-key KEY]\n```\n\n**Edit existing image:**\n```bash\nuv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"editing instructions\" --filename \"output-name.png\" --input-image \"path/to/input.png\" [--resolution 1K|2K|4K] [--api-key KEY]\n```\n\n**Important:** Always run from the user's current working directory so images are saved where the user is working, not in the skill directory.\n\n## Default Workflow (draft → iterate → final)\n\nGoal: fast iteration without burning time on 4K until the prompt is correct.\n\n- Draft (1K): quick feedback loop\n  - `uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"<draft prompt>\" --filename \"yyyy-mm-dd-hh-mm-ss-draft.png\" --resolution 1K`\n- Iterate: adjust prompt in small diffs; keep filename new per run\n  - If editing: keep the same `--input-image` for every iteration until you're happy.\n- Final (4K): only when prompt is locked\n  - `uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"<final prompt>\" --filename \"yyyy-mm-dd-hh-mm-ss-final.png\" --resolution 4K`\n\n## Resolution Options\n\n- **1K** (default) - ~1024px resolution\n- **2K** - ~2048px resolution\n- **4K** - ~4096px resolution\n\nMap user requests to API parameters:\n- No mention of resolution → `1K`\n- \"low resolution\", \"1080\", \"1080p\", \"1K\" → `1K`\n- \"2K\", \"2048\", \"normal\", \"medium resolution\" → `2K`\n- \"high resolution\", \"high-res\", \"hi-res\", \"4K\", \"ultra\" → `4K`\n\n## Aspect Ratio Options\n\nPass 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`\n\n## API Key\n\nThe script checks for API key in this order:\n1. `--api-key` argument (use if user provided key in chat)\n2. `GRSAI_API_KEY` environment variable\n\nIf neither is available, the script exits with an error message.\n\n## Preflight + Common Failures (fast fixes)\n\n- Preflight:\n  - `command -v uv` (must exist)\n  - `test -n \"$GRSAI_API_KEY\"` (or pass `--api-key`)\n  - If editing: `test -f \"path/to/input.png\"`\n\n- Common failures:\n  - `Error: No API key provided.` → set `GRSAI_API_KEY` or pass `--api-key`\n  - `Error loading input image:` → wrong path / unreadable file\n  - HTTP 401 → wrong or expired API key\n  - `Generation failed:` → content moderation or invalid input; rephrase prompt\n\n## Filename Generation\n\nGenerate filenames with the pattern: `yyyy-mm-dd-hh-mm-ss-name.png`\n\n**Format:** `{timestamp}-{descriptive-name}.png`\n- Timestamp: Current date/time in format `yyyy-mm-dd-hh-mm-ss` (24-hour format)\n- Name: Descriptive lowercase text with hyphens\n- Keep the descriptive part concise (1-5 words typically)\n- Use context from user's prompt or conversation\n- If unclear, use random identifier (e.g., `x9k2`, `a7b3`)\n\nExamples:\n- Prompt \"A serene Japanese garden\" → `2025-11-23-14-23-05-japanese-garden.png`\n- Prompt \"sunset over mountains\" → `2025-11-23-15-30-12-sunset-mountains.png`\n- Prompt \"create an image of a robot\" → `2025-11-23-16-45-33-robot.png`\n- Unclear context → `2025-11-23-17-12-48-x9k2.png`\n\n## Image Editing\n\nWhen the user wants to modify an existing image:\n1. Check if they provide an image path or reference an image in the current directory\n2. Use `--input-image` parameter with the path to the image\n3. The prompt should contain editing instructions (e.g., \"make the sky more dramatic\", \"remove the person\", \"change to cartoon style\")\n4. Common editing tasks: add/remove elements, change style, adjust colors, blur background, etc.\n\n## Prompt Handling\n\n**For generation:** Pass user's image description as-is to `--prompt`. Only rework if clearly insufficient.\n\n**For editing:** Pass editing instructions in `--prompt` (e.g., \"add a rainbow in the sky\", \"make it look like a watercolor painting\")\n\nPreserve user's creative intent in both cases.\n\n## Prompt Templates (high hit-rate)\n\nUse templates when the user is vague or when edits must be precise.\n\n- Generation template:\n  - \"Create an image of: <subject>. Style: <style>. Composition: <camera/shot>. Lighting: <lighting>. Background: <background>. Color palette: <palette>. Avoid: <list>.\"\n\n- Editing template (preserve everything else):\n  - \"Change ONLY: <single change>. Keep identical: subject, composition/crop, pose, lighting, color palette, background, text, and overall style. Do not add new objects. If text exists, keep it unchanged.\"\n\n## Output\n\n- Saves image to current directory (or specified path if filename includes directory)\n- Script outputs the full path to the generated image\n- **Do not read the image back** - just inform the user of the saved path\n\n## Examples\n\n**Generate new image:**\n```bash\nuv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"A serene Japanese garden with cherry blossoms\" --filename \"2025-11-23-14-23-05-japanese-garden.png\" --resolution 4K\n```\n\n**Edit existing image:**\n```bash\nuv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt \"make the sky more dramatic with storm clouds\" --filename \"2025-11-23-14-25-30-dramatic-sky.png\" --input-image \"original-photo.jpg\" --resolution 2K\n```\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":279,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1771427794797,"updatedAt":1778991460788},"latestVersion":{"version":"1.0.0","createdAt":1771427794797,"changelog":"- Updated API references from Gemini 3 Pro to grsai.com Nano Banana Pro.\n- Changed required environment variable for API key from GEMINI_API_KEY to GRSAI_API_KEY.\n- Added support for setting aspect ratio via --aspect-ratio with several common values.\n- Improved troubleshooting section with updated error messages and API failure handling.\n- Minor clarifications to output, file saving, and filename generation instructions.","license":null},"metadata":null,"owner":{"handle":"delneg","userId":"s17eyttf4ejzss6zpp31nwa6ch884274","displayName":"Denis","image":"https://avatars.githubusercontent.com/u/10036256?v=4"},"moderation":null}