π BananaForge Batch (Multi-Prompt)
Many prompts, one queue β BananaForge's batch node
- reference_image
- IMAGES
- COUNT
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: 2will almost certainly hit throttling on the free tier. Bump it to 5β10s for long batches, or expect partial output and checkCOUNT. - Partial batches look like failures. You'll see the error in the console but still get images back.
COUNTtells 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| api_url | STRING | https://generativelanguage.googleapis.com/v1beta | API base URL |
| api_key | STRING | API key (leave empty to use .env file) | |
| use_env_file | COMBO | no | Load API key from .env file |
| model_name | STRING | gemini-3-pro-image-preview | Model name |
| prompts | STRING | A girl sitting on a chair A girl eating an apple A girl standing by the window | Multiple prompts - ONE PER LINE. Each line generates one image. |
| aspect_ratio | COMBO | 1:1 | Output aspect ratio |
| image_size | COMBO | default | Output resolution |
| wait_between | FLOAT | 2.00β60 | Wait time between API calls (to avoid rate limits) |
| reference_imageopt | IMAGE | Optional: Reference image for image-to-image mode (used for ALL prompts) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGES | IMAGE | β |
| COUNT | INT | β |