ComfyUI Node

API Config

One API key, three providers, any OpenAI-compatible endpoint

By Moeblack·Created 9 months ago·Updated 7 months ago· 8
API Config
    • config
    provideropenai
    api_key
    model
    base_url

    Every chat node in this pack - Chat, Chat with Image, Chat NoASS, both Gemini image nodes - is dumb by design. It holds no API key, knows no model names, and has no idea where the API lives. All of that lives in exactly one place: API Config. You make one of these, point it at a provider, and every other SimpleChat node just takes its config output and does what it's told. It's the keychain for the whole pack.

    The four fields

    • provider - openai, claude, or gemini. This picks the default base URL, the auth header style, and the request format. OpenAI also means "anything OpenAI-compatible," which is how you reach local models.
    • api_key - your secret key: sk-... for OpenAI, sk-ant-... for Claude, or a Google AI Studio key for Gemini.
    • model - type it, or hit Refresh Models and the node fetches the actual list your key can use from the provider's /models endpoint. No hardcoded lists, no stale names.
    • base_url - leave empty and it uses the built-in official endpoints (https://api.openai.com/v1, ...anthropic.com/v1, ...generativelanguage.googleapis.com/v1beta). Fill it in for proxies and self-hosted setups, and include the /v1 - e.g. https://api.deepseek.com/v1 or http://127.0.0.1:1234/v1 for a local server.

    Output is a single config port (SIMPLECHAT_CONFIG) that fans out to every node that needs it. The model-fetching is a real feature, not a fake: a backend route (/models via aiohttp) does the request with your key, and the frontend swaps the model field from a plain text box into a dropdown. If the provider's /models call fails, it falls back to a small predefined list per provider.

    Running local models

    Yes, that's a supported use case and it's the reason "openai" is the recommended provider for local. Pick openai, set base_url to your local server (http://127.0.0.1:1234/v1 is the classic LM Studio shape), hit Refresh, and your local model list appears. Works with anything that speaks the OpenAI protocol - LM Studio, Ollama, vLLM, OneAPI proxies.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/Moeblack/ComfyUI-SimpleChat
    

    Restart, or use Manager and search "ComfyUI-SimpleChat". Only dependency: aiohttp. No models to download - the entire pack is thin-client for whatever API you point it at.

    Gotchas

    Read this twice: the API key is a widget value, so it's saved in your workflow file. Save this workflow as JSON or render an image with it and your key rides along in the metadata. Before you share any workflow from this pack, delete the key from the config node. People have scraped plenty of keys out of "here's my workflow" posts this way. Also: if the model dropdown comes up empty, it's almost always a wrong key, a blocked network, or a proxy that needs a full path including /v1 - not a bug. And note the key is also visible in plain text in the node UI; that's inherent to how ComfyUI widgets work, so keep it out of screenshots too.

    CategorySimpleChat

    Inputs (4)

    NameTypeDefaultDescription
    providerCOMBOopenaiSelect the LLM provider
    api_keySTRINGYour API key for the selected provider
    modelSTRINGSelect a model. Use the Refresh button to fetch available models.
    base_urloptSTRINGCustom API base URL (for proxies or self-hosted deployments)

    Outputs (1)

    NameTypeDescription
    configSIMPLECHAT_CONFIG