ComfyUI on SwissGPU

Introduction

ComfyUI is a node-based interface for running diffusion and image generation workflows. On a SwissGPU server it can be installed directly over SSH, started on port8188, load your own models, and keep the setup simple to maintain.

A manual Linux installation works well on remote GPU servers because it gives direct control over Python, PyTorch, model storage, and startup behavior.

What You Need

  • An active SwissGPU Linux server with an NVIDIA GPU.
  • Working SSH access.
  • Python 3 and Git installed on the server.
  • An open port you can use for the web UI, typically 8188.
  • At least one compatible checkpoint model to load after installation.

Step 1: Verify GPU Availability

nvidia-smi

Confirm that the server sees the GPU before installing any Python dependencies.

Step 2: Clone ComfyUI

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

The official ComfyUI docs recommend cloning the repository and installing dependencies inside a dedicated environment.

Step 3: Create an Isolated Python Environment

python3 -m venv venv
source venv/bin/activate

This keeps ComfyUI dependencies separate from the rest of the system.

Step 4: Install PyTorch and ComfyUI Dependencies

On a modern NVIDIA server, install the CUDA-enabled PyTorch wheels first:

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

Then install ComfyUI requirements:

pip install -r requirements.txt

Step 5: Start ComfyUI

python main.py --listen 0.0.0.0 --port 8188 --enable-manager

Once it starts, openhttp://<server-host>:8188in your browser.

The --enable-manager flag turns on ComfyUI-Manager, which makes custom node installation much easier later.

Step 6: Add Models

At minimum, ComfyUI needs a checkpoint model. Common model folders are:

ComfyUI/models/checkpoints
ComfyUI/models/vae
ComfyUI/models/loras
ComfyUI/models/controlnet

The usual starting point is to place your main checkpoint file inComfyUI/models/checkpointsand refresh the browser after the file is present.

Step 7: Reuse a Shared Model Directory

If you keep models outside the ComfyUI repository, createextra_model_paths.yamlin the ComfyUI root and add entries like this:

my_models:
    base_path: /srv/ai-models
    checkpoints: checkpoints
    vae: vae
    loras: loras
    controlnet: controlnet

This is useful when you want ComfyUI to share checkpoints and LoRAs with other tools.

Step 8: Keep ComfyUI Running as a Service

If you want ComfyUI to survive shell disconnects and reboots, create a user service template:

[Unit]
Description=ComfyUI
After=network-online.target

[Service]
User=%i
WorkingDirectory=/home/%i/ComfyUI
ExecStart=/home/%i/ComfyUI/venv/bin/python main.py \
  --listen 0.0.0.0 --port 8188 --enable-manager
Restart=always

[Install]
WantedBy=multi-user.target

Save it as /etc/systemd/system/comfyui@.service, then enable it for your user:

sudo systemctl daemon-reload\nsudo systemctl enable --now comfyui@$(whoami)

Step 9: Update ComfyUI Later

cd ComfyUI
git pull
pip install -r requirements.txt

Updating regularly is useful because ComfyUI moves quickly, especially around nodes, workflows, and frontend changes.

Practical First Steps in the UI

  • Open the web UI and load a basic text-to-image workflow.
  • Select a checkpoint from the loader node.
  • Set a small resolution first to verify the pipeline works.
  • Queue one generation and monitor GPU usage with nvidia-smi.
  • Only after the basic workflow works should you add custom nodes or larger models.

Troubleshooting

journalctl -u comfyui@$(whoami) -f
  • Blank page or cannot connect: confirm the process is still running and that the selected port is reachable.
  • No models in the checkpoint loader: verify the files are in models/checkpoints or correctly mapped through extra_model_paths.yaml.
  • Torch or CUDA errors: reinstall the PyTorch wheels that match the server GPU and driver stack.
  • Out-of-memory errors: lower resolution, use a smaller checkpoint, or reduce batch size.

LongLink SAGL - v0.8.5 - All Rights Reserved