ComfyUI Install That Actually Works (No Crashes)
Most guides show how to install ComfyUI.
They don’t show how to install it so it doesn’t crash later.
This guide focuses on: - stability - predictable performance - avoiding common failures
0. Before You Start
Run system checks first:
df -h
nvidia-smi
free -h
You should have: - 50–100GB free disk - working GPU - 16GB+ RAM (recommended)
1. Install System Dependencies
sudo apt update
sudo apt install -y python3 python3-venv python3-pip git
2. Clone ComfyUI
Choose a stable location:
mkdir -p /opt/ai
cd /opt/ai
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
3. Create Virtual Environment
Never install globally.
python3 -m venv venv
source venv/bin/activate
4. Install Requirements
pip install --upgrade pip
pip install -r requirements.txt
5. Install PyTorch (GPU)
Check CUDA version:
nvidia-smi
Then install PyTorch.
Example (CUDA 12.x):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
6. First Run
python main.py
Open in browser:
http://YOUR_SERVER_IP:8188
7. Create Models Directory
Do NOT mix models inside project.
Create separate storage:
mkdir -p /opt/models/{checkpoints,loras,vae,controlnet}
8. Link Models (Recommended)
Instead of copying files, use symlinks:
ln -s /opt/models/checkpoints models/checkpoints
ln -s /opt/models/loras models/loras
ln -s /opt/models/vae models/vae
9. Run with GPU Optimization
Basic:
python main.py --listen 0.0.0.0
Low VRAM mode:
python main.py --lowvram
10. Common Failures (and Fixes)
Out of VRAM
Symptoms: - crash during generation - CUDA out of memory
Fix:
python main.py --lowvram
Use smaller models.
Slow Performance
Check GPU:
nvidia-smi
If GPU usage is 0%: - wrong PyTorch build - CUDA mismatch
Module Errors
Fix:
pip install -r requirements.txt
Port Not Accessible
Run:
python main.py --listen 0.0.0.0
Check firewall.
11. Run in Background (Production)
Use screen:
screen -S comfyui
python main.py --listen 0.0.0.0
Detach:
Ctrl + A, then D
12. Recommended Structure
/opt/ai/ComfyUI
/opt/models
/opt/output
13. Why Most Installs Fail
Common mistakes:
- installing without GPU support
- running out of disk space
- mixing models inside project
- no virtual environment
14. Next Step
Now fix VRAM issues: