Nodes/ComfyUI Gemini Nodes/Gemini Image Batch Processor
ComfyUI Node

Gemini Image Batch Processor

Ask Gemini to compare, sequence, or diff a whole stack of images

By jqy-yoΒ·Created about a year agoΒ·Updated 11 months agoΒ· 7
Gemini Image Batch Processor
  • images
  • analysis_text
  • first_image
  • api_request
  • api_response
β—„api_keyβ–Ί
β—„modebatch_describeβ–Ί
β—„promptAnalyze these images.β–Ί
β—„modelgemini-1.5-flashβ–Ί
β—„temperature0.7β–Ί
β—„max_output_tokens2048β–Ί
β—„process_individuallyfalseβ–Ί

The node for "look at all these images at once"

GeminiImageProcessor analyzes one image. This node takes a whole IMAGE batch - a tensor with several frames, or a stack of images from a batch generator - and runs a single Gemini call over all of them together. That's the whole trick, and it unlocks questions you can't ask of a single image: which of these four renders matches the prompt best? What changes between these frames? What's different between these two versions?

It's a quiet node in this pack, but there's no substitute for it. Batch comparison is genuinely not something a single-image node can do.

How it works

You feed it an images IMAGE input (a batch - anything with more than one frame works), pick a mode, and it sends the whole set to Gemini in one multimodal request:

  • batch_describe (default) - describe all the images together.
  • compare - have the model compare them, which is where "which looks most like X?" style questions live.
  • sequence_analysis - for frames in order, like analyzing a shot sequence or a mini-animation.
  • find_differences - spot what changed between images. The obvious use is A/B comparisons of generations.

The process_individually toggle changes the mechanism: off (default) sends everything as one request; on processes each image separately. One request is cheaper and gives the model the full context; individual processing gives per-image detail. The model defaults to gemini-1.5-flash, a good stable choice for vision.

Inputs and outputs

  • images - your batch (required).
  • mode - pick the job.
  • prompt - the specific instruction; defaults to "Analyze these images."
  • process_individually - batch-as-one vs. per-image.
  • temperature, max_output_tokens - the standard dials; low temperature for comparison/analysis tasks.

Outputs are analysis_text (the verdict - wire it to a text display node), first_image (an IMAGE passthrough of the first frame, handy for keeping a visual in the graph), and the pack's standard api_request / api_response debug strings. When the model's answer seems off, those two outputs are where you'll see what actually got sent.

Install

It's part of the one-pack install, same as everything else here:

cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt

Or "ComfyUI Gemini Nodes" via ComfyUI Manager, restart, and drop your key in api_key or the GOOGLE_API_KEY env var.

Where people get burned

Two common mistakes. First, feeding it a single image and wondering why "compare" makes no sense - comparison needs a batch of at least two frames; build one with a Load Image β†’ Image Batch or from a generator before this node. Second, expecting per-image detail from the default batch mode: with process_individually off, Gemini gives you one synthesized answer, not a per-frame breakdown - flip the toggle when you need the latter (and expect more calls/cost). And remember the model limits: the pack's own notes warn that lite models choke on large batches, so keep gemini-1.5-flash or better here.

CategoryπŸ€– Gemini

Inputs (8)

NameTypeDefaultDescription
api_keySTRINGβ€”
imagesIMAGEβ€”
modeCOMBObatch_describe4 options: compare, sequence_analysis, batch_describe, find_differences
promptSTRINGAnalyze these images.β€”
modelSTRINGgemini-1.5-flashβ€”
temperatureFLOAT0.70–1β€”
max_output_tokensINT204850–8192β€”
process_individuallyBOOLEANfalseβ€”

Outputs (4)

NameTypeDescription
analysis_textSTRINGβ€”
first_imageIMAGEβ€”
api_requestSTRINGβ€”
api_responseSTRINGβ€”