Blog / Tutorials / How to Install ComfyUI on a GPU Server

How to Install ComfyUI on a GPU Server

ComfyUI is a node-based interface for running Stable Diffusion, Flux, and other diffusion models, valued for the fine-grained control its graph view gives over every stage of image and video generation. This guide covers how to install ComfyUI on a Linux GPU server in five…

6 min read

ComfyUI is a node-based interface for running Stable Diffusion, Flux, and other diffusion models, valued for the fine-grained control its graph view gives over every stage of image and video generation. This guide covers how to install ComfyUI on a Linux GPU server in five steps: install the NVIDIA driver and CUDA-enabled PyTorch, clone the repository, install Python dependencies, launch the server, and reach the web UI from your browser.

What Is ComfyUI?

ComfyUI is an open-source, node-based graphical interface for Stable Diffusion, Flux, and other diffusion models: instead of a form with sliders, you wire nodes together on a canvas — one node per operation (load checkpoint, encode prompt, sample, decode, save) — and the graph itself is the pipeline. That transparency is why it has overtaken form-based UIs like Automatic1111 for anyone who wants to inspect or modify what happens between prompt and image. Every generation is described by a JSON workflow file, so sharing, versioning, or automating a pipeline is as simple as sharing a file.

GPU and System Requirements

ComfyUI runs on CPU, but generation times measured in minutes rather than seconds are the reason almost nobody does that beyond a first test. VRAM is the resource that actually gates what you can run, not core count or system RAM. The table below is a starting point for common workloads.

ComfyUI GPU and VRAM Requirements by Workload
WorkloadMinimum VRAMComfortable VRAM
Stable Diffusion 1.56 GB8–12 GB
SDXL10 GB12–16 GB
Flux (dev / schnell)16 GB24 GB+
Video workflows (e.g. Wan 2.2)24 GB40 GB+
Minimum and comfortable VRAM by workload for running ComfyUI (Stable Diffusion, SDXL, Flux, and video diffusion models) on a GPU server. Actual usage scales with batch size and output resolution.

Batch size and output resolution push these numbers up further — a single 1024×1024 SDXL image and a batch of four at the same resolution do not use the same VRAM. Treat the ranges above as a starting point, not a hard ceiling.

Choosing a Server: GPU VPS vs. Cloud GPU

A ComfyUI instance you keep running needs a server, and GPU compute comes in two billing shapes: a flat monthly rate for a dedicated card, or a per-hour rate you pay only while the instance runs. The math tips toward flat-rate the moment you use the server for more than a few hours a day — hourly hyperscaler pricing is built for short bursts, not an always-on creative tool you come back to daily. If the term GPU VPS is new to you, our explainer on what a GPU VPS actually is covers the mechanics in full, and our comparison of GPU VPS, dedicated GPU servers, and hyperscaler instances covers the trade-offs in more depth. On Contabo’s GPU Cloud, the L40S tier (48 GB VRAM) covers every workload in the table above — including the heavier video workflows — with room to spare, which makes it the natural entry point rather than the H100 or H200 tiers built for multi-model or high-throughput production use.

Step-by-Step: Installing ComfyUI on Ubuntu

Update the System and Install Python, Drivers, and CUDA

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3 python3-pip python3-venv git ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo reboot

After the reboot, confirm the driver loaded with `nvidia-smi`. If it doesn’t list your GPU, the driver didn’t load — check `dmesg | grep -i nvidia` before continuing.

Clone ComfyUI and Install Dependencies

git clone https://github.com/Comfy-Org/ComfyUI.git
cd ComfyUI
python3 -m venv venv
source venv/bin/activate
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
pip install -r requirements.txt

Launch ComfyUI and Access the Web UI Remotely

Start the server with `python3 main.py –listen 0.0.0.0 –port 8188`, then open the server’s IP address on port 8188 in a browser. `–listen 0.0.0.0` is what makes the UI reachable from outside the server itself — without it, ComfyUI only accepts connections from localhost. Opening port 8188 directly to the internet with no authentication in front of it is the wrong way to do this on a real server: tunnel over SSH (`ssh -L 8188:localhost:8188 user@server`) or put a reverse proxy with basic auth in front of it, and only open the firewall port to your own IP if you skip the tunnel entirely.

Installing ComfyUI Manager and Custom Nodes

  1. Stop the server, then clone the Manager into the custom_nodes folder: `cd ComfyUI/custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Manager`.
  2. Restart ComfyUI (`python3 main.py –listen 0.0.0.0`) — the Manager button appears in the UI’s top menu once it’s loaded.
  3. Use Manager’s node and model browser to install custom nodes and download checkpoints instead of hunting down repositories and safetensors files by hand.
  4. When you load a workflow someone else built and ComfyUI reports missing nodes, use Manager’s “Install Missing Custom Nodes” action before trying to run it — this is the single most common first-run error.

Keeping ComfyUI Running After You Disconnect

Closing the SSH session kills the process running in your terminal, along with any generation in progress. Wrap the launch command in a systemd service — or, for something quicker to set up, a tmux or screen session you detach from instead of closing — so ComfyUI keeps running between logins. A systemd service also restarts ComfyUI automatically if the process crashes or the machine reboots, which is worth the extra ten minutes of setup the first time.

Why Run ComfyUI on Contabo

Everything in this guide runs the same way on Contabo’s GPU Cloud as on any other Linux GPU server — root access, standard Ubuntu, nothing ComfyUI-specific to work around. The L40S tier (48 GB VRAM) is the practical entry point: enough headroom for SDXL, Flux, and video workflows without paying for capacity a single ComfyUI instance won’t use, billed at a flat monthly rate rather than a meter that keeps running while you iterate on a workflow. If you’re building out heavier node graphs — multiple checkpoints loaded at once, longer video generations, batch rendering — our companion guide to ComfyUI workflows and templates covers the patterns worth knowing before you scale up.

FAQ: Installing ComfyUI

Do I need a dedicated GPU to run ComfyUI?

Technically no — ComfyUI runs in CPU mode with `–cpu`, but generation that takes seconds on a GPU can take several minutes on CPU. For anything beyond occasional testing, a dedicated GPU with at least 8 GB of VRAM is the practical minimum.

How much VRAM does ComfyUI need?

It depends on the model, not ComfyUI itself: roughly 8–12 GB for Stable Diffusion 1.5, 12–16 GB for SDXL, 24 GB or more for Flux, and 24–40 GB or more for video-generation workflows like Wan 2.2.

Can I install ComfyUI on Windows instead of Linux?

Yes — ComfyUI supports Windows, macOS, and Linux, and also ships a portable Windows build with an embedded Python environment. This guide covers Linux because that’s what almost every GPU server and cloud GPU instance runs.

Is ComfyUI free to use?

Yes. ComfyUI is open source and free to install and run; you only pay for the hardware — your own GPU or a rented GPU server — and for any paid models you choose to use with it.