Skip to main content

Overview

api_yi_nano_banana_node is a lightweight ComfyUI custom node contributed by community partner JerrIsTheBesta. It focuses on “drop-in simplicity + easy extension.” Just drop it into your custom_nodes directory, restart ComfyUI, and you can call APIYI’s Nano Banana Pro / Nano Banana 2 image generation directly in your workflow — a perfect starting point for learning and customization.
Project Info
  • 🔗 Source: github.com/JerrIsTheBesta/api_yi_nano_banana_node
  • 📜 License: MIT
  • 👤 Author: JerrIsTheBesta
  • ⭐ Contributed by a community partner — positioned as an example you can extend
Who is this for?This node focuses on the two most common operations: text-to-image and multi-image editing. The code is minimal and readable. If you need richer capabilities (conversational editing, 14-image blending, etc.), check out the full-featured Nano Banana ComfyUI node, or fork this one and extend it.

Core Features

Two core nodes

APIYI Text to Image + APIYI Multi Image Edit — covers the two most common workflows

Dual-model switching

Choose between gemini-3-pro-image-preview (Nano Banana Pro) and gemini-3.1-flash-image-preview

High-res output

Supports 2K / 4K output with automatic timeout tuning based on resolution

Rich aspect ratios

Built-in 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 5:4, 4:5 — 10 ratios total

Multi-image editing

Multi Image Edit accepts up to 5 reference images for blending / style transfer

Lightweight & hackable

Pure Python with minimal deps (requests / Pillow / numpy). Clean structure, easy to customize

Supported APIYI Models

ModelModel IDUseAPI Docs
Nano Banana Progemini-3-pro-image-previewHigh-quality image generation & editingView
Nano Banana 2 (Flash)gemini-3.1-flash-image-previewFast generation, lower costView

Node Details

APIYI Text to Image

Generates images from a text prompt — no input image required. Outputs: generated image + filename identifier.

APIYI Multi Image Edit

Accepts up to 5 input images for blending, editing, or composition. Outputs: result image, filename, count of images actually used.

Node Parameters

ParameterTypeRequiredDefaultDescription
api_keystringYes-APIYI token — we recommend a dedicated key with usage cap
promptstringYes-Text prompt
modelenumYesgemini-3-pro-image-previewModel (Pro / Flash)
resolutionenumNo2KOutput resolution (2K / 4K, 4K auto-extends timeout)
aspect_ratioenumNo1:110 aspect ratios available
imagesIMAGENo-Reference images for Multi Image Edit (up to 5)

Installation

1

Step 1: Drop into custom_nodes

Inside your ComfyUI installation, clone the repo under custom_nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/JerrIsTheBesta/api_yi_nano_banana_node.git
2

Step 2: Install Python deps

Deps are minimal — ComfyUI typically ships with torch. Install the rest if missing:
pip install requests pillow numpy
3

Step 3: Restart ComfyUI

After restart, search APIYI in the node palette to find:
  • APIYI Text to Image
  • APIYI Multi Image Edit
4

Step 4: Configure APIYI key

  • Visit the APIYI Console → Tokens, and create a dedicated key with a usage cap (security best practice)
  • Paste the key into the node’s api_key field
  • No endpoint setup needed — the node uses https://api.apiyi.com internally
5

Step 5: Build a simple workflow

  • Text-to-image: APIYI Text to ImagePreview Image
  • Multi-image edit: multiple Load ImageAPIYI Multi Image EditPreview Image

Usage Examples

Example 1: Text to Image

Node: APIYI Text to Image
prompt: "A cute corgi astronaut floating in a neon-lit space station, cinematic lighting"
model: gemini-3-pro-image-preview
resolution: 2K
aspect_ratio: 16:9

Example 2: Multi-Image Blending

Node: APIYI Multi Image Edit
images: [person photo, outfit reference, background reference]
prompt: "Replace the outfit with the reference clothing, and set the scene in the reference background"
resolution: 4K
aspect_ratio: 1:1

Extension Ideas

This project is positioned as an example and starting point — fork and extend as needed:

Conversational editing

Maintain session context inside the node for iterative refinement

More reference images

Raise the limit to 14 images to match Nano Banana Pro’s full capacity

Seed control

Add a seed parameter for reproducible generations

Batch output

Emit batches of images into downstream ComfyUI nodes

FAQ

  1. Make sure the repo is inside ComfyUI/custom_nodes/
  2. Fully restart ComfyUI (not just refresh the frontend)
  3. Check ComfyUI’s console for any Python import errors
Check:
  1. api_key is correct and not restricted to the wrong channel
  2. The selected model is on the token’s whitelist
  3. Account balance is sufficient — see Balance seems enough but calls fail
The node auto-extends timeout for 4K, but if it still fails:
  1. Check network path to the API (see CDN image/video downloads are slow)
  2. Fall back to 2K or Flash during peak hours
The author explicitly recommends not using your master key — create a dedicated token with a usage cap in the APIYI console for this node, so any leak has limited blast radius.
  • This node: lightweight example, 2 nodes only, minimal deps — ideal for onboarding and customization
  • Full version: richer feature set (conversational editing, 14-image blending), built for production workflows

Nano Banana Pro API

Full API reference for Nano Banana Pro

Full ComfyUI Node

The full-featured Nano Banana ComfyUI node pack

Scenario Overview

Browse more APIYI scenarios

APIYI Console

Manage API keys and usage