Deployment guide

How to host ComfyUI on a VPS

Deploy on a VPS Cloud →

Artificial Intelligence8 min read

How to host ComfyUI on a VPS

ComfyUI is the reference node-based interface for driving Stable Diffusion and diffusion models through reproducible visual workflows. Hosting it on a VPS, ideally with a GPU, turns it into an image-generation studio accessible remotely and automatable. Here is how to deploy it cleanly.

Why self-host ComfyUI on a VPS

ComfyUI organizes image generation into node graphs: each step (model loading, prompt encoding, sampling, VAE) is a linkable, reusable block, which makes workflows reproducible and shareable in JSON format. Unlike an online generation service, self-hosting gives you control over the checkpoint models, the LoRAs, the ControlNets and the extensions, without censorship or quota. On a GPU VPS, you get a studio available 24/7 that an entire creative team can use remotely, and whose API lets you industrialize generation from your own scripts or pipelines.

Concrete benefits of self-hosting

  • Reproducible node-based workflows, exportable as JSON and shareable within the team
  • Free library of checkpoints, LoRAs and ControlNets with no quota or censorship
  • HTTP API to automate generation from your scripts and pipelines
  • Remote GPU accessible 24/7 without tying up a local workstation
  • Installation of custom nodes (community extensions) without restriction
  • Cost control: a GPU VPS by the hour or the month rather than paying per image

Hardware and software prerequisites

ComfyUI leverages a GPU for reasonable generation times. Aim for a VPS with an NVIDIA GPU with at least 8 GB of VRAM for SDXL (12 to 16 GB recommended for recent models like Flux), accompanied by 4 vCPUs, 16 GB of system RAM and 50 GB of disk or more, since checkpoints each weigh several gigabytes. CPU execution remains possible but very slow, to be reserved for testing. On the software side: NVIDIA drivers and the NVIDIA Container Toolkit for Docker, Docker and Docker Compose, and a domain pointing to the VPS to expose the interface.

ComfyUI versus AUTOMATIC1111 (Stable Diffusion WebUI)

CriterionComfyUIAUTOMATIC1111
ApproachVisual node-based workflowsClassic tabbed interface
ReproducibilityExcellent (workflow exported as JSON)Limited to the entered parameters
VRAM consumptionOptimized, handles small GPUs betterMore demanding at equal configuration
Learning curveSteeper (graph logic)More approachable for beginners
API automationNative and granularAPI present but less flexible
Recent models (Flux, SD3)Fast, reference-grade supportOften later support
Custom nodes / extensionsVery rich node ecosystemLarge extension catalog
Ideal use caseAdvanced pipelines and automationFast interactive generation

Deploying ComfyUI with a GPU

01

Prepare the GPU VPS

On a VPS with an NVIDIA GPU, install the drivers then the NVIDIA Container Toolkit so that Docker can access the GPU. Validate with docker run --rm --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi.

02

Run ComfyUI in a container

Start a ComfyUI image with GPU access and persistent volumes: docker run -d --gpus all -p 127.0.0.1:8188:8188 -v /opt/comfyui/models:/app/models -v /opt/comfyui/output:/app/output --name comfyui <image-comfyui>. Restricting to 127.0.0.1 avoids direct exposure.

03

Install the models

Drop your checkpoints into /opt/comfyui/models/checkpoints and your LoRAs into the corresponding folder. On the next interface refresh, ComfyUI automatically detects the new models.

04

Load a first workflow

Open the interface, load the default text-to-image workflow, select a checkpoint and launch a test generation to confirm that the GPU is indeed used (check with nvidia-smi).

05

Reverse proxy, SSL and authentication

ComfyUI has no native authentication. You absolutely must place Caddy or Nginx in front of port 8188 with Let's Encrypt HTTPS and basic auth, otherwise your GPU is open to everyone. Increase the proxy timeouts since generations can be long.

06

Lock down and expose

Close port 8188 at the firewall, then publish https://comfy.yourdomain.com. For automation, use the /prompt API to submit JSON workflows from your scripts.

To industrialize generation, leverage the API: submit your workflows via POST to /prompt and retrieve the results through the /ws WebSocket that notifies the end of each task. Combine this with the --lowvram flag at launch if your VPS has an 8 GB GPU: ComfyUI intelligently offloads the models to system RAM to avoid CUDA memory errors on large models.

Set up your remote ComfyUI studio

Image generation demands a GPU and generous storage for the checkpoints. The ServOrbit Cloud VPS offers the resources and preconfigured Docker to deploy ComfyUI and expose it securely.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.