Nodes/comfyui-openai-api/OpenAI API - Chat Completion
ComfyUI Node

OpenAI API - Chat Completion

Generates text responses using OpenAI's chat completion API. Be sure to indicate a Vision Language Model if you are using an image input.

By lany42·Created 2 days ago·Updated a day ago· 0
OpenAI API - Chat Completion
  • client
  • history
  • options
  • images
  • Response
  • History
◄model—►
◄force_regenfalse►
◄prompt—►
◄system_prompt—►
CategoryOpenAI API

Inputs (8)

NameTypeDefaultDescription
clientOAIAPI_CLIENTThe OpenAI API client to use to perform the request
modelSTRINGThe model to use for generating text
force_regenBOOLEANfalseSet to true to always request a new text generation even if no widget input values have changed (no cache)
promptSTRINGThe user prompt to use for generating text; may be empty when images are supplied
system_promptoptSTRINGThe system prompt to send along with the user prompt
historyoptOAIAPI_HISTORYPrevious conversation history
optionsoptOAIAPI_OPTIONSAdditional options to pass with the request
imagesoptIMAGEImage(s) to include in the request

Outputs (2)

NameTypeDescription
ResponseSTRINGGenerated text response
HistoryOAIAPI_HISTORYConversation history