AS_MultimodalGemini
Text plus up to three images, one Gemini call, no babysitting
- IMAGE_1
- IMAGE_2
- IMAGE_3
- RESULT
- LOG
AS_MultimodalGemini is the generalist of the pack: it takes a text string plus up to three images, sends the whole bundle to Google Gemini, and returns the model's answer as text. Unlike its sibling AS_GeminiCaptioning, there's no built-in prompt template - no SDXL-versus-FLUX styling, no structure presets. You write the instructions, Gemini does the looking.
That's the appeal. The captioning node is opinionated and aimed at one job; this one is a blank canvas for vision tasks inside your graph. "Describe what's different between these two renders." "Which of these three images best matches the prompt?" "Read the text in this screenshot." If you can phrase it as an instruction and attach up to three images, this node can answer it and feed the answer back into the workflow - say, an evaluation pass that decides whether to keep or reject a generation.
Same honest caveat as its siblings: it's a cloud call. Your images and text go to Google, you pay per token, and "stays on my machine" is off the table. For a single test it's nothing; for batch-evaluating a thousand images, do the math on the bill before you click.
How it works
The mechanism is straightforward: each attached image tensor gets converted to PNG bytes and base64-encoded, your TEXT_INPUT is appended as the final part of the payload, and the whole thing goes to Gemini's generate_content with a ten-minute timeout. Your text is the instruction and the images are the evidence. The reply comes back as a string on the RESULT output; a LOG output tracks each step (image processed, key read, request sent) and carries error text when something fails.
The inputs that matter
Only three things are required:
- TEXT_INPUT - your instruction. This is the entire prompt, so make it self-contained: "Compare image 1 and image 2 and list three differences," not "what is this?"
- API_KEY_PATH - path to a plaintext file containing your Gemini API key. Note the naming here is clean (
API_KEY_PATH), unlike the "APY" typo in the captioning node - the two don't even agree with each other. - GEMINI MODEL - same four choices as the rest of the pack, defaulting to Gemini 2.0 Flash.
The optional IMAGE_1, IMAGE_2, IMAGE_3 slots take up to three images. They're optional in the schema, and the node simply skips empty ones - so yes, it degrades to a pure text-to-text Gemini call if you leave them all disconnected. Which is fine, but if text-only is all you need, the ComfyGPT-style text nodes are simpler.
Outputs are RESULT (the text answer) and LOG. There's no save-to-file option here - the captioning node has that, this one just hands you the string.
Installing it
Same pack, same steps:
cd ComfyUI/custom_nodes
git clone https://github.com/svetozarov/AS_LLM_nodes
then restart ComfyUI - or search AS_LLM_nodes in ComfyUI Manager and install from there. The pack pulls in google-generativeai, openai, Pillow, and requests; there are no model files because nothing runs locally.
Troubleshooting
The recurring failure mode across this pack is the key file - wrong path, stray whitespace, or a key that isn't valid for the model you picked. The LOG output tells you which stage died, and it's the first thing to read.
Second, the image slots quietly do nothing if the wrong thing is plugged in. This node expects ComfyUI IMAGE tensors, not file paths - wire an image that's already in your graph (a Load Image output, a VAE-decoded result) and it'll just work. The "Flash-Lite" model option also maps to a stale -preview model id in the source; if that call errors, use 2.0 Flash. And as with any small, barely-known custom node that handles a billed API key: the two-minute skim of AS_LLM_nodes.py is cheap insurance. Custom nodes are arbitrary code, and this is exactly the kind of pack - tiny, no community track record - that deserves the once-over.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| TEXT_INPUT | STRING | — | |
| API_KEY_PATH | STRING | — | |
| GEMINI MODEL | COMBO | Gemini 2.0 Flash | 4 options: Gemini 2.0 Flash, Gemini 2.0 Flash-Lite, Gemini 1.5 Flash, Gemini 1.5 Pro |
| IMAGE_1opt | IMAGE | — | |
| IMAGE_2opt | IMAGE | — | |
| IMAGE_3opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| RESULT | STRING | — |
| LOG | STRING | — |