Chat
Chat with Gemini inside ComfyUI — the LLM becomes just another node
- config
- image_1
- image_2
- image_3
- image_4
- image_5
- STRING
"Chat" is the node that makes an LLM a first-class part of your ComfyUI graph instead of a browser tab you copy-paste from. Give it a prompt, and it returns a STRING - which you can pipe into anything that eats text: a prompt rewriter feeding a CLIP encoder, an image captioner, a tag generator for your dataset, whatever. The model runs on someone else's GPU, so your VRAM doesn't move a millimeter.
This is the LiteLLM version, which means it talks to a LiteLLM server you run (or your company runs) rather than calling a cloud provider directly. If that sentence made you frown, you probably want the Chat (OpenRouter) variant instead - same node shape, no server to babysit.
How it works
It's a thin OpenAI-style client. The node builds a messages array - an optional system message, then your prompt as a user message - and POSTs it to {api_base}/chat/completions with the Bearer key from your Base Config. Images get base64-encoded as PNG data URLs and dropped inline in the message, which is what makes it multimodal. It retries once, then gives up with the raw API error in the console.
The LiteLLM path is worth understanding because it's the one real setup step. LiteLLM is a proxy that fronts many model providers behind one OpenAI-compatible endpoint; your api_base points at that server, and the model string carries the provider prefix (like gemini/gemini-3-pro-image-preview). No LiteLLM server, no chat - the node will just sit there unable to connect.
The inputs that matter
- config - the
LLM_CHAT_CONFIGfrom Chat Params. This carries your API base, key, model, temperature, and max_tokens downstream. - prompt - what you're actually asking. Multiline, so you can write proper instructions.
- system - optional, but this is where a persona or role lives: "You are a prompt engineer for photorealistic images. Return only a comma-separated prompt." Forcing the output format here is the difference between usable text and a paragraph you have to clean up.
- image_1 through image_5 - optional IMAGE inputs. Wire in a Load Image and Gemini will look at it, which makes this a captioning or image-analysis node as easily as a chat node.
One STRING output. That's it. For beginners the flow is: Base Config → Chat Params → Chat → something that consumes STRING, like a Show Text node while you're testing.
Installing it
Same pack, same story - no dependencies beyond what ComfyUI already has, no model downloads:
# ComfyUI Manager: search "Gemini LiteLLM", Install, restart
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZUENS2020/ComfyUI-Gemini-LiteLLM
Gotchas
If you see the chat output literally say Error: Missing parameters, it means your Base Config has an empty key, base, or model - the node checks before calling out. Double-check you actually started your LiteLLM server, too; the most common failure is a correct-looking node pointed at nothing. And a small honesty note: this pack's community footprint is tiny, so expect to debug the LiteLLM side yourself - the OpenRouter branch of the pack is the smoother on-ramp if you're not already invested in a proxy.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| config | LLM_CHAT_CONFIG | — | |
| prompt | STRING | Hello! | — |
| systemopt | STRING | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |