Nodes/Comfyui_gemini_node/Google Gemini - Image Generation
ComfyUI Node

Google Gemini - Image Generation

Gemini text-to-image

By DannyTuu·Created 5 months ago·Updated 5 months ago· 0
Google Gemini - Image Generation
    • image
    • description
    • response_info
    prompt
    modelgemini-2.5-flash-image
    api_key
    base_url
    temperature1.0
    top_p0.95
    max_tokens8192
    system_instruction
    aspect_ratioauto
    image_sizeauto
    seed0

    Google Gemini - Image Generation is the pack's text-to-image node, and what you're actually calling is the model the community calls Nano Banana - Google's Gemini-native image generator. There are no weights for this thing. You can't download it, you can't run it on your GPU, and no amount of VRAM changes that. If you want Nano Banana, you call it over the API, and this node is the thin client that drops the result back into your workflow as a normal IMAGE tensor. It's the "closed model in an open graph" move, and it plugs into everything downstream - preview, save, upscale, or a video model that animates what Gemini just drew.

    How it works

    Type a prompt, and the node posts a generateContent request asking for both text and image output (responseModalities: ["TEXT", "IMAGE"]). Gemini replies with a text part - its own description of what it made - plus an image part, which the node base64-decodes back into a tensor. No local model, no GPU work; the only heavy lifting is the network call.

    The model dropdown ships with three choices:

    • gemini-2.5-flash-image (default) - the original Nano Banana, fast and cheap
    • gemini-3-pro-image-preview - Nano Banana Pro, 4K native, "thinking mode," the flagship
    • gemini-3.1-flash-image-preview - Nano Banana 2, the speed/quality hybrid

    Inputs and outputs

    The one you'll always set is prompt (multiline). After that the useful knobs are aspect_ratio (from 16:9 and 21:9 down to 9:16, default auto), image_size (auto / 1K / 2K / 4K), and seed for reproducible runs. Two quirks worth knowing straight from the source: image_size is silently ignored on the 2.5-flash model (it only applies to the Pro line), and seed is only sent to the API if you set it above 0. temperature, top_p, max_tokens, and system_instruction are there if you want them; api_key / base_url are runtime overrides you can leave empty if you configured the key once.

    Three outputs: image (wire to Preview Image / Save Image - it's a normal IMAGE), description (Gemini's text summary of the image), and response_info (a JSON string with the model, settings, and a status field). Wire description to a text node if you want to see it; response_info is your debugging window when a run fails.

    Install

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/DannyTuu/Comfyui_gemini_node.git
    python -m pip install -U requests pillow numpy
    

    Then restart, or use ComfyUI Manager to search Comfyui_gemini_node. No model files to download. You need a Gemini API key (AI Studio is the easiest start) - or, because this pack lets you override base_url, a reseller endpoint if you want cheaper per-image pricing than Google's own $0.039–0.24/image tiers.

    Where people get burned

    • Per-call cost. Every generation is metered, and Pro at 4K is the expensive tier. The community's own refrain about API nodes applies: it's the right tool for a model you can't run, and the wrong default for one you can.
    • The filter follows the model. Nano Banana is aggressively moderated - IMAGE_SAFETY filtering, strict famous-IP and celebrity restrictions, and an invisible SynthID watermark on everything. There's no abliterating it; the refusal is at Google's servers, not in weights you own.
    • Watch description and response_info on failures. Like the pack's other nodes, errors are returned as text rather than thrown, so a busted run still "succeeds" from ComfyUI's point of view. When you get None out of the image socket, read the description string - it usually says exactly what went wrong.
    • The classic hybrid worth stealing: generate a hero frame with Nano Banana Pro, then animate it with an open video model like Wan in the same graph. That's the pattern the community has settled on - closed Google model for the hard frame, open weights for the motion.
    CategoryGoogle/Gemini

    Inputs (11)

    NameTypeDefaultDescription
    promptSTRING
    modelCOMBOgemini-2.5-flash-image3 options: gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image-preview
    api_keyoptSTRING
    base_urloptSTRING
    temperatureoptFLOAT1.00–2
    top_poptFLOAT0.950–1
    max_tokensoptINT81921–65536
    system_instructionoptSTRING
    aspect_ratiooptCOMBOauto11 options: auto, 16:9, 4:3, 4:5, 3:2, 1:1, +5
    image_sizeoptCOMBOauto4 options: auto, 1K, 2K, 4K
    seedoptINT00–2147483647

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    descriptionSTRING
    response_infoSTRING