Nodes/ComfyUI-YogurtNodes/Provider: OpenAI Compatible
ComfyUI Node

Provider: OpenAI Compatible

Point ComfyUI at Ollama, LM Studio, or Any Relay

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

    This is the most useful node in the pack's provider set, and it's the one that makes the local-LLM story work. Give it any OpenAI-shaped endpoint - localhost:11434 for Ollama, LM Studio, LocalAI, llama.cpp's server, Azure, a paid relay, your own gateway - and it becomes a provider you can wire into the chat and image nodes.

    The reason that matters: prompt enhancement and captioning don't need a frontier API. They need a model that follows a format and stops, running uncensored and free per call. That's the local path's whole argument, and it's the same argument that put Ollama in nearly 500 threads across the first half of 2026.

    Fields

    Four, and two of them are required in practice:

    • base_url - the endpoint including the version path. http://127.0.0.1:11434/v1 for Ollama, http://127.0.0.1:1234/v1 for LM Studio by default. No trailing guessing here; the node doesn't append anything.
    • api_key - and here's the bit worth reading twice: this provider declares no api_key.json entry and no environment variable, so a blank field is an error. That's deliberate - the pack's own comment says compatible channels never receive your official keys, which stops a casual relay from harvesting the openai key sitting in your config. Local servers mostly ignore the key anyway; type ollama and move on.
    • proxy_url - optional. Irrelevant for localhost; relevant for a remote gateway.
    • timeout - seconds, 0 = no limit. Local models can be slow to first token on a cold load; the default is fine.

    Output: a provider socket.

    What you can wire it into

    Chat (Custom Model) is the natural pairing, with the model ID typed in as your local model's name - llama3.1:8b, qwen2.5-vl:7b, whatever ollama list says. That combination is prompt rewriting, captioning, and vision work with zero per-call cost.

    Image Generation (Custom Model) also works if your endpoint serves an images API. Most local LLM servers don't; don't expect it.

    The named family nodes are the subtle case. This provider's route key is openai, so GPT Chat and GPT Image will happily connect - but they'll then send OpenAI's model IDs to your local server, which naturally won't have them. That's what the Custom model entry in every model dropdown is for. Use the named nodes with an OpenAI-compatible provider only when the endpoint genuinely mirrors OpenAI's model names.

    Install and wire

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

    Manager's fine too - search "YogurtNodes"; on the canvas it's "Provider: OpenAI Compatible (Yogurt Nodes)".

    Then, for a local setup:

    1. Run your server (ollama serve, or LM Studio's local server) and confirm it answers on its own.
    2. Drop the provider node, set base_url to the /v1 endpoint, put anything in api_key.
    3. Wire provider into a Chat (Custom Model) node and type the exact model name your server reports.
    curl http://127.0.0.1:11434/v1/models
    

    That one command saves more time than any troubleshooting list - if ComfyUI can't see the model, curl will show you the real names.

    Fastest ways to waste an evening

    Forgetting the provider wire. The custom-model nodes default to official OpenAI. Your local-model test then hits OpenAI, and you find out via billing. Wire the socket.

    Missing /v1. Some servers serve on a bare host with no version path, some require it. The tooltip on the base URL field says it plainly: include the version path.

    Model ID mismatch. Ollama wants llama3.1:8b with the tag; LM Studio may want the full identifier from its own list. Nothing in the pack validates this, so a typo comes back as a server error quoting your string.

    VRAM budgeting. If your local LLM shares the card with your diffusion model, you now have two models resident. This is the standing complaint about the pattern, and the reason the good prompt-enhancer nodes unload and reload between models rather than holding both. Check your headroom before you blame the node.

    Assuming it's offline. It is - until you point base_url at a remote gateway and it isn't. The node doesn't know or care, which is the point.

    CategoryYogurtNodes/LLM/Providers

    Inputs (4)

    NameTypeDefaultDescription
    base_urlSTRINGBase URL including the version path, e.g. https://example.com/v1.
    api_keySTRINGAPI key for this endpoint (required; official keys are never sent here).
    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—