Nodes/comfyui_LLM_party/☁️API LLM general link
ComfyUI Node

☁️API LLM general link

The node most people start with

By heshengtao·Created 2 years ago·Updated 11 days ago· 2,328
☁️API LLM general link
  • model
  • images
  • extra_parameters
  • assistant_response
  • history
  • tool
  • image
  • reasoning_content
system_prompt你一个强大的人工智能助手。
user_prompt你好
temperature0.7
is_memoryenable
is_tools_in_sys_promptdisable
is_lockeddisable
main_brainenable
max_length1920
system_prompt_input
user_prompt_input
tools
file_content
imgbb_api_key
conversation_rounds100
historical_record
is_enabletrue
user_history
img_URL
streamfalse

If you only ever install one node from comfyui_LLM_party, this is probably it - it's the pack's own first "start_with_LLM_api" example workflow, and it's the node that shows up when someone on r/comfyui asks how to hook an OpenAI-format API into a ComfyUI graph. Pair it with the API LLM Loader node (which handles the base_url/api_key/model_name combo) and you've got a chat node that works with OpenAI, any relay/one-api-compatible endpoint, or literally anything that speaks the OpenAI chat-completions format - which, these days, is most of them.

The essentials are system_prompt, user_prompt, and model (the loaded model object from API LLM Loader) going in, assistant_response coming out - same shape as any chat API call. temperature controls randomness the usual way, and max_length (default 1920, noticeably higher than the local node's 512 default) caps response length. Two fields deserve a closer look because they solve real, specific problems: is_tools_in_sys_prompt exists for models that don't support native function calling - instead of relying on the API's tool-calling protocol, it stuffs the tool descriptions straight into the system prompt and hopes the model plays along, which is a real workaround people use for cheaper or older models that would otherwise be useless for agentic workflows. And stream flips on streaming output, which shows the response building token-by-token in the console rather than making you wait for the whole thing - genuinely useful for debugging a slow or hanging call, since you can tell immediately whether the API is responding at all versus just being slow.

Same main_brain / tool output pattern as the local node applies here too: disable main_brain and this node stops being your primary agent and becomes a tool another LLM node can call, which is how the pack builds its multi-agent chains. For vision-capable API models, images accepts image input directly, img_URL lets you pass a hosted image URL instead of raw data, and imgbb_api_key is there so images get uploaded to imgbb and passed as a URL rather than a giant base64 blob if you don't fill it in - a nice detail if you're worried about payload size on a long conversation. Newer reasoning models (the R1-style kind) get their own reasoning_content output, separate from assistant_response, so you can inspect or discard the model's scratch-work without it polluting the actual answer.

Installing it is the standard pack install: search "comfyui_LLM_party" in ComfyUI Manager, or git clone https://github.com/heshengtao/comfyui_LLM_party into custom_nodes and restart, then pip install -r requirements.txt from the pack folder using ComfyUI's own Python (portable builds: python_embeded\python.exe -m pip install -r requirements.txt, explicitly - the system pip is the wrong one).

The two mistakes people actually make here. First, base_url needs to end in /v1/ for OpenAI-format endpoints - leave off the trailing slash or point it at the wrong path and you'll get connection errors that look worse than the fix actually is. Second, decide where your API key lives and stick with it: you can configure openai_api_key/base_url once in the pack's config.ini and just type a model name on the node, or fill api_key/base_url directly on the API LLM Loader - mixing the two approaches (config set, node fields also blank, or vice versa) is the most common reason people report "nothing happens" with no visible error. If you're pointing this at Ollama instead of a cloud API, don't use this path at all - flip is_ollama on the loader node, which skips the base_url/api_key requirement entirely.

Category大模型派对(llm_party)/模型链(model_chain)

Inputs (22)

NameTypeDefaultDescription
system_promptSTRING你一个强大的人工智能助手。System prompt, used to describe the behavior of the model and the expected output format.
user_promptSTRING你好User prompt, used to describe the user's request and the expected output format.
modelCUSTOMThe model to use for the LLM.
temperatureFLOAT0.70–1The temperature parameter controls the randomness of the model's output. A higher temperature will result in more random and diverse responses, while a lower temperature will result in more focused and deterministic responses.
is_memoryCOMBOenableWhether to enable memory for the LLM.
is_tools_in_sys_promptCOMBOdisableIntegrate the tool list into the system prompt, thereby granting some models temporary capability to invoke tools.
is_lockedCOMBOdisableWhether to directly output the result from the last output.
main_brainCOMBOenableIf this option is disabled, the LLM will become a tool that can be invoked by other LLMs.
max_lengthINT1920256–128000The maximum length of the output text.
system_prompt_inputoptSTRINGSystem prompt input, used to describe the system's request and the expected output format.
user_prompt_inputoptSTRINGUser prompt input, used to describe the user's request and the expected output format.
toolsoptSTRINGTool list, used to describe the tools that the model can invoke.
file_contentoptSTRINGInput the contents of the file here.
imagesoptIMAGEUpload images here.
imgbb_api_keyoptSTRINGOptional, if not filled out, it will be passed to the LLM in the form of a base64 encoded string. API key for ImgBB, used to upload images to ImgBB and get the image URL.
conversation_roundsoptINT1001–10000The maximum number of dialogue turns that the LLM can see in the history records, where one question and one answer constitute one turn.
historical_recordoptCOMBOThe dialogue history file is optional; if not selected and left empty, a new dialogue history file will be automatically created.
is_enableoptBOOLEANtrueWhether to enable the LLM.
extra_parametersoptDICTExtra parameters for the LLM.
user_historyoptSTRINGUser history, you can directly input a JSON string containing multiple rounds of dialogue here.
img_URLoptSTRINGThe URL of the image.
streamoptBOOLEANfalseWhether to enable streaming output.

Outputs (5)

NameTypeDescription
assistant_responseSTRINGThe assistant's response to the user's request.
historySTRINGThe dialogue history
toolSTRINGThis interface will connect this LLM as a tool to other LLMs.
imageIMAGEImages generated or fetched by the LLM.
reasoning_contentSTRINGThe assistant's reasoning process.