Nodes/AIYang_TripleAPI/NanoBanana Generate
ComfyUI Node

NanoBanana Generate

Cloud images from ComfyUI, and why the name is a trap

By AlexXia007·Created 10 months ago·Updated 10 months ago· 1
NanoBanana Generate
    • task_id
    • response_json
    • result_image
    prompt
    typeTEXTTOIAMGE
    num_images1
    api_key
    image_size_modeauto
    image_urls_json[]
    seed-1
    watermark
    serverhttps://api.nanobananaapi.ai
    timeout_seconds60
    wait_for_resultfalse
    poll_interval_seconds3
    poll_timeout_seconds240

    First, the name is a trap. "NanoBanana" here is not Google's Nano Banana - the Gemini image model everyone compares everything to. It's a third-party hosted image API at api.nanobananaapi.ai that borrowed the marketing, and this node just fronts it. No local model, no GPU, no weights. You paste an API key, type a prompt, and the image comes back over HTTP. That's the whole job, and it's also the reason the service has a genuinely mixed reputation in the community - worth knowing before you buy a year of credits.

    Why you'd reach for it

    This is the single-platform node inside AlexXia007/AIYang_TripleAPI, a small pack that wraps hosted image APIs into ComfyUI. Where the pack's other node fires three services at once, this one does just NanoBanana. You reach for it when you want generation quality without touching your VRAM, when your GPU is busy, or when you want to test-drive one service before committing to the triple shot. It also does image-to-image against reference URLs, so it doubles as a style-transfer or "improve this image" node.

    How it works

    The node builds a JSON request - your prompt, the generation type, image count, size, plus optional seed and watermark - and POSTs it to the server. The API is asynchronous: the first call just returns a task_id. From there you have a choice. Flip wait_for_result on (it defaults off) and the node polls the API's record-info endpoint every poll_interval_seconds until it gets a finished image or hits poll_timeout_seconds, then downloads the returned URLs into a proper ComfyUI image tensor - original sizes preserved, multiple images batched. Leave it off and you get the task ID and raw JSON but no image at all.

    The inputs and outputs that matter

    You'll actually set maybe four things:

    • api_key - required. The node hard-fails with a ValueError (red node) if it's empty.
    • prompt and type - TEXTTOIAMGE vs IMAGETOIAMGE. Yes, that's a misspelling of "IMAGE", and yes, it ships in the API too. Not a typo you made.
    • num_images (1–4) and image_size_mode - auto or an aspect preset like 9:16, 16:9, 1:1.
    • image_urls_json - a JSON array of URLs, needed when type is IMAGETOIAMGE. The node errors without it.

    The rest - seed, watermark, server, timeout_seconds, wait_for_result, and the poll settings - you can leave alone until something misbehaves.

    Outputs are three: result_image (IMAGE), task_id (STRING), and response_json (STRING). Wire result_image into a Preview Image or Save Image node; send task_id and response_json to a ShowText node when you're debugging an empty output.

    Install

    Same for the whole pack - no models to download, and dependencies are just Pillow, numpy and torch, which ComfyUI already ships:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AlexXia007/AIYang_TripleAPI.git
    cd AIYang_TripleAPI
    pip install -r requirements.txt
    

    Restart ComfyUI and it shows up as NanoBanana Generate under the NanoBanana category. ComfyUI Manager can find it by "AIYang_TripleAPI" too.

    Common issues

    • No image on the IMAGE output. You almost certainly left wait_for_result off - the node returns the task ID but a None image. Tick it, or handle the async flow yourself via task_id.
    • Red node with "未提供 API Key". The key field is genuinely required. Get one at nanobananaapi.ai.
    • Caveat emptor on the service itself. This API is unaffiliated with Google, sells prepaid credits, and community reports on refunds are inconsistent - the "is this a scam" question has come up more than once. Test with a small credit pack before committing.
    • The pack is tiny and its docs rot. The README is Chinese-only and describes an img2img sibling node that isn't actually registered in the shipped code. Treat the README as a hint, not ground truth.
    CategoryNanoBanana

    Inputs (13)

    NameTypeDefaultDescription
    promptSTRING
    typeCOMBOTEXTTOIAMGE2 options: TEXTTOIAMGE, IMAGETOIAMGE
    num_imagesINT11–4
    api_keySTRING
    image_size_modeCOMBOauto11 options: auto, 1:1, 9:16, 16:9, 3:4, 4:3, +5
    image_urls_jsonoptSTRING[]
    seedoptINT-1-1–99999999
    watermarkoptSTRING
    serveroptSTRINGhttps://api.nanobananaapi.ai
    timeout_secondsoptINT605–300
    wait_for_resultoptBOOLEANfalse
    poll_interval_secondsoptINT31–60
    poll_timeout_secondsoptINT2405–3600

    Outputs (3)

    NameTypeDescription
    task_idSTRING
    response_jsonSTRING
    result_imageIMAGE