ComfyUI Node
OpenAI Compatible Chat
OpenAI Compatible Chat Node - Works with any OpenAI-compatible API endpoint
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)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text inputs to the model, used to generate a response. | |
| api_url | STRING | http://127.0.0.1:8000/api/v1/chat/completions | OpenAI-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) |
| model | STRING | gpt-4o-mini | Model name to use (e.g., gpt-4o-mini, llama3.2, etc.) |
| api_key | STRING | API key for authentication (leave empty if not required) | |
| persist_context | BOOLEAN | true | Persist chat context between calls (multi-turn conversation) |
| imagesopt | IMAGE | Optional image(s) to use as context for the model. To include multiple images, you can use the Batch Images node. | |
| filesopt | OPENAI_INPUT_FILES | Optional file(s) to use as context for the model. Accepts inputs from the OpenAI Chat Input Files node. | |
| advanced_optionsopt | OPENAI_CHAT_CONFIG | Optional configuration for the model. Accepts inputs from the OpenAI Chat Advanced Options node. | |
| max_tokensopt | INT | 10001–100000 | Maximum number of tokens to generate |
| temperatureopt | FLOAT | 0.70–2 | Controls randomness in the response (0.0 = deterministic, 2.0 = very random) |
| top_popt | FLOAT | 1.000–1 | Controls diversity via nucleus sampling (0.0 = only most likely tokens, 1.0 = all tokens) |
| system_messageopt | STRING | Optional system message to set the behavior of the assistant |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |