This repo creates a series of nodes that enable you to utilize the a/Griptape Python Framework with ComfyUI, integrating AI into your workflow. This repo creates a series of nodes that enable you to utilize the Griptape Python Framework with ComfyUI, integrating AI into your workflow.
This repo creates a series of nodes that enable you to utilize the Griptape Python Framework with ComfyUI, integrating LLMs (Large Language Models) and AI into your workflow.
Watch the trailer and all the instructional videos on our YouTube Playlist.
The repo currently has a subset of Griptape nodes, with more to come soon. Current nodes can:
Create Agents that can chat using these models:
Control agent behavior and personality with access to Rules and Rulesets.
Give Agents access to Tools:
Run specific Agent Tasks:
Generate Images using these models:
Audio
Use nodes to control every aspect of the Agents behavior, with the following drivers:
In this example, we're using three Image Description
nodes to describe the given images. Those descriptions are then Merged
into a single string which is used as inspiration for creating a new image using the Create Image from Text
node, driven by an OpenAI Driver
.
The following image is a workflow you can drag into your ComfyUI Workspace, demonstrating all the options for configuring an Agent.
You can previous and download more examples here.
Please view recent changes here.
Install ComfyUI using the instructions for your particular operating system.
If you'd like to run with a local LLM, you can use Ollama and install a model like llama3.
Download and install Ollama from their website: https://ollama.com
Download a model by running ollama run <model>
. For example:
ollama run llama3
You now have ollama available to you. To use it, follow the instructions in this YouTube video: https://youtu.be/jIq_TL5xmX0?si=0i-myC6tAqG8qbxR
There are two methods for installing the Griptape-ComfyUI repository. You can either download or git clone this repository inside the ComfyUI/custom_nodes
, or use the ComfyUI Manager.
Option A - ComfyUI Manager (Recommended)
Option B - Git Clone
Open a terminal and input the following commands:
cd /path/to/comfyUI
cd custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
Libraries should be installed automatically, but if you're having trouble, hopefully this can help.
There are certain libraries required for Griptape nodes that are called out in the requirements.txt file.
griptape[all]
python-dotenv
These should get installed automatically if you used the ComfyUI Manager installation method. However, if you're running into issues, please install them yourself either using pip
or poetry
, depending on your installation method.
Option A - pip
pip install "griptape[all]" python-dotenv
Option B - poetry
poetry add "griptape[all]" python-dotenv
Now if you restart comfyUI, you should see the Griptape menu when you click with the Right Mouse button.
If you don't see the menu, please come to our Discord and let us know what kind of errors you're getting - we would like to resolve them as soon as possible!
For advanced features, it's recommended to use a more powerful model. These are available from the providers listed bellow, and will require API keys.
To set an API key, click on the Settings
button in the ComfyUI Sidebar.
Select the Griptape
option.
Scroll down to the API key you'd like to set and enter it.
Note: If you already have a particular API key set in your environment, it will automatically show up here.
You can get the appropriate API keys from these respective sites:
Griptape does install the torch
requirement. Sometimes this may cause problems with ComfyUI where it grabs the wrong version of torch
, especially if you're on Nvidia. As per the ComfyUI docs, you may need to unintall and re-install torch
.
pip uninstall torch
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
Sometimes you'll find that the Griptape library didn't get updated properly. This seems to be especially happening when using the ComfyUI Manager. You might see an error like:
ImportError: cannot import name 'OllamaPromptDriver' from 'griptape.drivers' (C:\Users\evkou\Documents\Sci_Arc\Sci_Arc_Studio\ComfyUi\ComfyUI_windows_portable\python_embeded\Lib\site-packages\griptape\drivers\__init__.py)
To resolve this, you must make sure Griptape is running with the appropriate version. Things to try:
python -m pip install griptape -U
If you are using StabilityMatrix to run ComfyUI, you may find that after you install Griptape you get an error like the following:
To resolve this, you'll need to update your torch installation. Follow these steps:
...
menu.torch
to filter the list.-
button to uninstall torch
.+
button to install a new package.torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
Massive thank you for help and inspiration from the following people and repos!