Nodes/Ninode Utils/OpenAI Compatible Chat
ComfyUI Node

OpenAI Compatible Chat

OpenAI Compatible Chat Node - Works with any OpenAI-compatible API endpoint

By iGavroche·Created 10 months ago·Updated 10 months ago· 1
OpenAI Compatible Chat
  • images
  • files
  • advanced_options
  • STRING
prompt
api_urlhttp://127.0.0.1:8000/api/v1/chat/completions
modelgpt-4o-mini
api_key
persist_contexttrue
max_tokens1000
temperature0.7
top_p1.00
system_message
CategoryNinode Utils/Chat

Inputs (12)

NameTypeDefaultDescription
promptSTRINGText inputs to the model, used to generate a response.
api_urlSTRINGhttp://127.0.0.1:8000/api/v1/chat/completionsOpenAI-compatible API endpoint URL (e.g., http://127.0.0.1:8000/api/v1/chat/completions for Lemonade Server, or http://localhost:11434/v1/chat/completions for Ollama)
modelSTRINGgpt-4o-miniModel name to use (e.g., gpt-4o-mini, llama3.2, etc.)
api_keySTRINGAPI key for authentication (leave empty if not required)
persist_contextBOOLEANtruePersist chat context between calls (multi-turn conversation)
imagesoptIMAGEOptional image(s) to use as context for the model. To include multiple images, you can use the Batch Images node.
filesoptOPENAI_INPUT_FILESOptional file(s) to use as context for the model. Accepts inputs from the OpenAI Chat Input Files node.
advanced_optionsoptOPENAI_CHAT_CONFIGOptional configuration for the model. Accepts inputs from the OpenAI Chat Advanced Options node.
max_tokensoptINT10001–100000Maximum number of tokens to generate
temperatureoptFLOAT0.70–2Controls randomness in the response (0.0 = deterministic, 2.0 = very random)
top_poptFLOAT1.000–1Controls diversity via nucleus sampling (0.0 = only most likely tokens, 1.0 = all tokens)
system_messageoptSTRINGOptional system message to set the behavior of the assistant

Outputs (1)

NameTypeDescription
STRINGSTRING