🔑 API Key 管理器
The one node that saves you from pasting keys into every Grsai node
This is the "please don't make me paste my key into 14 nodes" answer. Every other node in the ComfyUI-nkxx pack - the Nano Banana ones, the Grok video ones, the Midjourney clones - reads its API key from a node field first, then falls back to an environment variable or the pack's config. The ApiKeyManager exists to make that first step painless: you store up to ten named keys in one pretty panel, and they're available wherever the pack needs them. If you've got one Grsai key and one Wujiai key, this is genuinely all you need to run the whole pack.
The name is slightly misleading, by the way. It doesn't call any API and it holds no secrets of its own - it's a frontend-only widget node that shoves what you type into hidden widget slots on itself. The runtime magic lives in the pack's get_api_key() helper, which checks, in order: the key typed directly into a node, then the GRSAI_KEY / WUJIAI_KEY environment variables, then whatever's hardcoded in __init__.py. So the manager is a convenience, not a vault. Don't treat it as secure storage - treat it as a nicer clipboard.
The inputs that matter
The only visible widget is active_count (an INT, 1–10), which controls how many key/name rows show up. Beneath it live ten pairs of hidden nameN / api_keyN string fields - when you type a label and key into the panel, they land in those slots. That's the whole schema, and that's the whole node.
The practical usage: give each key a name you'll recognize (e.g. "grsai main", "wujiai backup"), paste the key beside it, and crank active_count to however many you actually have. Save the workflow and your keys travel with it - which is exactly why you should think twice before sharing workflow files that contain this node.
Install & first run
Install is the pack's install. ComfyUI Manager: search "ComfyUI-nkxx". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx
Then restart ComfyUI. First launch auto-installs requests, pandas, openpyxl, yt-dlp, opencv-python, and aiohttp if they're missing - if that silently fails you'll see import errors and should pip install them manually. There are no model downloads and no heavy dependencies; this pack doesn't run a single model locally, it phones home to the Grsai/Wujiai reseller APIs.
Common issues
- Keys not applying: the node is pure UI, so if you paste a key here and a downstream node still says "未配置 Grsai API Key" (API key not configured), you almost certainly have it typed in the wrong channel's node, or the workflow was saved before you hit anything. Keys are read at execution time, not stored globally.
- The panel looks empty after loading a workflow: the DOM widget re-renders on load; give it a beat. It's the classic frontend-widget quirk, and the pack has shipped several fixes for exactly this.
- Security posture: this is an API-wrapper pack from a single author, and the Wujiai-side node files ship as obfuscated (base64+zlib) blobs - you literally cannot read what they do from source. That's a real trust decision to make, not something to shrug past; the KB's history with credential-carrying node packs is why the "read before you run" advice exists. If you're cautious, keep keys out of shared workflows and use environment variables instead.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| active_count | INT | 11–10 | — |
| name1opt | STRING | — | |
| api_key1opt | STRING | — | |
| name2opt | STRING | — | |
| api_key2opt | STRING | — | |
| name3opt | STRING | — | |
| api_key3opt | STRING | — | |
| name4opt | STRING | — | |
| api_key4opt | STRING | — | |
| name5opt | STRING | — | |
| api_key5opt | STRING | — | |
| name6opt | STRING | — | |
| api_key6opt | STRING | — | |
| name7opt | STRING | — | |
| api_key7opt | STRING | — | |
| name8opt | STRING | — | |
| api_key8opt | STRING | — | |
| name9opt | STRING | — | |
| api_key9opt | STRING | — | |
| name10opt | STRING | — | |
| api_key10opt | STRING | — |
Outputs (0)
No outputs