Nodes/ComfyUI-YogurtNodes/Provider: OpenAI
ComfyUI Node

Provider: OpenAI

What the Blank Key Field Actually Does

By yogurt7771·Created 2 years ago·Updated 6 days ago· 3
Provider: OpenAI
    • provider
    ◄api_key►
    ◄proxy_url►
    ◄timeout0►

    Small node, one non-obvious behaviour. The OpenAI provider is the official-API channel for the pack's OpenAI-family nodes - GPT Chat, GPT Image, and the two custom-model nodes all fall back to it when no provider is wired. So you can run those nodes without ever touching this one.

    Connect it anyway if you want the endpoint visible in the graph, a proxy, or your key typed in explicitly. It's three fields:

    • api_key - blank means fall back to openai in api_key.json, then OPENAI_API_KEY. Both empty is a clear error naming the two sources, not a cryptic 401.
    • proxy_url - optional, http://127.0.0.1:7890 or socks5://127.0.0.1:1080.
    • timeout - seconds, 0 means no limit. Image generation through GPT Image regularly runs past a minute; leave it alone.

    Output: a single provider socket.

    The blank-base-URL thing

    Notice what isn't here: a base_url field. Yet the pack's config does honour one, from the same JSON file:

    { "openai": "sk-...", "openai_base_url": "https://api.openai.com/v1" }
    

    OPENAI_BASE_URL works as an environment variable too. So the official provider can be quietly redirected to Azure, a corporate gateway, or a local server, without any visible sign in the workflow. Handy. Also a footgun - six months later nobody remembers why the "OpenAI" node is hitting a private host.

    Rule of thumb: if you're deliberately going somewhere other than OpenAI, use Provider: OpenAI Compatible. It makes the destination explicit, and it refuses to fall back to official keys, which is the correct behaviour for a third-party endpoint. Use this node for the official API and leave its base URL alone.

    Why you might prefer the explicit node

    Proxy. Same key, different network path. Common in places where the API needs help.

    Key visibility. You can see which key is being used rather than inferring it from a file three directories deep. On a machine where several workflows run against different accounts, that's worth one extra box.

    Swap-testing. Wire this, then wire OpenAI Compatible pointing at a local box, and you can A/B the two on the same prompt by moving one link. That's the provider system earning its place.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
    cd ComfyUI-YogurtNodes
    pip install -r requirements.txt
    

    openai is in requirements.txt - but note the file ships five packages and not opencv-python, which the README and pyproject.toml both list. That omission only affects the pack's Poisson Blend image node, not anything on this page, but if something else in the pack throws an OpenCV import error, that's why.

    Key file lives at custom_nodes/ComfyUI-YogurtNodes/yogurt_nodes/llm/api_key.json. Anything you can read in this pack's config you should also remember to keep out of shared workflows - keys pasted into widgets get saved into the workflow JSON and posted to Civitai in screenshots every day.

    Expectations to set

    The fallback means accidental spend. Any of the four OpenAI-family nodes with an empty provider socket bills OpenAI. People testing a local endpoint and forgetting the wire have discovered this the interesting way. Wire deliberately; if you're not using OpenAI, connect something else.

    retry_count costs money. It's on the model nodes, it defaults to 1, and every attempt is a billed call. While you're characterising an endpoint, leave it at 1 so you see the real failure once.

    Filters are the model's. The provider node passes a request; it doesn't negotiate content policy. the KB's external-api-nodes.md is the honest summary of the trade: you pay per call, your inputs leave the machine, and the filter comes with the model. If that's the wall you hit, the fix is a different model, not a different provider.

    CategoryYogurtNodes/LLM/Providers

    Inputs (3)

    NameTypeDefaultDescription
    api_keySTRINGLeave empty to use 'openai' from api_key.json, then the OPENAI_API_KEY environment variable.
    proxy_urlSTRINGProxy URL, e.g. http://127.0.0.1:7890 or socks5://127.0.0.1:1080.
    timeoutINT00–3600Request timeout in seconds; 0 means no limit.

    Outputs (1)

    NameTypeDescription
    providerYOGURT_LLM_PROVIDER—