Google Gemini - Config Manager
The Config Manager node
- status
This is the least glamorous node in the pack, and the one you'll use first. Google Gemini - Config Manager saves your Gemini API key (and, optionally, a custom base_url) to a config file that every other node in the pack reads. Set it once, and you can leave the api_key fields on the analysis, generation, and editing nodes empty forever after. That's the whole job, and it does it well.
How it works
Under the hood it's not calling any API. It's a tiny file-writer. When you run it, it creates (or updates) a gemini_config.json next to the plugin folder, holding three things:
api_key- your keybase_url- which Gemini-compatible endpoint to hit (defaults to Google's ownhttps://generativelanguage.googleapis.com/v1beta)key_base_url_map- a mapping so that if you use different keys for different relays, each key remembers the endpoint that goes with it
Every image node in the pack constructs a client that reads this file when you don't supply a key at runtime. That's why "set once, forget it" actually works.
The three inputs, which is all of them
- api_key (required) - paste your key. It's stored as plaintext on disk, same as every other API node that keeps a config file, so don't share the file around.
- action (set / get / clear, default
set) -setwrites the key,getshows what's stored,clearwipes the key and resetsbase_urlto Google's default. - base_url (optional) - only matters if you're routing through a reseller or a Gemini-compatible gateway instead of Google's official endpoint. If you're using a relay, set this at the same time as the key, because the node remembers the key→endpoint pair together.
One output: status, a string like API key saved successfully (base_url: Google default) or, on get, a masked key (abc123def4...wxyz) so you can confirm what's stored without showing the whole secret in your console. You don't need to wire it anywhere unless you want to see the confirmation.
Install
Clone the pack and install its (tiny) dependencies:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/DannyTuu/Comfyui_gemini_node.git
python -m pip install -U requests pillow numpy
Then restart ComfyUI. Or just search Comfyui_gemini_node in ComfyUI Manager and let it do the same thing. There are no model downloads - this pack is pure API client, so the whole install is a few pip packages. torch is already part of ComfyUI.
Where people get burned
- "API key not provided" on the other nodes. You never ran the Config Manager, or the file ended up somewhere the node can't read. Run a
set, thengetand confirm the status text before touching the image nodes. - Key goes to the wrong place. The default
base_urlis Google's official endpoint. If you pasted a relay key but didn't set the relay'sbase_url, you'll send a third-party key to Google and get a 401. When a relay tells you to use its endpoint, set it here. - Thinking
setvalidates the key. It doesn't. This node only writes a file - the first real test of your key is the first image call, which will happily hand backError: ...if the key is wrong, expired, or out of quota.
The plaintext-on-disk bit is worth remembering: the file is gitignored and the README says not to commit it, but treat gemini_config.json like a credential, because it is one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| actionopt | COMBO | set | 3 options: set, get, clear |
| base_urlopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |