Gemini 3.7 Flash (openai)
A Gemini that answers in OpenAI's dialect, wired into your graph
- text
- raw_json
- credits_consumed
- usage_json
- credits_left
A chat model sitting in your Comfy graph is the least glamorous node you'll install and one of the most useful. This one is a specific Gemini build, reached through KIE.ai's marketplace, and it's the variant exposed over an OpenAI-compatible endpoint - which is the whole reason the "(openai)" is in the name.
What it is, and when you'd grab it
The pattern this fits is prompt enhancement and structured rewriting: you have a rough idea, or a caption, or a pile of tags, and you want a language model to turn it into the thing your sampler wants. The KB's read on this is blunt - for that job you want small and obedient, not large and clever, because a reasoner leaks its scratch-work into your prompt.
So why 3.7 Flash, and why the openai flavour? It's the middling generation of the Flash line - cheaper and quicker than the Pro card, newer than plain 3 Flash, a sensible default when a rewrite doesn't justify Pro rates. And KIE publishes this one on an OpenAI-compatible chat-completions route, so a tool or function schema you already wrote against OpenAI's shape pastes in unchanged.
KIE.ai is a third-party marketplace reselling closed models, and the draw is price. People building Comfy nodes against it have publicly compared rates with Comfy's own API nodes - one such post put Nano Banana Pro near $0.09/image at 1–2K through KIE versus about $0.15 first-party. That spread is why a pack like this exists.
The inputs that matter
Only one field is required: prompt. That's your message, and it's the multiline box the node opens with.
Everything else is optional, and three of them earn their place:
- system_prompt - the instruction layer. If you want the model to answer with only a prompt paragraph and no preamble, this is where you say so.
- history_json - an array of prior messages. There's no conversation state on the node, so a multi-turn exchange means you carry the prior turns forward yourself in this field.
- tools_json - function/tool definitions the endpoint supports. KIE's own docs for this page use the classic
get_current_weather/get_stock_priceexamples, which tells you it's a real function-calling surface rather than decoration.
There's also stream (off by default) and expert_override_json, which is a raw payload patch for the case where you know a field the card doesn't expose. Leave it at {} unless you're debugging.
One thing to know before you plan around it: there is no image input on the Gemini cards in this pack. If your job is "look at this picture and describe it," that's a different node family - these are text-in, text-out.
Outputs and wiring
text is the one you wire. It's a plain STRING, so it goes into a CLIP text encode, a prompt field on another node, or a text saver. If you're chaining into something that wants JSON, ask for JSON in the system prompt and parse it downstream.
raw_json is the full provider response - the place you look when the text output is empty or wrapped in something odd. usage_json carries the token accounting. credits_consumed and credits_left are floats, and after every successful run the node also draws a "credits spent / credits left" receipt on itself.
Install
Grab the pack through ComfyUI Manager by searching its title, or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
Restart ComfyUI. Dependencies are four ordinary Python packages - requests, Pillow, numpy, PyYAML. No weights, nothing local; every call is a paid request to KIE.
Then set your key once: Settings → KIE.ai Nodes Next → Connection, paste it into Paste / replace KIE.ai API key. It's validated against KIE before it's saved, and you'll get a masked fingerprint (like ••••••••A1B2) plus a CONNECTED status rather than a silent write. On a headless box, the KIE_API_KEY environment variable takes priority over the saved key.
Where people get burned
- No key, no node. Every run is a live API call. The key lives outside your workflow JSON, which is the right call - but it also means sharing a workflow doesn't share the credentials.
- The node library is built from KIE's docs, not shipped fixed. At startup the pack reads KIE's API documentation index and builds a node per callable model, checking for changes about once a day. Model lines churn fast on a reseller - a public thread from earlier this year had someone's build breaking because a model had quietly vanished from the KIE catalogue. If a card stops working, refresh the catalog before you rewrite the workflow.
- Preamble in your prompt. Ask for a prompt and you'll get "Sure, here's an enhanced version:" as literal tokens. Pin the format in the system prompt.
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 | — |