Nodes/Comfyui_gemini_node/Google Gemini - Config Manager
ComfyUI Node

Google Gemini - Config Manager

The Config Manager node

By DannyTuu·Created 5 months ago·Updated 5 months ago· 0
Google Gemini - Config Manager
    • status
    api_key
    actionset
    base_url

    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 key
    • base_url - which Gemini-compatible endpoint to hit (defaults to Google's own https://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) - set writes the key, get shows what's stored, clear wipes the key and resets base_url to 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, then get and confirm the status text before touching the image nodes.
    • Key goes to the wrong place. The default base_url is Google's official endpoint. If you pasted a relay key but didn't set the relay's base_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 set validates 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 back Error: ... 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.

    CategoryGoogle/Gemini

    Inputs (3)

    NameTypeDefaultDescription
    api_keySTRING
    actionoptCOMBOset3 options: set, get, clear
    base_urloptSTRING

    Outputs (1)

    NameTypeDescription
    statusSTRING