Gemini 3.1 Pro (openai)
The heavy model you call once per project
- text
- raw_json
- credits_consumed
- usage_json
- credits_left
There's a habit worth stealing from people who actually ship video: use the expensive model for the thinking and the cheap model for the typing. Gemini 3.1 Pro is the thinking end - you hand it a scene, a character sheet and a constraint list, and it hands back a shot-by-shot plan or a set of prompts that stay consistent with each other. Then a Flash node rewrites the small stuff, or you just paste the result in and stop paying.
Doing that inside the graph rather than in a browser tab is a real convenience: the plan lands in a string output you can route into a prompt widget, save to disk, or feed to a second node.
How it works
One chat call. The node builds an OpenAI-style messages array, sends it to KIE's /gemini-3.1-pro/v1/chat/completions, and parses the response down to a single text output. The (openai) suffix is about wire format, not the model: KIE exposes Gemini through an OpenAI-compatible route here, so request bodies and tool definitions look like OpenAI's.
No images, no samplers, nothing on your GPU. It's a network call with a string on each end.
Inputs
prompt - required. Put the whole brief in it. "You're planning a 6-shot sequence for a 20-second clip. Constraints: one character, one location, no cuts to faces. Output as a numbered list, one line per shot, no commentary."
system_prompt - where the role goes, and the place to kill the model's instinct to chat. Without something like "reply with the list only," you'll get a preamble, and a preamble in a prompt field is contamination.
history_json - a prior messages array, forwarded unchanged. It's how you hold a multi-turn conversation with a node that has no chat window: keep the array yourself and pass it back each run. It's also the only lever for multimodal input here, since the pack doesn't declare an image socket for the Gemini family.
tools_json - OpenAI-schema function definitions, [] when unused. KIE's docs page for these models shows the googleSearch tool entry as an example, which tells you the endpoint tolerates tool use.
stream - off by default, and turning it on doesn't give you tokens appearing live; the pack reassembles a streamed response into one string before handing it over.
expert_override_json - raw request override for anything KIE's docs didn't publish. The tooltip calls it expert-only, and it is.
Outputs
text is the payload. raw_json is the untouched provider response - the first thing to read when the output has unexpected structure. usage_json is the token report; on a Pro model that's the number to watch, because it's what your bill is made of. credits_consumed and credits_left are floats, also displayed on the node after each run.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
Restart, or use ComfyUI Manager and search "KIE.ai Nodes Next". Four dependencies, no weights: requests, Pillow, numpy, PyYAML. Then add your KIE key once under Settings → KIE.ai Nodes Next → Connection - it's validated against KIE before it replaces a working key, lives outside your workflows, and KIE_API_KEY takes priority for headless installs.
Getting value out of it
- Front-load the plan, then stop paying. One thorough Pro run that produces a reusable prompt list beats ten Pro runs nudging the same sentence. If a plan is good, save it and move to a Flash node.
- Ask for a format you can parse. Numbered lists and JSON are easy to route; flowing prose is not. If a downstream tool needs JSON, say so in the system prompt and validate before wiring it in.
- Reasoning dials aren't here. The pack exposes reasoning effort and web search on its OpenAI/Codex-style nodes, not on the Gemini family. On this node the controls are prompt, system prompt, history and tools.
- Nobody abliterates a hosted model. Whatever Google refuses, the reseller's endpoint refuses too - the filtered-model tradeoff is the price of not running it locally.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | User prompt / message. | |
| system_promptopt | STRING | — | |
| streamopt | BOOLEAN | false | — |
| tools_jsonopt | STRING | [] | Optional function/tool definitions supported by this model endpoint. |
| history_jsonopt | STRING | [] | Optional prior message/input array as JSON. |
| expert_override_jsonopt | STRING | {} | Expert-only request overrides. Normal use does not require this. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| raw_json | STRING | — |
| credits_consumed | FLOAT | — |
| usage_json | STRING | — |
| credits_left | FLOAT | — |