ComfyUI Node
OpenAI Chat Completion
A ComfyUI node in OpenAI with 14 inputs and 1 output.
OpenAI Chat Completion
- client
- images
- STRING
◄system_prompt—►
◄user_prompt—►
◄model▾►
◄seed-1►
◄temperature1.00►
◄top_p1.00►
◄top_k—►
◄min_p—►
◄max_tokens1000►
◄frequency_penalty0.00►
◄presence_penalty0.00►
◄extra_parameters►
CategoryOpenAI
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| client | OPENAI_CLIENT | The OpenAI client to use for the request. | |
| system_prompt | STRING | The system prompt to set the context for the model. | |
| user_prompt | STRING | The user prompt to generate a response for. | |
| model | COMBO | The model used to generate the response. | |
| seed | INT | -1-9223372036854776000–9223372036854776000 | If specified, our system will make a best effort to sample deterministically. Use -1 for random (default behavior). |
| imagesopt | IMAGE | Optional image(s) to use as context for the model. To include multiple images, you can use the Batch Images node. | |
| temperatureopt | FLOAT | 1.000–10 | Controls the randomness of the output. Higher values (e.g., 1.2) make the output more random, while lower values (e.g., 0.2) make it more focused and deterministic. |
| top_popt | FLOAT | 1.000–1 | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. |
| top_kopt | INT | 0–100 | A sampling technique that limits the number of most likely next tokens to k. (Unofficial parameter, may be ignored by official OpenAI API) |
| min_popt | FLOAT | 0–1 | A sampling technique that ensures only tokens with a probability greater than min_p times the probability of the most likely token are considered. (Unofficial parameter, may be ignored by official OpenAI API) |
| max_tokensopt | INT | 10001–32768 | The maximum number of tokens to generate in the completion. |
| frequency_penaltyopt | FLOAT | 0.00-2–2 | Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
| presence_penaltyopt | FLOAT | 0.00-2–2 | Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. |
| extra_parametersopt | STRING | Custom JSON string for any additional parameters to send to the API (e.g. {'logit_bias': {...}}). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |