Nodes/ComfyUI Ino Nodes/Ino Openai Chat Completions
ComfyUI Node

Ino Openai Chat Completions

Chat with any OpenAI-compatible API from inside the graph — vLLM, RunPod, Modal included

By nobandegani·Created about a year ago·Updated 2 months ago· 6
Ino Openai Chat Completions
    • success
    • response
    • finish_reason
    • error
    • reasoning
    • tool_calls
    • prompt_tokens
    • completion_tokens
    • total_tokens
    enabledtrue
    user_prompt
    openai_api_key
    base_urlhttps://api.openai.com/v1
    modelgpt-5
    system_prompt
    image_url
    temperature0.7
    max_tokens1024
    top_p1.00
    enable_thinkingtrue

    Want an LLM to write your prompts, judge your outputs, or decide the next step in a workflow - mid-graph? This is the node. InoOpenaiChatCompletions sends a chat completion request to any OpenAI-compatible endpoint and returns the response as a string you can wire straight into a text encoder or a switch. The "any compatible endpoint" part is the key feature: base_url defaults to OpenAI but you can point it at vLLM, RunPod, Modal, or any local server speaking the OpenAI protocol. That's rarer than it sounds, and it's what makes this node useful beyond "call ChatGPT."

    It needs a real API key (pasted in openai_api_key or set as an env var), so it's not a local-generation node - but it fits a genuinely common pattern in this ecosystem: cloud GPU users already juggle RunPod and S3, and routing one string through an LLM for prompt work is trivial by comparison.

    How it works

    Required: enabled and user_prompt. Optional but worth knowing:

    • openai_api_key - if left empty, the node falls back to the OPENAI_TOKEN env var. Same for base_urlOPENAI_URL, and modelOPENAI_MODEL.
    • model - defaults to gpt-5; set it to whatever your endpoint serves.
    • system_prompt - the system role message.
    • image_url - pass an image URL to make it a vision call.
    • temperature, max_tokens, top_p - the usual sampling knobs.
    • enable_thinking - the one with a tooltip: "Qwen3-style thinking phase toggle for vLLM. Ignored by OpenAI-only servers." So if your vLLM serves a Qwen3-style model with a thinking phase, this toggles it; on plain OpenAI it's a no-op.

    Outputs are the useful tail: response (the reply text), finish_reason, error (empty on success), reasoning (if the model returns a reasoning trace), tool_calls (serialized, if any), plus prompt_tokens, completion_tokens, total_tokens for cost tracking - and success.

    Installing it

    Part of the 125+-node ComfyUI-InoNodes pack by nobandegani:

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

    Or search "ComfyUI Ino Nodes" in ComfyUI Manager and restart. The pack's openai dependency is what this node needs. V3 schema - keep ComfyUI current.

    Common issues

    Key handling trips most people: the node tries openai_api_key first, then OPENAI_TOKEN. If neither is set, you get an auth error in error. Don't commit real keys into shared workflow JSONs - env vars are the safer habit here. Also note the model string must be served by your endpoint: gpt-5 is only valid against OpenAI. If your vLLM server rejects the request, the error output will tell you - and that's the nice part, it fails soft with success: False rather than killing the run. Start with enable_thinking off if you're on OpenAI; the tooltip says it's ignored there, but testing costs you one token.

    CategoryInoOpenaiHelper

    Inputs (11)

    NameTypeDefaultDescription
    enabledBOOLEANtrue
    user_promptSTRING
    openai_api_keyoptSTRING
    base_urloptSTRINGhttps://api.openai.com/v1
    modeloptSTRINGgpt-5
    system_promptoptSTRING
    image_urloptSTRING
    temperatureoptFLOAT0.70–2
    max_tokensoptINT10241–128000
    top_poptFLOAT1.000–1
    enable_thinkingoptBOOLEANtrueQwen3-style thinking phase toggle for vLLM. Ignored by OpenAI-only servers.

    Outputs (9)

    NameTypeDescription
    successBOOLEAN
    responseSTRING
    finish_reasonSTRING
    errorSTRING
    reasoningSTRING
    tool_callsSTRING
    prompt_tokensINT
    completion_tokensINT
    total_tokensINT