ComfyUI on Vast.ai
Rob Ballantyne (Github:ai-dock / Twitter:robballantyne) helpfully made a ComfyUI docker image after I asked for one on the Vast.AI Discord server. It works and I’m forever grateful.
Inside the Docker Image
- ComfyUI
- SDXL 1.0 Base Model
- SDXL 1.0 Refiner Model
- SDXL VAE. I believe that this is the 0.9 version, since SD never published a 1.0 version.
- SergeSDXL (Github). My preferred workflow for SDXL in ComfyUI at the moment.
ComfyUI Location
ComfyUI install is located at /opt/ComfyUI
. But you shouldn’t have to touch it. It’s included here for completeness, and also mostly so you know where you can install custom nodes.
Workspace
The workspace is located at /workspace
but the output folder was not configured to this folder.
To set the output directory to the workspace, use the environment variable that comes with the docker image and then restart the process:
# Make a new folder called outputs so it’s easier to mangage
mkdir /workspace/outputs
# Set the enviroment variable
export COMFYUI_FLAGS="--output-directory /workspace/outputs"
# Restart the process
supervisorctl restart comfyui
Restart instance
You can restart the ComfyUI instance by running the following command
# Restart the process
supervisorctl restart comfyui
SeagreSDXL Workflow
To load and use the SeagreSDXL, drag an image or JSON that’s created with the SeagreSDXL onto the window. You can use any of previous images, or get it from the SeagreSDXL Github repo: https://github.com/SeargeDP/SeargeSDXL
As of this writing, version 3.4 is the latest.
Custom Nodes installation
If you need to install custom nodes, workflows, etc, you can cd into the custom modes and clone repos that way. After cloning the repo, restart the process.
cd /opt/ComfyUI/custom_nodes
# Install Impact Pack
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
# Install ComfyUI-Manager
git clone https://github.com/ltdrdata/ComfyUI-Manager
# Restart the process
supervisorctl restart comfyui
No need to download the following
The following is already included in the image so you won’t need to download them again, but I’m keeping these around i case I need to get to them in the future.
SeargeSDXL
cd /workspace/ComfyUI/custom_nodes/
git clone https://github.com/SeargeDP/SeargeSDXL.git
Models
cd /workspace/ComfyUI/models/checkpoints
wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
cd /workspace/ComfyUI/models/checkpoints
wget https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/resolve/main/sd_xl_refiner_1.0.safetensors
cd /workspace/ComfyUI/models/vae
wget https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/resolve/main/sdxl_vae.safetensors
cd /workspace/ComfyUI/models/loras
wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors
cd /workspace/ComfyUI/models/upscale_models
wget https://huggingface.co/uwg/upscaler/resolve/main/ESRGAN/4x_NMKD-Siax_200k.pth
cd /workspace/ComfyUI/models/upscale_models
wget https://huggingface.co/uwg/upscaler/resolve/main/ESRGAN/4x-UltraSharp.pth