Get Comfy in Debian with ComfyUI

Get Comfy in Debian with ComfyUI

ComfyUI is a powerful tool designed for creating user-friendly interfaces for machine learning workflows, particularly in the realm of generative AI. This guide walks you through setting up your environment and getting started with ComfyUI in debian or compatible wsl environment. If pyenv is installed then can choose an alternate version of python. The default installation should have 3.11 or newer so we should be ok for this environment. I always prefer to have python-is-python3 just for ease of use or you can create a symlink, or to windows a shortcut.

first we will get the files from git in the directory or folder we weant to hold the appication

git clone https://github.com/comfyanonymous/ComfyUI.git

the folder ComfyUI is created and now cd into the folder or change directory

cd ComfyUI

So we make a virtual environment

python -m venv <your_env>

the name can be anything this is my preference to know this is my comfly environment

This will create a new folder named <your_env> inside of the new ComfyUI folder make the virtual environment to separate if from your system python install. Its a good idea to keep them within the same folder so the startup is within the program location for ease of use. Now lets put in the goods check your cuda version with

nvcc -version

This should return your Nvidia Driver cuda version, I am 12.9 currently so I will chose 12.9 or change the path to cu128, 126, 124 repsectively

And now activate it

source <path_to_env/bin/avctivate>

In the terminal there should be a parethesis showing the current enviroment, this will mean that all python libraries will be installed here and not to the system install. I am using cuda 12.9 so when I add pytorch I want the latest cuda

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu129

Now we should have the base setup to install ComfyUI so we need the requirments or dependent libraries to run.

pip install -r requirements.txt

Bang! it can run but theres a bit of making your installation whole is to add the node manager, when you find new and interesting ideas for a workflow or a new model they may use custom nodes to interact and this will be an easy way to add or manage them.

git clone https://github.com/ltdrdata/ComfyUI-Manager.git

if not cloning into the ComfyUI/custom_nodes folder then move the files to it

we can start it now with python main.py but if you are running it on a network python main.py --listen 0.0.0.0 to listen on your network. we can script this to be automatic later as a simple startup script to add to either a list of programs or anything you want to manage start programs or simple one click methods of starting as if its just an installed application. lets do something simple for now so as to not forget

!#/bin/bash
python main.py --listen 0.0.0.0

now when we start we will have the node manager menu option in the right hand top menu for adding custom node types or some but not all model files

To get started open a template from the Workflow tab. We are going to add the core models for Hidream so select hidream. You should get a prompt for missing models to download.

We could use the download link but for these large files its simpler to use wget. Copy the URL and within the ComfyUI/models folder you will see the folders for the components.

Sstarting with diffusion_models it shows the file should be in .diffusion_models. cd into the diffusion_models folder and use wget to download the file, or we can just write a script to get all the missing models in one go instead. For Hidream the missing files listed above

#!/bin/bash
cd text_encoders
wget https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/text_encoders/clip_l_hidream.safetensors
wget https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/text_encoders/clip_g_hidream.safetensors
wget https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/text_encoders/t5xxl_fp8_e4m3fn_scaled.safetensors
wget https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/text_encoders/llama_3.1_8b_instruct_fp8_scaled.safetensors
cd ..
cd diffusion_models
wget https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/diffusion_models/hidream_i1_dev_fp8.safetensors

Save the script and make it executable. Now refresh the web page, or restart from the comfuiUI manager tab, or stop and start main.py and now you have a baseline setup of Hidream for making extremely lifelike human representations. Lets run the default hidream workflow

Change slight details about the character in the prompt for example add to the prompt of a woman ',with <Xyz> features' to the example and see the result.

Just for kicks lets change that prompt slightly. I'm listening to 8Ball & MJG so I figure lets add some baroque age pimpin' to this with a prompt change and see what this whole array of arrays is is going to choose. Yaknow kinda like a pimp scene from The Mack

hidream output

I guess thats baroque age pimpin'.