2fe4e92e8d030c8f860ae5b67bbee6991e05bd69
ComfyUI LLM Helper
A collection of custom nodes for working with LLM APIs in ComfyUI.
It supports everything from API client management to direct ChatCompletions execution and workflow utilities.
Key Features
- LLM Client & Execution: Configure API servers securely and run ChatCompletions directly within ComfyUI.
- Node Compatibility: Unpack client data to use with other OpenAI-compatible custom nodes.
- Workflow Utilities: Supports streaming, automatic image handling for multimodal models, and storable text previews.
Installation
cd ComfyUI/custom_nodes
git clone https://github.com/bedovyy/ComfyUI-LLM-Helper
cd ComfyUI-LLM-Helper
pip install -r requirements.txt
Or search and install ComfyUI-LLM-Helper on ComfyUI-Manager.
Usage
Simple ChatCompletions using blueprint
ChatCompletions with list
Nodes
LLM:Client
- Set your LLM server's
base_urland select API key from environment variables (loaded securely fromComfyUI/.env). - Click "Update model names" to query the real /models endpoint and instantly refresh the
model_namedropdown with available models, then use the outputs downstream.
LLM:UnloadModel (llama.cpp)
- Sends an unload request to
llama-serverwhen running in router mode, freeing the model from memory.
LLM:Unpack client
- Unpacks
base_url,api_key, andmodel_namefrom theLLM:Clientnode. This allows these values to be used with other OpenAI API nodes.
Caution: Be aware that the
api_keyis output as a plain string.
LLM:ChatCompletions
- Sends a request via the OpenAI API
/chat/completionsendpoint. Requests are streamed by default, allowing you to monitor progress or interrupt the process within the node. (Streaming can be disabled by addingstream: falsetoLLMCustomJsonOptions.)
LLM:Message
- Constructs messages to be sent to the LLM. In addition to
user,system, andassistantroles, custom roles can be selected. When an image is provided as input, an image ID is automatically assigned.
LLM:Options
- Allows specification of parameters such as
temperatureandtop_p.
LLMCustomJsonOptions
- Allows you to include additional request information by writing it in JSON format.
Preview as Text (storable)
- Similar to
Preview as Text, but saves the value within the workflow, allowing the stored value to be retrieved and reused.
LLM:ChatCompletions Simple (subgraph blueprint)
- A subgraph blueprint that provides a basic configuration for entering system and user prompts.
Languages
Python
85.1%
JavaScript
14.9%