中文 | English
- Supports GPT-4’s visual features, can read images in ComfyUI, but requires the free image hosting service imgbb to implement this feature.
- Added persona nodes, you can quickly enable your set system prompts, or use custom persona to quickly adjust prompt word templates.
- Implemented conditional statements in ComfyUI, allowing the large model to output to different interfaces after judgment.
- Added more example workflows, welcome everyone to use directly!
comfyui is an extremely minimalist UI interface, primarily used for AI drawing and other workflows based on the SD model. This project aims to develop a complete set of nodes for LLM workflow construction based on comfyui. It allows users to quickly and conveniently build their own LLM workflows and easily integrate them into their existing SD workflows.(The image shows the intelligent customer service workflow built by the nodes of this project.For more example workflows, please check the workflow folder.)
Building a Modular AI with ComfyUI×LLM: A Step-by-Step Tutorial (Super Easy!)
- You can right-click in the comfyui interface, select
llm
from the context menu, and you will find the nodes for this project. how to use nodes - Supports OpenAI API driving and custom base_url, allowing the use of a proxy API to drive LLM nodes.If you are using other large model interfaces, you can convert them to the OpenAI API format using openai-style-api. Please select the LLM_local node for local deployment. Currently, both GLM and LLAMA have been adapted, but LLAMA cannot be used for tool invocations because the native LLAMA does not include this functionality.
- Local knowledge base access, supports RAG.
- Can invoke a code interpreter.
- Can perform online queries, supports Google search.
- Can implement conditional statements in comfyui, can classify user questions and then provide targeted responses.
- Supports loopback links for large models, allowing two large models to have a debate.
- Supports attaching any personality mask, can customize prompt word templates.
- Supports multiple tool invocations; currently developed tools include weather check, time check, knowledge base, code execution, online search, search on a single webpage, and more tools are under development.
- It is recommended to use the show_text node from ComfyUI-Custom-Scripts in conjunction with the LLM node for output display.
Baidu Cloud Download (Recommended! Includes a compressed package of comfyui with the environment setup completed, and a folder for this project. After downloading the former, there’s no need for further environment configuration!)
Or install using one of the following methods:
- Search for comfyui_LLM_party in the comfyui manager and install it with one click.
- Restart comfyui.
- Navigate to the
custom_nodes
subfolder under the ComfyUI root folder. - Clone this repository with
git clone https://github.com/heshengtao/comfyui_LLM_party.git
.
- Click
CODE
in the upper right corner. - Click
download zip
. - Unzip the downloaded package into the
custom_nodes
subfolder under the ComfyUI root folder.
- Navigate to the
comfyui_LLM_party
project folder. - Enter
pip install -r requirements.txt
in the terminal to deploy the third-party libraries required by the project into the comfyui environment. Please ensure you are installing within the comfyui environment and pay attention to anypip
errors in the terminal. - If you are using the comfyui launcher, you need to enter
path_in_launcher_configuration\python_embeded\python.exe path_in_launcher_configuration\python_embeded\Scripts\pip.exe install -r requirements.txt
in the terminal to install. Thepython_embeded
folder is usually at the same level as yourComfyUI
folder.
Configure the APIKEY using one of the following methods:
- Open the
config.ini
file in thecomfyui_LLM_party
project folder. - Enter your
openai_api_key
andbase_url
inconfig.ini
. - If you want to use the Google search tool, enter your
google_api_key
andcse_id
inconfig.ini
.
- Open the comfyui interface.
- Create a new Large Language Model (LLM) node and directly enter your
openai_api_key
andbase_url
in the node. - Create a new Google Search Tool (google_tool) node and directly enter your
google_api_key
andcse_id
in the node.
- More common utility nodes, such as: code interpreters, text-to-speech output, recognition of text information in images, etc.
- Allow LLM to internally call an LLM that is subsidiary to it, giving the assistant its own assistant.
- New nodes that can connect with the numerous SD nodes in comfyui, expanding the possibilities for LLM and SD, and providing related workflows.