๐พ Gemini Chat API ๐
OmixGeminiPro is cheap โ but the install bites exactly once
- last_reply
- chat_history
If you want a cloud LLM inside ComfyUI but OpenAI's pricing irritates you, OmixGeminiPro ("๐พ Gemini Chat API ๐") is the Google-flavored entry in OmiXDev's chat trio. The default model is gemini-2.5-flash-lite, which is fast, cheap, and has a usable free tier - a fine engine for the "draft me a detailed prompt for this character and composition" job. Same basic shape as the OpenAI node: key in, message in, reply out.
How it works
The node uses Google's google.generativeai SDK: it configures with your key, spins up a GenerativeModel, and - the nice bit - actually respects send_history. When it's on, the ๐ค/๐ค log is rebuilt as user/model turns and passed to start_chat(history=...), so it holds a real conversation rather than the stateless single calls the OpenAI node makes.
One validation quirk to know: the node checks that your key starts with "AI". Gemini keys look like AIzaSy..., so that's usually fine - but if it doesn't match you get "โ Invalid or missing Gemini API Key." instead of a call.
The inputs and outputs that matter
api_key- yourAIzaSy...key from aistudio.google.com. Same caveat as ever: it's saved in the workflow JSON, so don't hand out workflows with the key inside.user_message- the instruction or prompt draft, multiline.model- a hardcoded dropdown of just two:gemini-2.5-flash-lite(default) andgemini-exp-1206.
reset clears the in-session history. Outputs are last_reply and chat_history, both STRING - the second is the newline-joined log with ๐ค/๐ค markers, handy for display or saving.
Installing - the one trap
Install the pack normally (Manager: search OmiXdev Custom Nodes, or the clone steps below), then install the requirements:
cd ComfyUI/custom_nodes
git clone https://github.com/omixmaxdimo/OmiXDev.git
cd OmiXDev
pip install -r requirements.txt
And here's where it bites: the pack's requirements.txt lists google-genai, but the node's code imports google.generativeai. Those are two different packages - google-genai ships the google.genai module, not the one this node needs. A fresh install can load everything fine, then throw ModuleNotFoundError: No module named 'google.generativeai' the first time the node is imported. If you see that:
pip install google-generativeai
then restart. Ten-second fix, just annoying it's not in the requirements file.
Troubleshooting
- The stale model.
gemini-exp-1206was an experimental 2024 release, and Google retires experimental models. If you pick it and get a model-not-found error, that's why - stick withgemini-2.5-flash-lite. - Shared history again. Like the rest of the pack,
chat_historyis class-level, so all your OmixGeminiPro instances share one log per session and it clears on restart. Hitresetif threads start bleeding together. - Errors are silent strings. Exceptions are caught and returned as
last_replywith a โ prefix. Keep a text preview on the output so a failed call doesn't invisibly feed your prompt encoder.
Pick this one when you want Google's cheap flash model doing your prompt drafting. The install hiccup is a one-time annoyance; after that it just works.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | ๐ AIzaSy... | โ |
| user_message | STRING | Hello Gemini ๐ | โ |
| model | COMBO | gemini-2.5-flash-lite | 2 options: gemini-2.5-flash-lite, gemini-exp-1206 |
| resetopt | BOOLEAN | false | โ |
| send_historyopt | BOOLEAN | true | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| last_reply | STRING | โ |
| chat_history | STRING | โ |