Nodes/comfyui-sg-openai-client/OpenAI Chat Completion
ComfyUI Node

OpenAI Chat Completion

A ComfyUI node in OpenAI with 14 inputs and 1 output.

By sebagallo·Created 8 months ago·Updated 5 months ago· 0
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)

NameTypeDefaultDescription
clientOPENAI_CLIENTThe OpenAI client to use for the request.
system_promptSTRINGThe system prompt to set the context for the model.
user_promptSTRINGThe user prompt to generate a response for.
modelCOMBOThe model used to generate the response.
seedINT-1-9223372036854776000–9223372036854776000If specified, our system will make a best effort to sample deterministically. Use -1 for random (default behavior).
imagesoptIMAGEOptional image(s) to use as context for the model. To include multiple images, you can use the Batch Images node.
temperatureoptFLOAT1.000–10Controls 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_poptFLOAT1.000–1An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
top_koptINT0–100A sampling technique that limits the number of most likely next tokens to k. (Unofficial parameter, may be ignored by official OpenAI API)
min_poptFLOAT0–1A 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_tokensoptINT10001–32768The maximum number of tokens to generate in the completion.
frequency_penaltyoptFLOAT0.00-2–2Positive 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_penaltyoptFLOAT0.00-2–2Positive 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_parametersoptSTRINGCustom JSON string for any additional parameters to send to the API (e.g. {'logit_bias': {...}}).

Outputs (1)

NameTypeDescription
STRINGSTRING