Setting up Comfy-UI in RunPod
SSH, Modifying Comfy-Manager, installing UV and Comfy-UIJanuary 30, 2025
Will just show a quickstart for setting up Comfy-UI in RunPod.
This is very hacky but works.
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
andC:\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.
Edit your ssh credentials and email into this command and paste it as the container start command.
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 -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"
now paste this as the container image
runpod/pytorch:2.0.1-py3.10-cuda11.8.0-devel-ubuntu22.04
Go to /workspace
and clone the Comfy-UI and Comfy-Manager repositories.
git clone https://github.com/comfyanonymous/ComfyUI.git && \ cd ComfyUI && cd custom_nodes && \ git clone https://github.com/ltdrdata/ComfyUI-Manager.git
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.