ComfyUI Node

Get Secret

Stop pasting API keys into your workflow — Get Secret keeps them out of the JSON

By S0yKaf·Created 7 months ago·Updated 7 months ago· 1
Get Secret
    • *
    Secret

    You've done it too: some API-backed node needs an OpenAI or Anthropic key, so you drop in a text widget and paste it, and suddenly your workflow JSON is a leak waiting to be shared. Get Secret is the two-minute fix - a node that stores your keys in a local file, exposes them as a dropdown, and outputs the value into your graph. The workflow you save and share only ever contains the key's name, never the key itself.

    The mechanism is simple and it's all local. This pack - ComfyUI-Secrets - keeps your secrets in secrets.json, a plain JSON file sitting right next to the node in custom_nodes/comfyui-secrets/. On first run it even seeds the file with a placeholder OPEN_AI entry, and there's a frontend panel (the Secrets Manager) for adding, editing, and deleting keys without touching the file by hand. Values are masked by default with a little 👁 toggle to peek - handy, but remember that's UI cosmetics, not encryption.

    The node itself has exactly one input and one output. The Secret input looks like a dropdown of your stored key names - that dropdown is actually injected by a tiny frontend extension, which swaps the backend's plain string widget for a combo populated from secrets.json. Pick a key and the node outputs its value as a *-typed string you can wire into any input that expects an API key or token. A beginner trap worth naming: the dropdown shows the name; the value is what flows out of the output. There's also a handy Edit Secrets button right on the node, so you never have to hunt through menus.

    Where this shines is the sharing loop. The ecosystem runs on workflow-sharing, and the usual failure modes are missing nodes and leaked keys; this node solves the second one cleanly - when you export a workflow, the only trace of your key is a dropdown selection. ComfyUI also detects when a stored value changes and re-runs the graph, so updating a key doesn't mean editing nodes everywhere.

    Installing it

    ComfyUI Manager is the easy path - search for ComfyUI-Secrets and install. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/S0yKaf/comfyui-secrets
    

    Then restart ComfyUI. There are no models, no requirements.txt, and the project declares zero dependencies - it rides on aiohttp and ComfyUI's own server, so install is genuinely painless.

    Gotchas worth knowing

    • It's plaintext, not a vault. Anyone with read access to secrets.json sees your keys. The point is keeping them out of shared workflow files, not protecting them from your own disk.
    • Delete the seeded OPEN_AI: "hello" entry on first run, or it'll squat in every dropdown.
    • The file lives inside the node folder. git pull is safe (the pack's .gitignore excludes it), but if you delete the directory to reinstall, your keys go with it. Back up secrets.json.
    • Know what you're installing. ComfyUI has no code review for custom nodes, and this is a tiny, zero-impression pack - read the source before trusting it with keys. Good news: it's about 130 lines and does nothing but read a JSON file, so the review is fast.

    It's a niche QoL node for people running API-backed LLM or image nodes who actually share their workflows. For that one job - keys out of the JSON - it's the right tool, and it costs you almost nothing to run.

    Categorysecrets/secrets

    Inputs (1)

    NameTypeDefaultDescription
    SecretSTRING

    Outputs (1)

    NameTypeDescription
    **