How to Install ComfyUI on Ubuntu 24.04 — Node-Based Stable Diffusion on Your GPU VPS
ComfyUI is the most powerful way to run Stable Diffusion, SDXL, and FLUX on your own infrastructure. Instead of a simple prompt box, it gives you a node-based graph editor where every part of the generation pipeline — model loader, sampler, VAE, conditioning, ControlNet, upscaler — is a draggable block you wire together. This guide walks you through installing ComfyUI on an Ubuntu 24.04 GPU VPS from a clean SSH session to a production-hardened deployment serving SDXL and FLUX workflows through an authenticated HTTPS endpoint.
Need a GPU VPS first? ComfyUI is GPU-bound for any practical use. Deploy a CloudCore Business GPU plan starting at EUR 29.99/month with NVIDIA acceleration and spin through this tutorial end to end.
Table of Contents
What is ComfyUI?
ComfyUI is an open-source, node-based interface for diffusion models. Instead of hiding the generation pipeline behind a single prompt box like AUTOMATIC1111's WebUI, ComfyUI surfaces every step — checkpoint loading, CLIP text encoding, KSampler, VAE decode — as individual nodes you connect with wires. The result is a transparent, composable graph that you can save, share, and version as a JSON file.
ComfyUI supports the full modern diffusion stack. Stable Diffusion 1.5 and SD 2.1 run smoothly on modest GPUs. SDXL and SDXL Turbo produce 1024x1024 images with photorealistic detail. FLUX.1-schnell and FLUX.1-dev from Black Forest Labs deliver state-of-the-art prompt adherence and text rendering. Stable Video Diffusion and AnimateDiff animate still frames. ControlNet variants (Canny, Depth, OpenPose, Scribble) guide composition from reference images. IPAdapter and InstantID transfer style and identity across generations. LoRA, LyCORIS, and embeddings plug in as additional nodes.
The practical uses are broad. E-commerce teams generate on-brand product photography at scale. Marketing departments produce ad creative variations in seconds. Game studios iterate on concept art and texture maps. Solo creators build custom image pipelines that would cost thousands per month on a hosted service. Because every workflow is a JSON file, teams version-control their "pipelines" in git the same way they version code.
ComfyUI is written in pure Python on top of PyTorch. It is actively maintained by comfyanonymous and a large community, and the official documentation lives at docs.comfy.org.
Why Self-Host ComfyUI on a GPU VPS?
Paid image generation services like Midjourney, DALL-E, and hosted ComfyUI providers are convenient, but they come with compounding costs and real limitations. Running ComfyUI on your own GPU VPS gives you ownership of the entire pipeline.
- Unlimited generations at a flat monthly price. Hosted services charge per image or per credit. Once you generate more than a few hundred images a month, a GPU VPS is dramatically cheaper. Run a batch of 10,000 variations overnight without watching a billing meter.
- Complete creative control. You choose the base model, the LoRAs, the samplers, the schedulers, the custom nodes. Hosted services lock you into their curated list. Want to run an uncensored community checkpoint or a niche LoRA? Self-hosting is the only option.
- Workflow portability. A ComfyUI workflow is just JSON. You can commit it to a repo, share it in a Discord, or load it as a template. No vendor lock-in.
- API integration for real applications. ComfyUI's REST + WebSocket API means you can call it from any language. Build a product photo generator, a Discord bot, or an image-to-image batch tool without depending on a third-party SaaS.
- Data privacy. Your prompts, reference images, and generated outputs stay on your server. Critical for clients, NDAs, or anything proprietary.
- No content moderation filters. Hosted services block entire categories of creative work. On your own VPS you set the policy.
- Learning the full stack. Running ComfyUI locally teaches you how diffusion really works. Every node is a concrete step in the pipeline.
Cost Comparison: Hosted vs. Self-Hosted ComfyUI
| Scenario | Midjourney Standard | RunPod Serverless ComfyUI | Self-Hosted (CloudCore Business GPU) |
|---|---|---|---|
| Monthly base | $30/mo | Pay-per-second (~$0.0005/sec) | EUR 29.99/mo |
| Images per month (typical) | ~15 hrs fast | Varies by GPU | Unlimited |
| Cost at 5,000 images/mo | $30 + overage | ~$50-150 depending on GPU | EUR 29.99 flat |
| Custom models / LoRAs | No | Yes | Yes |
| Custom nodes / ControlNet | Limited | Yes | Yes |
| Uncensored / NSFW | No | Depends | Yes |
| API access | Limited | Yes | Yes (native) |
| Data leaves server? | Yes | Yes | No |
Prerequisites
Before you begin, make sure you have:
- A VPS running Ubuntu 24.04 LTS with root or sudo access
- An NVIDIA GPU attached to the VPS with at least 12 GB VRAM (RTX 3060 12GB, A4000, A10, A30, or better)
- At least 16 GB system RAM and 50 GB free disk space (models alone can consume 20+ GB)
- SSH access to your server
- Basic familiarity with the Linux command line
Recommended Plan: CloudCore Business GPU>
To run SDXL and FLUX comfortably with ComfyUI-Manager and a handful of custom nodes, we recommend the CloudCore Business GPU plan:>
- 8 vCPU cores
- 32 GB RAM
- NVIDIA GPU with 12-24 GB VRAM
- 200 GB NVMe SSD
- Unmetered bandwidth
- From EUR 29.99/month>
This handles SDXL 1024x1024 generations in 3-6 seconds, FLUX.1-schnell 4-step outputs in under 10 seconds, and leaves room for ControlNet, upscalers, and a couple of concurrent workflows.
Connect to your server via SSH to get started:
ssh root@your-server-ipStep 1: Update System Packages
Start with a fully patched base system. This avoids dependency conflicts when installing NVIDIA drivers and CUDA.
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git wget curl software-properties-commonIf the kernel was upgraded, reboot and reconnect:
sudo rebootStep 2: Install NVIDIA GPU Drivers
ComfyUI needs a working NVIDIA driver before anything else. Ubuntu 24.04 ships the ubuntu-drivers utility that picks the best recommended driver for your hardware.
sudo apt install -y ubuntu-drivers-common
sudo ubuntu-drivers installThis installs the recommended proprietary driver (typically the latest nvidia-driver-550 or newer). Reboot to load the kernel module:
sudo rebootAfter reconnecting, verify the driver is live:
nvidia-smiExpected output:
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15 Driver Version: 550.54.15 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
|=========================================+========================+======================|
| 0 NVIDIA RTX A4000 Off | 00000000:00:05.0 Off | N/A |
| 41% 35C P8 12W / 140W | 0MiB / 16376MiB | 0% Default |
+-----------------------------------------+------------------------+----------------------+Note the CUDA Version in the top right — the driver reports the maximum CUDA runtime it supports (here 12.4). You will match the PyTorch build to this version in Step 6.
Step 3: Install the CUDA Toolkit
The NVIDIA driver alone is enough for PyTorch to run inference, because PyTorch wheels ship with bundled CUDA libraries. However, installing the full toolkit lets you compile custom nodes that include CUDA kernels (xformers build-from-source, some ControlNet preprocessors) and gives you nvcc for debugging.
Add NVIDIA's CUDA apt repository:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install -y cuda-toolkit-12-4Add CUDA to your PATH by appending to ~/.bashrc:
echo 'export PATH=/usr/local/cuda-12.4/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrcVerify:
nvcc --versionExpected output:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131Step 4: Install Python 3.11 and Create a Virtual Environment
Ubuntu 24.04 ships Python 3.12, but ComfyUI and most custom nodes are best tested against Python 3.11. Install it from the deadsnakes PPA, which provides stable backports.
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.11 python3.11-venv python3.11-devCreate a dedicated system user for ComfyUI — never run it as root:
sudo useradd -m -s /bin/bash comfyui
sudo usermod -aG video,render comfyuiSwitch to the comfyui user and create a virtual environment in the home directory:
sudo -iu comfyui
python3.11 -m venv ~/venv
source ~/venv/bin/activateUpgrade the packaging tools inside the venv:
pip install --upgrade pip setuptools wheelFrom this point forward, every pip install happens inside the isolated venv.
Step 5: Clone the ComfyUI Repository
Clone the official repo from GitHub:
cd ~
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUIExpected layout:
ComfyUI/
├── comfy/ # Core engine
├── custom_nodes/ # Where custom node packs live
├── models/
│ ├── checkpoints/ # Main model files (SDXL, FLUX, SD1.5)
│ ├── loras/ # LoRA adapters
│ ├── vae/ # VAE weights
│ ├── controlnet/ # ControlNet models
│ ├── clip/ # Separate CLIP encoders (for FLUX)
│ └── clip_vision/
├── web/ # Browser UI assets
├── main.py # Entry point
└── requirements.txtPin to a known-good commit if you want stability, or stay on master for the latest features:
git log --oneline -5
Optional: git checkout <commit-hash>
Step 6: Install PyTorch with CUDA Support
This is the step most people get wrong. You must install the PyTorch wheel built for your CUDA version. With the driver reporting CUDA 12.4, use the cu124 index:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124This downloads roughly 2.5 GB of CUDA-enabled libraries. Verify that PyTorch sees the GPU:
python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"Expected output:
CUDA available: True
Device: NVIDIA RTX A4000If CUDA available is False, the wheel was built for a different CUDA version or the driver is not loaded. Reinstall matching the driver's reported CUDA version (cu121 for driver 525+, cu124 for driver 550+).
Optional: Install xFormers for Memory-Efficient Attention
xFormers reduces VRAM use by 20-40% on older GPUs and speeds up sampling. It is optional on modern cards where PyTorch's built-in scaled_dot_product_attention is already fast.
pip install xformers --index-url https://download.pytorch.org/whl/cu124Step 7: Install ComfyUI Python Dependencies
Install the remaining ComfyUI requirements:
cd ~/ComfyUI
pip install -r requirements.txtExpected tail of output:
Successfully installed aiohttp-3.9.5 einops-0.8.0 kornia-0.7.3 pillow-10.4.0 psutil-6.0.0 pyyaml-6.0.2 safetensors-0.4.4 scipy-1.14.0 tqdm-4.66.5 transformers-4.44.2 ...This installs roughly 30 packages including transformers, safetensors, kornia, and einops. Total install size is about 1 GB on top of PyTorch.
Step 8: Download Your First Model Checkpoints
ComfyUI needs at least one checkpoint to generate anything. Models are not bundled — you download them into models/checkpoints/. We will grab two: SDXL for classic diffusion, and FLUX.1-schnell for state-of-the-art prompt following.
SDXL Base 1.0 (~6.9 GB)
cd ~/ComfyUI/models/checkpoints
wget -c https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensorsFLUX.1-schnell (~23 GB, fp8 variant is smaller)
For the lighter fp8 version that fits in 12 GB VRAM:
cd ~/ComfyUI/models/checkpoints
wget -c https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensorsFLUX also needs separate CLIP and VAE files. Place them in the matching folders:
# CLIP encoders for FLUX
cd ~/ComfyUI/models/clip
wget -c https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
wget -c https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensorsFLUX VAE
cd ~/ComfyUI/models/vae
wget -c https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensorsSome FLUX files require you to accept the license on Hugging Face. Ifwgetreturns a 401, create a free HF account, accept the model card, create a read token, and usewget --header="Authorization: Bearer hf_yourtoken".
Verify the files landed:
ls -lh ~/ComfyUI/models/checkpoints/Step 9: Launch ComfyUI for the First Time
From the activated venv, start the server and bind to all interfaces so you can reach it from your browser:
cd ~/ComfyUI
python main.py --listen 0.0.0.0 --port 8188Expected output:
** ComfyUI startup time: 2026-04-16 10:00:00.000000 ** Platform: Linux ** Python version: 3.11.9 ** Python executable: /home/comfyui/venv/bin/python ** Log file: /home/comfyui/ComfyUI/comfyui.log Total VRAM 16376 MB, total RAM 32098 MB pytorch version: 2.4.0+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA RTX A4000 : cudaMallocAsync Using pytorch attention Starting server
To see the GUI go to: http://0.0.0.0:8188
Open http://your-server-ip:8188 in your browser. You should see the default ComfyUI graph with Load Checkpoint, CLIP Text Encode, KSampler, VAE Decode, and Save Image nodes already wired.
Security note: --listen 0.0.0.0 exposes the UI to the internet with no authentication. Use it only for initial setup, then restrict access via firewall or reverse proxy in Step 14.Stop the server with Ctrl+C once you have confirmed it loads.
Step 10: Install ComfyUI-Manager
ComfyUI-Manager is a custom node that turns ComfyUI into a self-updating, self-installing platform. It adds a "Manager" button to the UI where you can browse and install custom nodes, download models directly from Hugging Face/Civitai, and update ComfyUI itself.
Clone it into custom_nodes/:
cd ~/ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
cd ComfyUI-Manager
pip install -r requirements.txtRestart ComfyUI:
cd ~/ComfyUI
python main.py --listen 0.0.0.0Reload the browser — you will see a new Manager button in the right-side menu. Click it to open the node and model registry.
Step 11: Your First Text-to-Image Workflow
In the ComfyUI UI you should see the default text-to-image graph. Walk through the nodes:
ckpt_name to sd_xl_base_1.0.safetensors.A photorealistic portrait of a golden retriever on a sunlit beach, 85mm lens, shallow depth of field.blurry, watermark, text, low quality, deformed.width=1024, height=1024, batch_size=1.sampler_name=euler, scheduler=normal, steps=20, cfg=7.0.ComfyUI/output/.Click Queue Prompt in the right panel. On an RTX A4000, a 1024x1024 SDXL image completes in about 4-6 seconds. The output appears below the Save Image node.
Switch to FLUX.1-schnell
FLUX uses a separate CLIP and VAE rather than the all-in-one SDXL checkpoint. The easiest path is to load the example FLUX workflow from the Manager:
FLUX schnell.flux1-schnell-fp8.safetensors.FLUX renders dramatically better text in images and follows complex prompts more faithfully than SDXL.
Step 12: Add ControlNet Custom Nodes
ControlNet lets you steer diffusion with reference images: edge maps, depth maps, poses. It is the building block for consistent character generation, product photo composition, and img2img pipelines.
Via ComfyUI-Manager:
ControlNet Preprocessors, install comfyui_controlnet_aux by Fannovel16.controlnet sdxl canny, download controlnet-canny-sdxl-1.0.safetensors (~2.5 GB) into models/controlnet/.In the graph:
Other high-value custom nodes to install via the manager:
ComfyUI_IPAdapter_plus— style and identity transfer from reference images.was-node-suite-comfyui— 200+ utility nodes (text tools, math, image ops).efficiency-nodes-comfyui— combines common node sequences into compact blocks.ComfyUI-Impact-Pack— face detailer, segmentation, inpainting helpers.ComfyUI-AnimateDiff-Evolved— animate stills into short video clips.
Step 13: Create a systemd Service
Launching ComfyUI by hand every reboot does not scale. Package it as a systemd service that auto-starts on boot, restarts on crash, and logs to journald.
Exit back to your sudo user:
exit # leave the comfyui shellCreate the unit file:
sudo tee /etc/systemd/system/comfyui.service > /dev/null <<'EOF' [Unit] Description=ComfyUI Stable Diffusion Node Server After=network-online.target Wants=network-online.target[Service] Type=simple User=comfyui Group=comfyui WorkingDirectory=/home/comfyui/ComfyUI Environment="PATH=/home/comfyui/venv/bin:/usr/local/cuda-12.4/bin:/usr/bin:/bin" Environment="LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64" Environment="PYTHONUNBUFFERED=1" ExecStart=/home/comfyui/venv/bin/python /home/comfyui/ComfyUI/main.py --listen 127.0.0.1 --port 8188 Restart=on-failure RestartSec=10
Resource limits
LimitNOFILE=65536Security hardening
NoNewPrivileges=true PrivateTmp=true ProtectSystem=full ProtectHome=read-only ReadWritePaths=/home/comfyui/ComfyUI
[Install] WantedBy=multi-user.target EOF
Note that we bind to 127.0.0.1 now — public access will come through Nginx in the next step.
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now comfyui
sudo systemctl status comfyuiExpected status output:
● comfyui.service - ComfyUI Stable Diffusion Node Server
Loaded: loaded (/etc/systemd/system/comfyui.service; enabled; preset: enabled)
Active: active (running) since Wed 2026-04-16 10:20:00 UTC; 5s ago
Main PID: 12345 (python)
Tasks: 15 (limit: 38412)
Memory: 1.8G
CPU: 14.7sTail the logs to confirm it bound successfully:
sudo journalctl -u comfyui -fStep 14: Secure with Nginx Reverse Proxy
ComfyUI has no built-in authentication. Exposing port 8188 directly on a public IP is a liability — anyone who finds it can enqueue jobs on your GPU. Put it behind Nginx with HTTPS and HTTP Basic Auth.
Install Nginx and the htpasswd utility:
sudo apt install -y nginx apache2-utils certbot python3-certbot-nginxCreate an auth file:
sudo htpasswd -c /etc/nginx/.comfyui-htpasswd comfyuserYou will be prompted for a password.
Write the site config — ComfyUI uses WebSockets for live progress, so we need Upgrade headers and long timeouts:
sudo tee /etc/nginx/sites-available/comfyui > /dev/null <<'EOF' server { listen 80; server_name comfy.yourdomain.com; return 301 https://$host$request_uri; }server { listen 443 ssl http2; server_name comfy.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/comfy.yourdomain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/comfy.yourdomain.com/privkey.pem;
# Generations can return large images client_max_body_size 100m;
# Security headers add_header X-Content-Type-Options nosniff; add_header X-Frame-Options SAMEORIGIN; add_header Referrer-Policy strict-origin-when-cross-origin;
location / { auth_basic "ComfyUI"; auth_basic_user_file /etc/nginx/.comfyui-htpasswd;
proxy_pass http://127.0.0.1:8188; proxy_http_version 1.1;
# WebSocket upgrade (required for live progress bar) proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
# Standard proxy headers proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
# Long timeouts — generations can take minutes proxy_read_timeout 600s; proxy_send_timeout 600s; proxy_buffering off; } } EOF
sudo ln -s /etc/nginx/sites-available/comfyui /etc/nginx/sites-enabled/ sudo nginx -t
Point your domain's A record at the VPS IP, then obtain a certificate:
sudo certbot --nginx -d comfy.yourdomain.com
sudo systemctl reload nginxLock down the firewall so only HTTPS (and SSH) are public:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw deny 8188
sudo ufw enableYour ComfyUI instance is now at https://comfy.yourdomain.com behind Basic Auth.
Step 15: Use the ComfyUI API
Every workflow you build in the browser is a JSON graph. You can POST that same JSON to /prompt and trigger generations from any language. The full API lives at port 8188 (now proxied through your HTTPS endpoint).
Export a workflow as API JSON
In the ComfyUI UI, open Settings (gear icon) and enable Dev mode options. A new Save (API Format) button appears in the right panel. Click it to download workflow_api.json.
Queue a prompt via curl
curl -u comfyuser:yourpassword -X POST https://comfy.yourdomain.com/prompt \
-H "Content-Type: application/json" \
-d @workflow_api.jsonExpected response:
{
"prompt_id": "c1f2e3d4-5678-90ab-cdef-112233445566",
"number": 1,
"node_errors": {}
}Poll for results
curl -u comfyuser:yourpassword \
https://comfy.yourdomain.com/history/c1f2e3d4-5678-90ab-cdef-112233445566The response includes the output filename. Fetch the image itself:
curl -u comfyuser:yourpassword \
"https://comfy.yourdomain.com/view?filename=ComfyUI_00001_.png&type=output" \
-o result.pngFor real-time progress, connect to the WebSocket at wss://comfy.yourdomain.com/ws. Libraries like websockets in Python or ws in Node.js handle this in a few lines. The official ComfyUI API examples include a full Python script that submits workflows, listens on the WS, and downloads outputs.
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
torch.cuda.is_available() returns False | PyTorch wheel does not match CUDA version | Reinstall matching driver's CUDA: pip install torch --index-url https://download.pytorch.org/whl/cu124 |
CUDA out of memory on SDXL | Too high resolution or batch size | Lower to 768x768, batch_size=1, or launch with python main.py --lowvram |
Model not found in Load Checkpoint | Wrong folder, case-sensitive filename, or file still downloading | Verify with ls -lh ~/ComfyUI/models/checkpoints/ and refresh the browser |
| ComfyUI UI loads but Queue Prompt does nothing | WebSocket blocked by proxy | Confirm Upgrade and Connection: upgrade headers in Nginx config |
Service fails with ModuleNotFoundError | systemd uses different Python | Set ExecStart to the full path /home/comfyui/venv/bin/python |
nvidia-smi works but xformers fails | Version mismatch with torch | Reinstall xformers from the same cu124 index or uninstall it — ComfyUI runs fine without |
| Slow first generation, fast after | Model compile + load into VRAM | Expected behavior; add --preview-method auto and keep the model loaded |
| Custom node breaks ComfyUI on startup | Bad install or Python incompatibility | Rename the offending folder in custom_nodes/ to disable, restart, then reinstall via Manager |
Checking Logs
sudo journalctl -u comfyui -f --no-pager
sudo journalctl -u comfyui -n 200 --no-pagerVRAM Profiles
ComfyUI accepts runtime flags to adapt to different GPUs:
--highvram— keep models resident, fastest on 24GB+ cards--normalvram— default behavior--lowvram— aggressive offload, for 8-12GB cards running SDXL--novram— CPU + VRAM swap, for tiny GPUs (slow)--cpu— no GPU at all (very slow, test only)
FAQ
Can I run ComfyUI without a GPU?
Technically yes, ComfyUI accepts a --cpu flag. Practically, no. SDXL at 1024x1024 takes 2-4 seconds on an RTX A4000 but 4-8 minutes on CPU. FLUX is worse. Unless you are only testing node wiring, you need an NVIDIA GPU with at least 8 GB VRAM, and 12 GB+ is strongly recommended for SDXL and FLUX. A CloudCore Business GPU plan includes this out of the box.
How much VRAM do I actually need for SDXL and FLUX?
SDXL at 1024x1024 needs roughly 10 GB of VRAM with default settings, or 6 GB with --lowvram. FLUX.1-schnell in fp8 fits in 12 GB comfortably. Full fp16 FLUX.1-dev wants 16 GB or more for smooth operation. Running ControlNet, IPAdapter, and an upscaler in the same workflow can push VRAM use another 4-6 GB, which is why 16-24 GB cards are the sweet spot for serious ComfyUI use.
Why choose ComfyUI over AUTOMATIC1111 WebUI?
ComfyUI exposes the full diffusion pipeline as explicit nodes, giving you precise control over every step. It is measurably faster, uses less VRAM for the same output, supports FLUX and newer models on day one, and workflows are portable JSON files you can commit to git. AUTOMATIC1111's Stable Diffusion WebUI is friendlier for beginners who just want to prompt, but it hides the mechanics and updates more slowly. Most power users eventually migrate to ComfyUI once they need ControlNet chains, custom pipelines, or API access.
Is ComfyUI safe to expose to the public internet?
Not by default. ComfyUI has no authentication and anyone who can reach port 8188 can queue jobs on your GPU or download your model files. Always put it behind an Nginx reverse proxy with HTTPS and HTTP Basic Auth (as in Step 14), restrict access by IP with UFW, or tunnel it over a Wireguard VPN. Never leave --listen 0.0.0.0 open on a public IP without protection.
What is ComfyUI-Manager and do I need it?
ComfyUI-Manager is a custom node that adds a package manager to the ComfyUI interface. From a single panel you can install custom nodes, download models from Hugging Face and Civitai, update ComfyUI itself, and roll back broken installs. It is not strictly required — you can git clone every custom node manually — but almost every production ComfyUI deployment installs it. The 30 seconds it takes to install pays off the first time you want to try a new node pack.
Can I call ComfyUI from my own application?
Yes. ComfyUI exposes a REST API and WebSocket on port 8188. You POST a workflow JSON to /prompt, listen for executing, progress, and executed events on /ws, then fetch the output via /view. The API is what powers community tools like ComfyUI-to-Python-Extension, Discord bots, and SaaS image generation products. See script_examples/ in the ComfyUI repo for reference Python clients.
How do I install custom nodes like ControlNet, IPAdapter, or AnimateDiff?
The recommended way is through ComfyUI-Manager: click Manager → Install Custom Nodes, search for the pack, click Install, then Restart. For manual installs, cd ~/ComfyUI/custom_nodes, git clone the repo, activate the venv, and pip install -r requirements.txt if one is present. Restart the ComfyUI systemd service with sudo systemctl restart comfyui to pick up the new nodes.
Next Steps
Now that you have ComfyUI running as a production service, extend the setup:
- Add AUTOMATIC1111 WebUI alongside — some LoRAs and community workflows target A1111 first. Install Stable Diffusion WebUI on Ubuntu on the same box and share the
models/folder via symlinks. - Pair with a local LLM for captioning and prompt engineering — install Ollama to run Llama 3.1 for prompt generation and image captioning entirely on your VPS.
- Run a dedicated text inference server — vLLM handles high-throughput LLM inference if you want an OpenAI-compatible endpoint next to ComfyUI.
- Add fast CPU inference with llama.cpp — llama.cpp complements GPU workloads with efficient CPU-based model serving.
- Build a Discord image bot — use
discord.pyto POST prompts to the ComfyUI API and return images to channels. The API-first design makes this a weekend project. - Schedule batch generations — a simple cron job can queue overnight batches of thousands of images from a CSV of prompts.
- Version-control your workflows — commit your
workflow_api.jsonfiles to git so your team can reuse pipelines and track changes over time.
Ready to run ComfyUI in production?>
Our CloudCore Business GPU plans start at EUR 29.99/month and include the NVIDIA GPU, NVMe storage, and unmetered bandwidth you need for SDXL and FLUX workflows. Deploy, follow this guide, and you can be generating images in under an hour.>
See GPU VPS plans — white-label friendly, deploy in minutes.