Zenerator is a collection of ComfyUI workflows by Nilor Studio that we commonly use to produce art, conveniently packaged up in an easy-to-use Gradio application. The application was made to be extensible, so that others can produce Gradio UIs for their own custom workflows via JSON.
- 61 GB of available storage
- Python 3.12.7
- CUDA 12.1 Update 1
- SSH connection to the Nilor Corp organization on HuggingFace
- Git and LFS
Warning
These setup instructions have only been tested on Windows using Powershell with Administrative privileges.
- In a directory of your choosing, enter the following into your terminal:
mkdir nilor-corp cd nilor-corp python -m venv venv .\venv\Scripts\activate python.exe -m pip install --upgrade pip
- In the
.\nilor-corp\
directory:pip install comfy-cli pip install ultralytics # should prevent an error when installing ComfyUI-Impact-Pack later
- In the
.\nilor-corp\
directory:comfy --workspace=ComfyUI install
Tip
If during this step you get an error that says ERROR: No matching distribution found for torch
, you may have an incompatible version of Python installed. Torch documentation states that it is only compatible up to version Python 3.12.7, as we have recommended in the Dependencies above. To resolve this error, install Python 3.12.7, and start the installation process over again using that version of Python.
- Running the above command will cause the terminal to prompt the user for input in the terminal. Select either "nvidia", "amd", or "intel_arc" for the first question (depending on which GPU you have), and type "y" to agree to the second question about which repository to clone from.
[!WARNING] > Zenerator has only been tested on Nvidia GPUs.
-
comfy set-default ComfyUI
- In the
.\nilor-corp\
directory:cd ComfyUI rm -rf models #if unix rmdir models #if win. Answer yes if prompted git clone git@hf.co:nilor-corp/zenerator-models models cd .. # should put you in .\nilor-corp\ directory
- In the
.\nilor-corp\
directory:git clone https://github.com/nilor-corp/zenerator.git
Note
This step is only necessary if you intend to use the nilor.cool platform to generate images and use Collections of generated images as input to Zenerator. This is a highly recommended and very convenient feature, but it requires a personal Nilor API key which can currently only be attained by request from the Nilor Corp development team. In the near future it will be possible to attain this API key directly through the nilor.cool platform.
- In the
.\nilor-corp\zenerator\
directory, create a.env
file and add the following to it:NILOR_API_KEY=<API KEY> NILOR_API_URI=https://api.nilor.cool/api
- In the
.\nilor-corp\
directory, still within thevenv
virtual environment:cd zenerator cp .\ComfyUI-Manager-Snapshots\zenerator-snapshot.json ..\ComfyUI\user\default\ComfyUI-Manager\snapshots\ cd ..\ComfyUI\custom_nodes\ # should put you in .\nilor-corp\ComfyUI\custom_nodes directory git clone https://github.com/BadCafeCode/execution-inversion-demo-comfyui.git cd ..\.. # should put you in .\nilor-corp\ directory comfy launch
- Once launched, navigate to ComfyUI in your browser: http://127.0.0.1:8188
- In the top right corner of the screen click the
π§© Manager
button. - A new window will appear. In the bottom left corner under the
Experimental
section, clickSnapshot Manager
. - Click
Restore
on the snapshot, then press theRestart
button that appears in order to restart ComfyUI. This will download a lot packages which you should see in terminal.
Tip
You may see a ModuleNotFoundError
about "tensorrt_bindings"
during ComfyUI startup. In our tests, this can be safely ignored because it is resolved by the next step.
-
Once ComfyUI has fished installing packages, quit ComfyUI by pressing
Ctrl + C
(Win) orCmd + C
(Unix) in the terminal. -
In the
.\nilor-corp\
directory, enter the following:.\venv\Scripts\activate cd zenerator python -m pip install --no-cache-dir -r requirements.txt
-
Then run Zenerator to install the last remaining TensorRT dependencies by entering the following:
gradio app.py
Congratulations, you are finished installing Zenerator!
- If you have installed Zenerator correctly, your directory structure should look like this:
nilor-corp βββ ComfyUI βββ venv βββ zenerator
- Following the Usage instructions below, with both ComfyUI and Zenerator initialized please run the "Test" workflow tab to ensure that your installation is functioning properly.
Note
The first time you run a workflow on a machine, expect it to take longer to begin generating because some custom nodes will need to download models. Subsequent runs of the same workflow will take less time to start generating.
Warning
If you plan to use the included workflows, be aware that some of them may have additional specific dependencies or setup steps. Below are workflow-specific requirements you should resolve before attempting to run them.
Motion Directed LTXV
This workflow uses a node which makes an API call to use an LLM to describe your input image. For that reason, you need to add a free API key for Groq. You basically just need to put an API key in an .env file inside the custom node pack. Instructions are here.You will need to run ComfyUI and Zenerator in seperate instances of Powershell.
- In the first instance of Powershell, from the
.\nilor-corp\
directory:.\venv\scripts\activate comfy launch
Tip
If you run into a "import torch" error when trying to launch ComfyUI for the first time, try the potential fix here.
- In the second instance of Powershell, from the
.\nilor-corp\
directory:.\venv\scripts\activate cd zenerator gradio ./app.py
Note
The first time you launch Zenerator, expect the startup to be delayed because it needs to build a TensorRT engine in order for the "Upscale Video (TensorRT)" workflow tab to work. This shouldn't take more than a few minutes and should only occur once.
Tip
Generated outputs can be found in: .\nilor-corp\ComfyUI\output\Zenerator\
directory.
- In an instance of Powershell, from the
.\nilor-corp\
directory:.\venv\scripts\activate cd zenerator git pull
- In the
.\nilor-corp\
directory:cd .\ComfyUI\models git pull
- Follow the same instructions as the Provision ComfyUI section. Do not continue beyond that section, only that section's instructions need to be followed.
Note
At some point in the future, ComfyUI and/or comfy-cli will need to be updated. When the time comes, we will update this README with additional steps as needed.
You have finished updating Zenerator!
Warning
Proceed at your own risk. Only follow these instructions if you know what you are doing, or you may break your Zenerator installation.
Important
This section is under construction and we will add more detailed instructions soon.
In order to make new custom workflow tabs in the Gradio app, follow these instructions:
-
Within ComfyUI, click
Workflow
>Export (API)
to create a new workflow JSON file and place it in the workflows folder. -
Then, edit the workflow_definitions.json file to add another definition for your new workflow. Be sure to edit the "filename" field to the filename of your newly-exported workflow JSON file, and follow the conventions of the existing pre-defined workflows in workflow_definitions.json to write a new workflow definition.
-
You should populate your new workflow definition with the input components required to control the workflow, as well as the worklow node IDs that those input components should point to. The workflow node IDs can be found within your newly-exported worklow JSON file.