Nodes/comfyui-mixlab-nodes/API Key Input ♾️Mixlab
ComfyUI Node Runs on cloud

API Key Input ♾️Mixlab

Keep your LLM key out of the saved workflow

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
API Key Input ♾️Mixlab
  • key
  • key

Here's a mistake that's bitten plenty of people: you paste your OpenAI (or fal, or whatever) API key straight into an LLM node's text field, build a nice workflow, and then share the PNG or the JSON with a friend - and your key rides along embedded in the workflow metadata. ComfyUI stashes the whole graph, including that field, into the file. API Key Input (class KeyInput) exists to stop that. It's a dedicated key-holder node with a purpose-built widget, so your credentials live in a slot designed to keep them out of the shared graph rather than sitting in a plain visible text box.

shadowcz007 added it as the mixlab pack's LLM tooling matured - the README frames it as managing the key for LLM nodes and prepping the pack for an "agent mode." Once you've got several nodes that all need the same key (a chat node, an image-to-text node, a prompt-completion node), a single key source you wire to all of them beats retyping it into each field. That's the practical win beyond the safety one: one place to set it, one place to change it.

How it works

It takes your key through a special KEY widget - a password-style input rather than an ordinary string field - and emits it as a plain STRING that the consuming LLM nodes accept in their key slot. So the key enters the graph through a control designed to treat it as a secret, and flows out to wherever it's needed as a normal string connection.

The inputs and outputs that matter

There's really just the one thing to set:

  • key (KEY) - your API key, entered via the pack's dedicated key widget rather than a normal text box.
  • Output key (STRING) - wire this into the api_key/key input of the mixlab LLM nodes (ChatGPT/OpenAI, Siliconflow, the fal video nodes, etc.).

That's the whole node. Its value is in where the key lives, not in any processing.

How to install it

Via ComfyUI Manager: search comfyui-mixlab-nodes, install, restart. Or clone the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git

then pip install -r requirements.txt (or install.bat on the Windows portable build) and restart. No downloads needed.

Common issues & troubleshooting

Don't treat it as bulletproof secret management. Be clear-eyed: this is a convenience-and-hygiene node, not a vault. It keeps the key out of the obvious visible text field and out of casual sharing, but a custom node is arbitrary Python and the key is still handled in your ComfyUI process. Use it to avoid accidentally leaking a key into a shared workflow - don't use it as a reason to trust an untrusted node with a live key.

The downstream LLM node still says "no key." Make sure you actually wired the STRING output into that node's key input rather than leaving the node's own key field blank-but-unconnected. Some LLM nodes read their inline field or the connection - connect it explicitly and clear the inline field to avoid ambiguity.

Auth still fails with the key connected. Then it's the key itself or the account: wrong key for the service, revoked, or out of credit. This node just carries the string; it can't fix a bad credential. Verify the key works against the provider directly.

I shared my workflow - is the key gone? Rotate any key that's ever been pasted into a plain node field before you started using this one. This node protects keys going forward; it can't scrub one that was already embedded in a file you sent out.

Category♾️Mixlab/Input

Inputs (1)

NameTypeDefaultDescription
keyKEY

Outputs (1)

NameTypeDescription
keySTRING