Banana: Invoking Nano Banana Pro for Text-to-Image and Image Editing within Agents

Preface

In conversational interfaces, when asking a model to “draw an image” or “modify this image,” the common approach is to open a separate Web UI or write scripts to call image APIs. This creates a fragmented workflow, and resolution, iteration, and save paths often fail to align with the current working directory. The following introduces banana (coordinate @user_68c7e960/banana) on SkillHub: it encapsulates the generation and editing capabilities of Nano Banana Pro (Gemini 3 Pro Image) into an Agent-readable SKILL.md. The Agent follows the documentation to call the accompanying script to generate images.

What is this

banana is a community-sourced (community) Skill of the design-media category. The current version displayed on SkillHub is 1.0.0, published by user_68c7e960. The official description summarizes it as: using Nano Banana Pro to generate or edit images, covering creation and modification requests; supports text-to-image and image-to-image/editing, with output resolutions of 1K / 2K / 4K. For editing scenarios, the original image is passed via --input-image. The page tags indicate requires_api_key=true; a Gemini API key must be prepared before use.

SkillHub Page: https://www.skillhub.cn/skills/user_68c7e960/banana
API Resource URL: https://api.skillhub.cn/user_68c7e960/banana

(As of the data capture time, SkillHub shows a rating of approximately 100000, 2855 downloads, and 28 installations.)

Core Features

Verified capabilities are as follows, all derived from the official package’s SKILL.md and scripts/generate_image.py:

  1. Text-to-Image: Use --prompt to describe the scene and --filename to specify the output PNG path.
  2. Image Editing: Adds --input-image to the generation parameters; use natural language for editing instructions (e.g., change sky, remove person, change style).
  3. Resolution: --resolution accepts 1K (default), 2K, 4K; the documentation requires the uppercase K.
  4. API Key: Prioritizes --api-key, otherwise reads the environment variable GEMINI_API_KEY; the script will exit with an error if neither is present.
  5. Execution: Runs the Python script via uv run (the script declares dependencies google-genai, pillow, Python ≥ 3.10).
  6. Working Directory: The documentation emphasizes executing commands in the user’s current working directory. Do not switch the working directory to the Skill installation directory, so that images are saved in the project path the user is currently handling.

The Skill also suggests a workflow of “Draft 1K iteration → Final 4K”, as well as naming output files by timestamp (yyyy-mm-dd-hh-mm-ss-description.png) to reduce unnecessary high-resolution calls.

Installation and Activation

Install SkillHub CLI (if not already installed)

command -v skillhub && skillhub --version

If not installed, follow the SkillHub installation documentation (full installation example):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install banana

When installing, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized:

skillhub install @user_68c7e960/banana --dir <your Agent skills directory>

Common paths (from SkillHub installation instructions):

Environment skills Directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project

After installation via skillhub install, the skill will land in a subdirectory named similar to @user_68c7e960/banana (consistent with the coordinate). Using Cursor as an example below, the absolute path to the script is:

~/.cursor/skills/@user_68c7e960/banana/scripts/generate_image.py

For other Agents, replace the prefix with the corresponding directory from the table above. After installing or updating the Skill, restart or refresh the Agent according to your client’s instructions to load the new Skill.

API Key

export GEMINI_API_KEY="your_key"

You can also pass --api-key in a single call (suitable for scenarios where you provide a key temporarily in the conversation).

Prerequisites Check

The documentation suggests confirming the following before execution:

command -v uv
test -n "$GEMINI_API_KEY"

For editing mode, also confirm that the file pointed to by --input-image exists and is readable.

Typical Usage

The following commands should all be executed in the user’s current working directory. Replace paths according to your actual skills installation location.

Text-to-Image (Default 1K):

uv run ~/.cursor/skills/@user_68c7e960/banana/scripts/generate_image.py \
  --prompt "A serene Japanese garden with cherry blossoms" \
  --filename "2025-11-23-14-23-05-japanese-garden.png"

Specify 4K Resolution:

uv run ~/.cursor/skills/@user_68c7e960/banana/scripts/generate_image.py \
  --prompt "sunset over mountains" \
  --filename "2025-11-23-15-30-12-sunset-mountains.png" \
  --resolution 4K

Edit Existing Image:

uv run ~/.cursor/skills/@user_68c7e960/banana/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

Upon success, the script outputs the save path; the Skill documentation states that the Agent does not need to read the image back into the conversation, just inform the user of the path.

In environments like Cursor, you can also simply ask the Agent to “Install @user_68c7e960/banana based on SkillHub installation instructions,” and the Agent will read the SKILL.md and call the script as described above.

Use Cases and Notes

Who is it for

  • Developers or designers already using clients that support Skills (like Cursor, Claude Code, Codex) and want to complete “Description → Generate → Edit” within the same conversation.
  • Scenarios requiring controllable resolution (1K for drafts, 4K for final output) and where output should land in the current project directory.

Limitations and Notes

  1. Must provide own API Key, and bear the quota and costs of Gemini / Nano Banana Pro; 403 or quota errors require checking your key and account permissions.
  2. Depends on local uv and network access to Google GenAI API; sandboxes or offline environments need to allow this in advance.
  3. The example path in SKILL.md is written as ~/.codex/skills/nano-banana-pro/..., which is inconsistent with the @user_68c7e960/banana directory name after SkillHub installation; in actual use, change it to the path generated by your local skillhub install to avoid script not found errors.
  4. Output is PNG; when editing, use clear English or Chinese instructions on “what to change, what to preserve.” The documentation provides prompt templates for generation and editing to reduce deviations.

Conclusion

banana consolidates the generation and editing of Gemini 3 Pro Image (Nano Banana Pro) into a reproducible CLI workflow, packaged in the standard Skill format. This allows Agents to execute directly in design-media tasks. If you want to enable it in your local Agent, you can view the instructions and install it from the SkillHub page: https://www.skillhub.cn/skills/user_68c7e960/banana.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye