AI Agent Hub
Back to skills
Nano Banana 2 Image Generation icon

Nano Banana 2 Image Generation

Design & Media Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_4bd21536/nano-banana2.

About this skill

Problem It Solves

When a user needs an image from a text prompt or reference images, direct API calls can become fragile: invalid parameters, scattered keys, long generation time, accidental retries, and duplicate submissions may all increase cost. nano-banana2 narrows the workflow into a repeatable text-to-image and image-to-image process. It is not intended for video, audio, OCR, or non-generative image editing.

How It Works

  • Input contract: prompt is required; urls, aspectRatio, and imageSize are optional. Invalid ratios fall back to auto; invalid sizes fall back to 1K.
  • Key handling: uses an explicit key from the conversation first, then the X_API_KEY environment variable, and only reads local .env when explicitly enabled. Keys should be masked in logs and responses.
  • Call discipline: outputs a request summary and waits for confirmation before invoking the fixed imgEditNB2 endpoint. Uses a long timeout such as curl -m 600; defaults to one call per turn and does not auto-retry without explicit user consent.
  • Structured output: returns a parameter summary, success or failure status, fallback fields, and next-step suggestions, making results easier to consume downstream.

Boundaries And Notes

Generation can take several minutes, so the process should wait rather than kill and resubmit. The key comes from a third-party service, so trust and compliance should be confirmed before use. For 401, 429, 5xx, or network timeout errors, stop automatic retries and explain the risk before asking the user to retry.

Use Cases

  • Turn a client’s one-line poster brief and reference images into a 16:9 visual concept.
  • Generate a vertical 9:16 social cover from product screenshot URLs using image-to-image.
  • Prepare 4K hero-image candidates for design review and export a 3:2 ratio for comparison.
  • Produce image URLs from prompts in an automation flow and log success, failure, and fallbacks.

Best For

  • Design assistant who turns a one-line prompt into usable image URLs
  • Social marketer producing cover and poster drafts with fixed 16:9/9:16 ratios
  • Design engineer feeding reference image URLs to an image-to-image model for candidates
  • AI application engineer needing structured success/failure results in scripts or workflows