Nodes/ComfyUI-BananaForge/🍌 BananaForge Text β†’ Image
ComfyUI Node

🍌 BananaForge Text β†’ Image

Gemini's image model, inside ComfyUI β€” no GPU required

By Rinne414Β·Created 7 months agoΒ·Updated 2 months agoΒ· 2
🍌 BananaForge Text β†’ Image
    • IMAGE
    β—„api_urlhttps://generativelanguage.googleapis.com/v1betaβ–Ί
    β—„api_keyβ–Ί
    β—„use_env_filenoβ–Ί
    β—„model_namegemini-3-pro-image-previewβ–Ί
    β—„promptA beautiful landscapeβ–Ί
    β—„aspect_ratio1:1β–Ί
    β—„image_sizedefaultβ–Ί
    β—„wait_seconds0.0β–Ί

    If you've seen "Nano Banana" output all over social media - Google's rebrand of Gemini-native image generation, technically stunning and aggressively censored - this node is how you call the same model without leaving ComfyUI. It's a thin wrapper around the Gemini API. No local checkpoint, no diffusion steps on your GPU, no model download. Just a prompt, an API key, and Google's servers do the heavy lifting.

    That last part is the whole pitch, honestly. You can run this on a laptop with no GPU, because the actual generation happens in Google's cloud. The trade is that you're paying per image (or staying inside the free tier) and you inherit every guardrail Google ships - more on that in a minute.

    How it works

    The node takes your text prompt and POSTs it to {api_url}/models/{model_name}:generateContent (that's the Google Generative Language API, with the default URL already filled in). The response is a base64-encoded image, which the node decodes into a normal ComfyUI IMAGE tensor. It even appends a little settings hint to your prompt - [Image settings: aspect ratio 1:1] - as well as passing the ratio to the API's imageConfig.

    Under the hood there are three retries with exponential backoff for transient connection errors, and a 300-second timeout, so flaky networks don't nuke your run with one bad request. Every step logs to the ComfyUI console with a 🍌 prefix, which makes it easy to see what the node actually sent.

    The default model is gemini-3-pro-image-preview, which is Nano Banana Pro: 4K native output, "thinking mode," genuinely the flagship. You can swap to gemini-2.5-flash-image (plain Nano Banana) if you want something faster and friendlier to the free tier. Worth knowing: image_size (2K/4K) only actually takes effect when the model name contains "pro" - the code checks for that string, so don't expect 4K out of the flash model.

    The inputs that matter

    • api_key - paste your key from Google AI Studio, or set use_env_file to yes and drop a .env next to the node files. The code reads API_KEY/GEMINI_API_KEY from it.
    • model_name - defaults to the Pro preview; change to the flash model for cheaper/faster.
    • prompt - the actual description. Make it specific; the API is prompt-sensitive in a different way than local diffusion.
    • aspect_ratio - 1:1, 16:9, 9:16, 4:3, 3:4.
    • image_size - default, 2K, or 4K (Pro only, as above).
    • wait_seconds - a sleep before the API call, your first line of defense against rate limits.

    The single output is IMAGE, which you can wire straight into a Save Image node or pass onward for upscaling/VAE-free use. No negatives, no seed - you don't control sampling here; Gemini handles all of that.

    Installing it

    The whole pack is three nodes (Text→Image, Image→Image, Batch) under one install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/peter119lee/ComfyUI-BananaForge
    

    Restart ComfyUI and you'll find them under the Banana Forge category. ComfyUI Manager users can just search "BananaForge." There's a requirements.txt, but it's essentially empty - the node only needs standard-library urllib plus torch/numpy/PIL, which ComfyUI already ships. No model files to fetch, no GPU requirements.

    Where people get burned

    • "API key cannot be empty" - you forgot the key or the .env isn't in the node's folder. The .env must live in custom_nodes/ComfyUI-BananaForge/, not your ComfyUI root.
    • "Content blocked by safety filters" - this is the big one. Gemini image generation is famously censored: "powerful, unimaginative, massive hidden biasing" is how one r/StableDiffusion thread put it, and Google tightened IMAGE_SAFETY filtering further in early 2026. If the model refuses, the node surfaces the block reason. Reword the prompt; this model isn't the one to fight filters with.
    • Rate limits - the free tier throttles fast. Bump wait_seconds to 2–5s between runs.
    • "No image in response" / "No candidates" - the model string you typed doesn't exist or got renamed. Google churns preview model names; check the current gemini-*-image-preview name before blaming the node.

    One more note: the repo's author renamed their GitHub account from peter119lee to Rinne414, so you'll see both URLs around. They're the same codebase - GitHub redirects the old one.

    CategoryBanana Forge

    Inputs (8)

    NameTypeDefaultDescription
    api_urlSTRINGhttps://generativelanguage.googleapis.com/v1betaAPI base URL
    api_keySTRINGAPI key (leave empty to use .env file)
    use_env_fileCOMBOnoLoad API key from .env file
    model_nameSTRINGgemini-3-pro-image-previewModel name
    promptSTRINGA beautiful landscapeText prompt for image generation
    aspect_ratioCOMBO1:1Output aspect ratio
    image_sizeCOMBOdefaultOutput resolution
    wait_secondsFLOAT0.00–60Wait time before API call (to avoid rate limits)

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGEβ€”