################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ #############################################################################################################################################################################################################################################################+## ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ################################################################################################################################################################################################################################################################ ########################################################################################################################################################################+-+#################################################+################################+## #################################################################################################################################################################+######.. .#####################################################################++#+######++ ##################################################################################################################################################+#################- #######################################################################----+.-# #########################################################################################################################################+#########################. .############################################################################## ###################################################################################.. ..######################################################################+. ##############################################+#+###########+################# #################################################################################. .#############################################################+#########+. ########################################################################++#### ###############################################################################. .#######################################################################-. .#########################################+#################################### ############################################################################### .+######################################################################### #########################################+#########################++-##+-##### ###############################################################################. # -..########################################################################## -###################################+#+--+#--######++.+#####################+## ###############################################################################. .########################################################################## ############################################################-################# ###############################################################################. .####################################################################. .###################################+#################################+# ############################################################################### . .###################################################################. ####################################################++##+######+###### ##############################################################################. .... .....+..####################################################+#####+++. ##########+++######################+#####+############.-#+####+###### ######################################################################### ............... ... --.###################################################### ########################+###+-+#++#+####+########################+ ######################################################################## ....................... .-################################################## ######+#####++####################++###############+-+########+.. ####################################################################.. ... .................... .... ...########################################## ############+#+#####+#+..#######---...-+##---#++##########++- ###################################################################... ...................................######################################## +### ## -##################++###############++-++##########+--++--.. ................ # ................. # ####+############################# ##### ########################## .#######........ .........###############################+#### ###################### -.## .. ++#############+#+.#..-+###+###+# ################################ ################################## ##### ########################## #+#######....... ...... .####################################- ######################### . #. #. ..###################..-#######-##### ###-.-+#####+-####+++ --+. ..-- ###+############################## ########################### ##########...... ...... ################################# ##########################. . ## # . ###################+-+#++..-#+ +###################- -#######-# ####################+#############.##### ##################################+### ..... ......#####################-+################ ########################+######+ ########+#.#+#+###..+###+-.-##+#+# ##### #########+#++#######-+####+--..# ##################################-##### #################+###################-.. . ####################################### #############---.-----##+####### ################################## ##### ..--#+-###-#++++-+++-+-#+###+-++ ##################################-##### ###############+#################### ###################################### ################################ ####################++----+++-.-- ##+#- +.-##-+##++.-#+#########-.-+#### ########.+########### ############-##### ############+######-############ ## ############ ############-###-#+##### ######.##########+-####### ### -.#.## #######+.... --...--..### -###- -####+###### ###-+######+ ..+ . #+######.############.############-##### ######+############-############ # #######-### #####+######.###########.######-############+##+++# #+ .- -###+..-++#+ +++######+-+ ####+ +####+####++ ###-#-###+#+ ++#+#+ ########.############.############.##### ###################-############ # +########## ####-####### +########## ######+#####-.###########+ ## . +## ##### ##### ##### +++## ##### .#+++ ##### ##### #-. .#+++# #+###### ############.############.##-## ###################-###########+ ###+###### ############.########### ###### #+####+############ ## ++#- ++-+# ###.+ #+++# .--- +.#+. +#### ##### #++. .-+-+ ..--. #. .-+++.#####+######.############.##+## -###########+######-########## +######### ############.###+--+#### ######.####-###+#.. . #### #+++- ####. .#.#. --#+# ##### +#### ##+- ###+# ##+-+ -##+- #+++-+## ############ ############.##### #########+######### ######## .######### ############.#####+##### ###+.- .###+- ##### -###+# #+- -+##+ --+#. ++-+# -+### +###- ##-.. ..##+ -+.-+ ##.# ..-## ######+# ###########+.+##.###++--#-###+# ########..+-#######.###### ######### +###########.######+#### #-.-#- -#### ##++# - +- +++ #### +###+ ###- -+- ++#-- . .-# +#### #+### ###+. +++++ .#+-- #+####-+ ############ ######-#####.##### ##########++-###### #++-# +#######- ####++##+### ###-..#-###.##+### ##### +#+## ##### #+.# ###+. ####. -+-++ ##### -##+- --+#+ ---+# .####+ #++## -.-.. ...-- ######## ######--#+#+ ++#########+ +-+## +###+###########+#+ +##+ . ######### ##+## ##### +####--+###.##.-## #### ##+## +###. -.+- +-##. ##### #####- .-.--+-##### #+### -.+## #-###+ .+###+##.... ##-+#### #####+-+-.-# ####++-#####.##### +######--####-###-#.###-- ... - +###+- ##### ##+#. .+#+...#--- .--+## .#### ##### ###-# ###+ - -..- .-+#+++#++## ##########++ .#- . . . .- -...-.. . . #.###### ##++######## #####+ #---- -.-## +-+######### +###+# #+###-- .... ### ##++ ##### ##### -#++#-+###+ ###### +#### ##### .####+ ##.+ . -+#+-.##+-..--..-- +##+##-###+# #+--- +##+.. --.-..-+++++ ----.- # +#### ##### #+### ##### ##++#.#-+## .-+#+ +##- ##++#+ ##### .### ....... #+# #--- ###++ #.-+# .########## ####.# ###### #++-- ###### #+.- .# .###- ##+--####### .-##+##-+-.. .--.. .-..... ...-...##+.- --####

Setting up Comfy-UI in RunPod

SSH, Modifying Comfy-Manager, installing UV and Comfy-UI

January 30, 2025

Will just show a quickstart for setting up Comfy-UI in RunPod.
This is very hacky but works.

Step 1: Generating a new SSH key

bash
ssh-keygen -t ed25519 -C "[email protected]"

This will save your public/private key pair to ~/.ssh/id_ed25519.pub and ~/.ssh/id_ed25519, respectively.

Or in case of Windows -
C:\users\{yourUserAccount}\.ssh\id_ed25519.pub and C:\users\{yourUserAccount}\.ssh\id_ed25519, respectively.

Now you can either add the public key under SSH Public Keys in your user settings in RunPod and pass it through the $PUBLIC_KEY environment variable or you can paste it directly into the container start command.

Step 2: Setting up a Template

Edit your ssh credentials and email into this command and paste it as the container start command.

bash
bash -c "apt update && \
    apt install -y wget python3 python3-venv python3-pip && \
    DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y && \
    mkdir -p ~/.ssh && \
    cd $_ && \
    chmod 700 ~/.ssh && \
    echo ssh-ed25519 <your_key_here_remove_the_tags> <[email protected]_remove_the_tags> > authorized_keys && \
    chmod 700 authorized_keys && \
    wget -qO- https://astral.sh/uv/install.sh | sh && \
    service ssh start && \
    sleep infinity"

or if you prefer to use the public key as an environment variable, you can use the following command:

bash
bash -c "apt update && \
    apt install -y wget python3 python3-venv python3-pip && \
    DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y && \
    mkdir -p ~/.ssh && \
    cd $_ && \
    chmod 700 ~/.ssh && \
    echo \"$PUBLIC_KEY\" > authorized_keys && \
    chmod 700 authorized_keys && \
    wget -qO- https://astral.sh/uv/install.sh | sh && \
    service ssh start && \
    sleep infinity"

This is your PUBLIC_KEY environment variable
This is your PUBLIC_KEY environment variable

now paste this as the container image

plaintext
runpod/pytorch:2.0.1-py3.10-cuda11.8.0-devel-ubuntu22.04

Source for Runpod Dockerfile

Here's How this should look like
Here's How this should look like

Step 3: Cloning Comfy-UI and Comfy-Manager

Go to /workspace and clone the Comfy-UI and Comfy-Manager repositories.

bash
git clone https://github.com/comfyanonymous/ComfyUI.git && \
cd ComfyUI && cd custom_nodes && \
git clone https://github.com/ltdrdata/ComfyUI-Manager.git

Step 4: Installing Comfy-UI

bash
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
python3 main.py

This will create directory for Comfyui-Manager confguaration and start the Comfy-UI server.