Nodes/Tenos_LLM_Image_Describe/Tenosai API Key Input
ComfyUI Node

Tenosai API Key Input

The 10-line node that keeps your API key out of the JSON file

By Tenos-ai·Created about a year ago·Updated about a year ago· 1
Tenosai API Key Input
    • api_key
    api_key_string

    Let's be honest about what this node is: it does almost nothing. One string goes in, one string comes out. If that sounds pointless, you haven't hit the specific ComfyUI annoyance it solves yet.

    What it's for

    Tenosai API Key Input exists because the main node in this pack, TenosaiLLMImageDescribe, takes an optional override_api_key input that is marked forceInput. In ComfyUI that means you can't type a value into a widget on the node - you have to wire a string in from somewhere else in the graph. You could build that string with any text node, but this one is right there in the same pack, costs nothing, and its single job is done properly.

    You type your key once into api_key_string, and the node passes it out as api_key - after stripping any leading or trailing whitespace, which is genuinely useful, because you will paste a key with a stray newline at least once and wonder why the API says it's invalid.

    How it works

    That's the whole mechanism, by the way. api_key_string in, api_key out, .strip() in the middle. There's no validation, no provider detection, no persistence. It doesn't check that the key works, doesn't match it against a provider, doesn't write it anywhere. If the key is wrong, you'll find out downstream when the actual API call fails with an auth error.

    Where you'd use it

    The natural wiring is a dead simple one: Tenosai API Key Input's api_key output → override_api_key on the TenosaiLLMImageDescribe node. That saves you from editing api_keys.json (the pack's default config file ships with literal "key" placeholders, so you are editing that file otherwise). It's also the path if you've got a second account - a spare Gemini key, or a friend's OpenAI key you're allowed to borrow - and want to hot-swap per node without restarting ComfyUI.

    Install

    Same pack as the big node, so the install is identical:

    cd ComfyUI/custom_nodes && git clone https://github.com/Tenos-ai/Tenos-LLM-Image-Describe
    

    then restart ComfyUI. Or just search Tenos-LLM-Image-Describe in ComfyUI Manager and let it handle the requests, openai, google-generativeai, and groq dependencies. No models download - everything in this pack talks to cloud APIs.

    Gotchas

    • It won't save you from a typo. Garbage in, garbage out, and the failure shows up as an auth error on the other side of a network call, which is the slow way to find out.
    • Whitespace is the one thing it fixes. Since it strips both ends, a trailing newline from copying off a dashboard won't bite you.
    • It doesn't replace api_keys.json entirely - it only feeds the override_api_key input. The dropdown's key lookup still goes through the JSON file, so keep that file valid anyway.

    If you only ever run one key, you can skip this node entirely and edit api_keys.json once. It exists for the people juggling accounts and for the workflows where someone else's node expects a wired key input. For that, it's exactly the right kind of boring.

    Categoryutilities/TenosaiLLM

    Inputs (1)

    NameTypeDefaultDescription
    api_key_stringSTRING

    Outputs (1)

    NameTypeDescription
    api_keySTRING