Gemini 3 流式生成
Streaming, with a ComfyUI-sized asterisk
- full_text
- thought_signature
- stream_chunks
Let's be clear about what "streaming" buys you in ComfyUI, because it's not what it buys you in a chat app. Gemini3StreamingGeneration calls Google's streaming endpoint - streamGenerateContent?alt=sse - so the response arrives as chunks instead of one big payload. In a browser chatbot, that means token-by-token typing. In ComfyUI, a node either has finished or it hasn't; there's no live-updating canvas text as the tokens arrive. What the node actually hands you is the whole stream, collected: the full text, the thought signature, and a JSON blob of every chunk.
So is it worth using over plain Gemini3TextGeneration? Marginally, and for a specific reason: you get stream_chunks, which the plain node can't give you. If your workflow wants the raw chunk-level data - for progress tracking, for a ticker, for measuring latency between first and last token - this is the node. If you just want an answer, the text generation node is simpler and identical in cost.
How it works
Same auth, same API-key resolution, same thinking_level / max_output_tokens / temperature / system_instruction inputs as the rest of the pack. The difference is under the hood: it hits the streaming variant of the endpoint and iterates the SSE response, accumulating text into full_text while watching for a thoughtSignature in any chunk. It also counts the chunks and serializes the whole array into stream_chunks as JSON.
Inputs and outputs that matter
prompt- the thing you want written. Default asks for an article about AI.thinking_level- high/low; defaults to high.- Optional
max_output_tokens,temperature,system_instruction.
Outputs:
full_text- the assembled response.thought_signature- the reasoning context for chaining into a later call.stream_chunks- JSON withtotal_chunksand the rawchunksarray. This is the node's whole reason to exist; wire it somewhere you can inspect or log it.
Install
Same pack, same steps. ComfyUI Manager (search "ComfyUI-Gemini-3") or:
cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/ComfyUI-Gemini-3
cd ComfyUI-Gemini-3
pip install -r requirements.txt
No models. Google AI Studio key via api_key field, config.json, or GEMINI_API_KEY.
Common issues
- "Why isn't it showing text as it types?" - because ComfyUI doesn't render intermediate node output. The streaming happens on Google's side; your graph still waits for the node to return. Expecting a live chatbot feel is the one thing this node can't deliver.
- The
stream_chunksblob gets big - every chunk is serialized with full candidate structures. For a long output that's a lot of JSON sitting in a string; only wire it where you actually need it. - No media input - unlike the text generation node, streaming here is text-only. If you need streaming plus an image, you'll have to compose elsewhere.
- Temperature stays at 1.0 - same pack-wide advice: Gemini 3 is tuned for it, and straying is how you get loops. If you were going to lower temperature for "stability," the streaming node is the wrong place to experiment.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | 写一篇关于人工智能的文章 | — |
| api_provider | COMBO | 1 options: google | |
| api_key | STRING | — | |
| model | COMBO | gemini-3-pro-preview | 1 options: gemini-3-pro-preview |
| thinking_level | COMBO | high | 2 options: high, low |
| max_output_tokensopt | INT | 819216–8192 | — |
| temperatureopt | FLOAT | 1.00–2 | — |
| system_instructionopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| full_text | STRING | — |
| thought_signature | STRING | — |
| stream_chunks | STRING | — |