Gemini 3.8 Flash
The fast text worker, wired to KIE's Gemini endpoint
- text
- raw_json
- credits_consumed
- usage_json
- credits_left
What it is
A text-in, text-out LLM node that calls Gemini 3.8 Flash through KIE.ai. Same family of node as the pack's Claude and GPT entries: paste a prompt, get a STRING back, pay per call.
Flash-tier models are the pragmatic pick for the jobs an LLM does inside an image or video graph - rewriting a prompt into something a video model will understand, expanding a shot description, turning notes into JSON. You don't need Opus-grade prose for "rewrite this with concrete camera language," and you don't want its latency or its price either.
How it works
This one is worth understanding because KIE exposes Gemini in its native shape, not the OpenAI chat shape, and the adapter handles the translation. The request goes to /gemini/v1/models/gemini-3-8-flash:streamGenerateContent, and the payload is built as contents, not messages:
- Your
promptbecomes the final{"role": "user", "parts": [{"text": ...}]}entry. history_jsonentries are converted too, withassistantormodelroles normalised tomodel- and entries whose content isn't a string or a parts list are skipped rather than crashing the run.system_promptgoes intosystemInstruction.tools_jsonbecomestoolson the body.
This matters in practice: if you copy a history_json from an OpenAI-style example, the role names get normalised for you, but anything structurally exotic won't survive. Keep history to {role, content} objects.
Preflight is local and strict. Empty prompt is an error. history_json must parse to a JSON array of objects; tools_json same; expert_override_json must be a JSON object. Nothing is uploaded during that check - you find out about a stray comma for free.
Inputs and outputs
prompt is required. system_prompt is where you put the persistent rules ("return JSON only, no prose, no markdown fences") - that's the single highest-value field here. stream exists but there's no live streaming view in a graph node, so leave it off. tools_json is function definitions for tool-capable use. expert_override_json is the documented-fields escape hatch.
Note what this node doesn't have compared to the Claude node: no thinking toggle and no max_tokens widget. Gemini's thinking controls aren't surfaced on this one, so if you specifically want extended reasoning, that's the Claude node.
Outputs: text, raw_json, credits_consumed, usage_json, credits_left. Wire text into a prompt widget (convert to input) or a TTS node; watch credits_left when you're iterating.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
python -m pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
Then Settings → KIE.ai Nodes Next → Connection → Paste / replace KIE.ai API key. The key is validated against KIE before it replaces a working one, and it lives in ComfyUI's user config - the README is explicit that environment-variable keys aren't a supported path here.
Where people get burned
- Node missing entirely. This node comes from the live docs catalog, which syncs on startup and then at most once every 24 hours. If you don't see it, run KIE • Refresh Model Catalog and reload the frontend.
- "This model's endpoint has not been resolved yet." Same cause: the catalog entry exists but the endpoint hasn't been enriched. Refresh once; don't retype the model ID.
- Picking the wrong Gemini 3.8 Flash. There's a sibling node labelled Gemini 3.8 Flash (openai) hitting a chat-completions endpoint. Both are real, both work. The one you're reading about is the native-parts version.
- Assuming it filters like a local model. It doesn't - Google's policy applies, and the node can't bypass it. That's the same trade every hosted LLM in ComfyUI makes.
- Treating it as a captioner. This node takes no image input. Captioning means a vision model, usually a local one.
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 | — |