Nodes/ComfyUI_Burve_Tools/Burve Debug Gemini Key
ComfyUI Node

Burve Debug Gemini Key

Your Gemini key 'isn't working'? This node shows you what ComfyUI actually sees

By Burve·Created 9 months ago·Updated 6 days ago· 5
Burve Debug Gemini Key
    • info

    If Burve Google Image Gen insists your API key is missing, this is the node to run before you do anything else. It takes zero inputs, reads the GEMINI_API_KEY environment variable exactly as ComfyUI sees it, and tells you the truth: set, not set, or set-but-invisible.

    The frustrating thing about "API key not working" with the AI Studio node is that nine times out of ten, the key is fine and the environment isn't. ComfyUI reads the variable from its own process, and its process inherited its environment from whatever launched it. GUI apps launched from Finder, Launchpad, or the Start menu often don't inherit your shell profile - so you exported the key in a terminal, ComfyUI never saw it, and no amount of re-typing the key into the node (which has no key field anyway) will help. This node exists to make that invisible problem visible.

    How it works

    It's an output node with no inputs that forces itself to re-run every time (via an always-changed marker, so ComfyUI's caching never skips it). On execution it checks os.getenv("GEMINI_API_KEY"), trims whitespace, and reports:

    • If missing: GEMINI_API_KEY is NOT set or is empty inside ComfyUI.
    • If present: the key's length plus its first four and last four characters - enough to confirm which key you're looking at, without ever printing the full secret.

    The result goes to the info output and gets echoed to the ComfyUI terminal, where it's formatted in a box so you can't miss it. Run it, read the info string (wire it into a text display node if you want it on the canvas).

    Inputs and outputs

    • No inputs.
    • info - a STRING status message. This node is marked as a workflow output, so it'll show in the output area too.

    The fix, when it reports "NOT set"

    Follow the launch method, not just the export. The README spells out the three cases:

    • Windows - setx GEMINI_API_KEY "your-key" in PowerShell, then close the terminal and fully restart ComfyUI. setx only affects future processes.
    • macOS standalone app - launchctl setenv GEMINI_API_KEY "your-key", verify with launchctl getenv GEMINI_API_KEY, then fully quit and relaunch the app. Shell profiles don't reliably reach GUI-launched apps.
    • Linux / macOS from terminal - add export GEMINI_API_KEY="your-key" to your shell rc, reload, and start ComfyUI from that same shell.

    Also check for a stray newline or space in the value - the node strips whitespace, but a key pasted with a trailing newline is a classic silent failure. Install is just the pack itself (Manager or git clone https://github.com/Burve/ComfyUI_Burve_Tools.git into custom_nodes, then restart).

    CategoryBurveTools/Debug

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    infoSTRING