Unofficial Stream API Call
The same relay trick, but the answer arrives live
- image1
- image2
- image3
- image4
- image5
- response
- image
- stream_log
- api_request
- api_response
Streaming, but only if you're already in the unofficial world
UnofficialGeminiAPI talks to relay endpoints; this node does the same thing but streams. Instead of a long silence followed by the whole answer, the response arrives chunk by chunk as the model generates it, and the node keeps a running stream_log so you can watch progress. For long generations - big write-ups, structured analysis, anything that takes a while - that's a genuinely nicer experience than staring at an empty wire.
That said, be honest about the context: this is a streaming variant of an unofficial-endpoint node. If you're not already using relays, you have no reason to start here. If you are, this is the version you want for long answers.
How it works
Same dual-format engine as UnofficialGeminiAPI - api_format of OpenAI Compatible or Gemini Native, a base_url pointing at your relay, up to five image1βimage5 inputs, and the same temperature, top_p, max_tokens dials. The addition is the stream toggle (default true): responses are received incrementally, and in Gemini Native format any image returned by the relay is still extracted into the image output mid-stream.
The README's advice is worth repeating: use Gemini Native format for image-generation tasks through a relay, OpenAI Compatible for Claude/GPT-style text.
Inputs you'll set
- api_key - your relay's key, same as the non-streaming node.
- api_format / base_url / model - the relay contract; match all three to your provider.
- stream - leave on for long responses; turn off if you need the whole answer atomically.
- image1βimage5 - multimodal or image-gen inputs.
Outputs: response (the complete streamed text), image (extracted image when applicable), stream_log (the running progress log - this node's signature output), and the standard api_request / api_response pair.
Install
Identical to the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt
Or "ComfyUI Gemini Nodes" via ComfyUI Manager, restart. Needs aiohttp, which the pack's requirements already install.
Where people get burned
Every caveat from UnofficialGeminiAPI applies, plus one streaming-specific one: not all relay endpoints support streaming, even when they claim OpenAI compatibility. If you get a broken or empty response with stream on, flip it off - some relays only implement the non-streaming path and the failure is on their side, not the node's. The stream_log output is your debugging tool here; if the log shows chunks arriving but response stays empty, look at how the relay terminates the stream. And the trust warning is doubled: streaming keeps the connection open to a third party longer, and your prompts and keys are still passing through that relay. Know the provider before you paste a key into it.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | β | |
| api_key | STRING | β | |
| api_format | COMBO | OpenAI Compatible | 2 options: OpenAI Compatible, Gemini Native |
| model | STRING | claude-3-5-sonnet-20240620 | β |
| temperature | FLOAT | 0.700β1 | β |
| max_tokens | INT | 102464β8192 | β |
| base_url | STRING | https://www.chataiapi.com/v1 | β |
| stream | BOOLEAN | true | β |
| seed | INT | 00β2147483647 | β |
| system_promptopt | STRING | You are a helpful assistant. | β |
| image1opt | IMAGE | β | |
| image2opt | IMAGE | β | |
| image3opt | IMAGE | β | |
| image4opt | IMAGE | β | |
| image5opt | IMAGE | β | |
| top_popt | FLOAT | 0.950β1 | β |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| response | STRING | β |
| image | IMAGE | β |
| stream_log | STRING | β |
| api_request | STRING | β |
| api_response | STRING | β |