Nodes/ComfyUI API Toolkit/Gemini API Key
ComfyUI Node

Gemini API Key

One node to hold your Gemini key, everywhere else just wires in

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 1
Gemini API Key
    • api_key
    api_key

    Every Gemini node in this pack wants an api_key, and there are twenty of them. Paste the same key into all twenty and it lives in twenty widget values, which means it lives in your saved workflow and shows up on your canvas. This node exists so you type the key once, wire its single api_key output into every Gemini node downstream, and never think about it again.

    Like its ElevenLabs sibling, it makes no API call - it's a pass-through with a fallback rule. Enter a key and it returns it as a STRING output. Leave the field blank and it reads the GEMINI_API_KEY environment variable. If both are empty, it raises a clear error telling you to get a key from Google AI Studio, which is where you'll actually create one. The field is masked as a password in the UI, so it doesn't sit in plaintext on the canvas.

    The one output, api_key (STRING), feeds every other Gemini node in the pack - image generation, image editing, embeddings, token counting, all of them.

    Where people get burned: the env var only counts if it's set in the environment that actually launches ComfyUI. A desktop shortcut or a service manager that doesn't source your shell rc means the variable is silently missing and the node errors. Also - worth saying clearly - a Google API key is a billing credential. Every call charges your account, and the pack is deliberately built so a call happens on every queue (IS_CHANGED). Guard the key the way you'd guard a credit card; don't share workflows that contain it.

    Installing it

    Part of the ComfyUI API Toolkit pack, which also bundles ElevenLabs and Kling. Manager: search "API Toolkit". Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
    cd ComfyUI-API-Toolkit
    pip install -r requirements.txt
    

    Restart. This node needs nothing beyond the pack loading - but the Gemini service needs google-genai>=0.8.0 from requirements.txt. Miss it and you'll see [!!] gemini disabled -- missing dependency at startup, and every Gemini node (this one included) stays out of the node list. That's the pack's graceful-fallback design, and it's easy to mistake for a broken install.

    The honest version

    Gemini's image and text models are closed - Nano Banana has no open weights, so an API node is the only way to get it inside a ComfyUI graph, and your prompts and images leave the machine and pass through Google's moderation. That's the tradeoff baked into every node this key feeds. The key node is just where you sign that deal once.

    CategoryAPI Toolkit/Gemini/Config

    Inputs (1)

    NameTypeDefaultDescription
    api_keySTRINGYour Google Gemini API key. Leave blank to use GEMINI_API_KEY environment variable.

    Outputs (1)

    NameTypeDescription
    api_keySTRING