Nodes/ComfyUI-BananaForge/🍌 BananaForge Batch (Multi-Prompt)
ComfyUI Node

🍌 BananaForge Batch (Multi-Prompt)

Many prompts, one queue β€” BananaForge's batch node

By Rinne414Β·Created 7 months agoΒ·Updated 2 months agoΒ· 2
🍌 BananaForge Batch (Multi-Prompt)
  • reference_image
  • IMAGES
  • COUNT
β—„api_urlhttps://generativelanguage.googleapis.com/v1betaβ–Ί
β—„api_keyβ–Ί
β—„use_env_filenoβ–Ί
β—„model_namegemini-3-pro-image-previewβ–Ί
β—„promptsA girl sitting on a chair A girl eating an apple A girl standing by the windowβ–Ί
β—„aspect_ratio1:1β–Ί
β—„image_sizedefaultβ–Ί
β—„wait_between2.0β–Ί

The batch node is the one you reach for when "generate one image" turns into "generate a dozen variations" and you'd rather not sit there clicking run. Feed it a list of prompts - one per line - and it queues them through the Gemini API back to back, with a configurable pause between calls so you don't immediately trip Google's rate limits. It's the same Gemini image generation (Nano Banana family) as the other two nodes in this pack, but pointed at a list instead of a single prompt.

Where this shines: a character sheet ("same girl, different outfits"), a set of product shots, or iterating over prompt phrasings in one go. The outputs come back as a single batched tensor with a count, so you can save them all downstream or pipe them into a grid.

How it works

Execution is a loop, not a single request. The node splits the prompts field on newlines, skips blank lines, and for each one calls generateContent exactly like the Text→Image node - same endpoint, same settings appended to the prompt, same retry logic. Between calls it sleeps wait_between seconds (skipped before the first prompt). Each line that succeeds gets its decoded image appended to a list, and at the end everything is torch.cat'd into one IMAGE batch tensor.

The nice part is what happens when a line fails: it logs the error with a 🍌 prefix and keeps going. One bad prompt doesn't nuke the whole batch - you get the survivors and a COUNT telling you how many actually succeeded. If every single line fails, you get a "All prompts failed" error instead of a silent empty result.

The inputs that matter

  • prompts - the whole point. One prompt per line, each line becomes one image. The default placeholder shows the pattern: three lines, three images.
  • wait_between - seconds to sleep between calls (default 2, up to 60). This is your rate-limit insurance, and on the free tier you'll probably want it higher than the default.
  • reference_image - the one optional input, and it's a mode switch. Attach an image and the whole batch flips into image-to-image mode, sending that same reference alongside every prompt. Great for "same character, many poses."
  • model_name, aspect_ratio, image_size, api_key, use_env_file - shared with the rest of the pack.

Two outputs: IMAGES (the batch tensor - N images stacked, so a Save Image node writes them all) and COUNT (an integer, the number of successful generations). That second one is your sanity check: batch of 10, COUNT of 8, and you know two lines got rejected.

Installing it

Same pack as the other BananaForge nodes:

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

Restart ComfyUI and it appears under Banana Forge. No pip packages to install (the requirements file is effectively empty - it's stdlib plus torch/numpy/PIL that ComfyUI already has), no model downloads, no GPU needed. Grab a free key from Google AI Studio and you're set. The repo also exists at Rinne414/ComfyUI-BananaForge since the author's GitHub rename; same code, either URL.

Where people get burned

  • Free-tier rate limits are the real constraint. A 20-line batch at wait_between: 2 will almost certainly hit throttling on the free tier. Bump it to 5–10s for long batches, or expect partial output and check COUNT.
  • Partial batches look like failures. You'll see the error in the console but still get images back. COUNT tells you the truth - this is a feature, not a bug.
  • One reference image, every prompt. If you plug in reference_image, it applies to all lines. There's no per-line reference, so a mixed t2i/i2i batch needs two nodes instead.
  • Gemini censorship. Content that trips Google's safety filters gets rejected per-line (the batch logs it and moves on). For anything edgy, this model - and by extension this node - is the wrong tool.
CategoryBanana Forge

Inputs (9)

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
promptsSTRINGA girl sitting on a chair A girl eating an apple A girl standing by the windowMultiple prompts - ONE PER LINE. Each line generates one image.
aspect_ratioCOMBO1:1Output aspect ratio
image_sizeCOMBOdefaultOutput resolution
wait_betweenFLOAT2.00–60Wait time between API calls (to avoid rate limits)
reference_imageoptIMAGEOptional: Reference image for image-to-image mode (used for ALL prompts)

Outputs (2)

NameTypeDescription
IMAGESIMAGEβ€”
COUNTINTβ€”