DEV Community

Cover image for Spin Up ComfyUI on Vast.ai Without Surprises: A Practical, Developer-First Guide
Prompting Pixels
Prompting Pixels

Posted on

Spin Up ComfyUI on Vast.ai Without Surprises: A Practical, Developer-First Guide

What we're building

I needed a beefy GPU for ComfyUI experiments and my laptop tapped out fast. Instead of building a home lab, I deployed ComfyUI on Vast.ai, added models, and kept the bill under control. In this tutorial, we’ll do the same—end to end—while avoiding hidden bandwidth fees and common gotchas.

We’ll:

  • Rent a GPU on Vast.ai (aff. link) and choose the right pricing
  • Use the official ComfyUI template with sensible storage
  • Load models using three different methods (GUI, terminal, and a one-liner generator)
  • Pull down generated images efficiently
  • Keep runtime costs predictable and know when to stop/destroy
  • Troubleshoot with a developer’s toolkit (CLI, logs, and sanity checks)

TL;DR (Quick Reference)

  • Pick a GPU with ≥24GB VRAM for comfy workflows; watch for bandwidth $/TB
  • Use the official “ComfyUI” template; give yourself ~200GB disk
  • Launch → Open → Launch ComfyUI and Jupyter Terminal
  • Models go under /workspace/ComfyUI/models/... (checkpoints, loras, vae, etc.)
  • Press R in ComfyUI to reload models after adding files
  • Stop to keep storage; Destroy to stop all billing (you’ll lose data)
  • Troubleshoot: check nvidia-smi, disk, memory, and ComfyUI logs

Hint: If you only read one thing: hover the Vast.ai price to see bandwidth cost per TB. Don’t pay $20+/TB by accident.


Step 1 — Pick a GPU without getting burned by bandwidth

On Vast.ai, go to Console → Search. Filter for GPUs that match your needs. For most ComfyUI workflows:

  • RTX 4090 / 5090: excellent performance for SD/Flux-style pipelines
  • RTX 3090 (24GB VRAM): great value and compatible with many models
  • RTX PRO 6000: workstation-level headroom; fewer compromises

You’ll see rates per hour—but that’s not the whole story.

Vast.ai web UI screenshot: left sidebar and ComfyUI template panel with 200 GB slider; right column lists rentable GPU hosts (RTX A2000, GTX 1660, RTX 3070) and Rent buttons.

Hover the price to reveal the full breakdown, especially internet bandwidth:

Vast.ai console screenshot: GPU offers list, left panel with 200 GB slider, and Price Breakdown popup pointing to Internet $20.000/TB

If that TB cost looks wild, filter it down first:

Vast.ai console GPU marketplace screenshot with left filter panel showing sliders; red arrow points to TB (Download) slider at $0.20; right column lists RTX instances with RENT buttons.

Warning: If you plan to download large models (Flux, Wan, Hunyuan Video, or multiple SDXL variants), bandwidth costs can exceed compute costs. Pick a host with cheap $/TB.


Step 2 — Use the official ComfyUI template and set storage once

Before clicking Rent, click Change Template and search for “ComfyUI”. Choose the official Vast.ai ComfyUI template (it comes with CUDA, Jupyter, SSH, etc.).

Modal on cloud.vast.ai showing 'Select template' with three template cards; a red arrow labeled 'Select this template' points to the left 'ComfyUI' card (tags Cuda 12.4, SSH, Jupyter)

Storage sizing guidelines:

  • 100GB minimum: barebones experiments
  • 200GB recommended: several models + comfy headroom
  • 300GB+: lots of checkpoints, LoRAs, and video models

Pick now—resizing later means recreating the instance.


Step 3 — Launch, then sanity-check the machine

Click Rent, then open Instances and wait for the Open button.

Vast.ai console screenshot showing left 'Instances' menu highlighted and a 1x RTX 5090 instance card with an Open button and red arrows labeled 'Click on Instances' and 'Access the instance portal'.

Open → you’ll see app launchers. Start with Jupyter Terminal and run quick checks:

# GPU and driver
nvidia-smi

# RAM and disk
free -h
df -h /workspace

# ComfyUI folder structure present?
ls -la /workspace/ComfyUI
Enter fullscreen mode Exit fullscreen mode

Then launch ComfyUI from the portal and confirm the UI loads.

Vast.ai Applications portal screenshot showing app cards. Red arrow points to ComfyUI's blue Launch Application button; sidebar shows NVIDIA GeForce RTX 5090.

If the UI opens, you’re golden:

Dark-mode web UI showing a Templates gallery panel with search bar and filters, left category sidebar, and template cards titled 'Nano Banana Pro', 'ChronoEdit 14B', 'LTX-2: Text to Video' and 'LTX-2: Image to Video'


Step 4 — Load models (three practical paths)

Option A: ComfyUI Manager (GUI-first)

Use the Manager inside ComfyUI to install a downloader node:

Dark ComfyUI downloader catalog; search 'downloader' shows 17 items in a table with IDs, titles, versions, actions and Install buttons.

  • Open ComfyUI → Manager

  • Custom Nodes Manager → search “ComfyUI Model Downloader”

  • Install and use it to pull from Hugging Face / CivitAI

  • It places files in correct subfolders automatically

Press R in ComfyUI to reload model lists.

Option B: Jupyter Terminal (fast and explicit)

From the instance portal, open Jupyter Terminal and drop models into the right paths.

Common directories:

  • Base checkpoints: /workspace/ComfyUI/models/checkpoints
  • LoRAs: /workspace/ComfyUI/models/loras
  • VAE: /workspace/ComfyUI/models/vae
  • CLIP/Text encoders: /workspace/ComfyUI/models/clip
  • Upscalers: /workspace/ComfyUI/models/upscale_models
  • ControlNet: /workspace/ComfyUI/models/controlnet

Examples:

# Example: download a checkpoint with curl (auto-follow redirects)
cd /workspace/ComfyUI/models/checkpoints
curl -L -o model.safetensors "https://huggingface.co/.../resolve/main/model.safetensors"

# Faster parallel downloader (aria2c)
aria2c -x 16 -s 16 -k 1M -o model.safetensors "https://huggingface.co/.../resolve/main/model.safetensors"

# Hugging Face CLI (requires token for gated repos)
pip install -q huggingface_hub
huggingface-cli login --token $HF_TOKEN
huggingface-cli download ORG/REPO --include "*.safetensors" --local-dir /workspace/ComfyUI/models/checkpoints
Enter fullscreen mode Exit fullscreen mode

Then reload the UI:

  • Focus the ComfyUI tab and press R

Option C: One-liner setup via AI Launcher

If you want a single script that installs everything (ComfyUI + models + custom nodes), this is the smoothest path:

Prompting Pixels AI Launcher UI: welcome panel, Vast.ai selected, installation wget one-liner with hf token, Deploy buttons for RunPod and Vast.ai

  • Visit https://promptingpixels.com/deploy
  • Choose Vast.ai
  • Pick models (HF / CivitAI) and custom nodes
  • Copy the generated one-liner
  • Paste it into Jupyter Terminal once your instance is up
  • Done—everything lands in the correct folders automatically

Note: I personally love the AI Launcher @ Prompting Pixels as it makes it super easy to config without wasting money while the Instance is active. Plus you can reuse the config again and again.


Step 5 — Generate and pull down your images

ComfyUI saves outputs under /workspace/ComfyUI/output. Use Jupyter to grab files:

Jupyter file browser showing ComfyUI/output with three selected items: _output_images_will_be_put_here and two SD1.5 PNGs; toolbar Open/Download/Duplicate/Trash.

  • Open Jupyter from the portal
  • Browse: workspace → ComfyUI → output
  • Select and Download single or multiple files

Extras:

# Zip a whole run for one-click download
cd /workspace/ComfyUI/output
zip -r run_$(date +%F_%H%M).zip .

# Prefer syncing? Launch Syncthing from the portal and pair with your desktop.
Enter fullscreen mode Exit fullscreen mode

Cost control and lifecycle

Think of your instance in two states:

  • Running: you pay hourly compute + bandwidth
  • Stopped: compute stops, you pay a small daily storage fee to keep the disk

When you’re done for the day:

  • Stop if you’ll resume soon (keeps data, small daily fee)
  • Destroy to end all billing (deletes everything)

Example numbers I’ve seen:

  • ~0.39/hour compute (varies by GPU)
  • ~1.30/day storage when stopped (adjusts with disk size and host)

Always check per-host pricing breakdown.


Debugging and diagnostics (do these first)

When something feels off, open Jupyter Terminal and run:

# Is the GPU accessible?
nvidia-smi

# Enough disk space?
df -h /workspace

# Which folders are consuming space?
du -h -d 1 /workspace/ComfyUI/models | sort -h

# See ComfyUI logs (adjust if your template logs somewhere else)
ps -ef | grep -i comfy
tail -n 200 /workspace/ComfyUI/logs/*.log 2>/dev/null || echo "No logs found here"

# Network sanity (if downloads are failing)
curl -I https://huggingface.co
Enter fullscreen mode Exit fullscreen mode

Common issues and fixes:

  • Models not showing up: files in wrong folder; press R to refresh model lists

  • Out of memory during generation:

    • Lower resolution or batch size
    • Use a smaller model or quantized variant if available
    • Remove redundant nodes in the graph
    • Consider a GPU with more VRAM
  • Can’t open ComfyUI after launch:

    • Wait 60–90 seconds; services might still be booting
    • Refresh the browser
    • Check instance status in Vast.ai
    • Confirm local firewall isn’t blocking
  • Disk full mid-run:

    • Zip and download outputs
    • Destroy and recreate with larger storage (resizing isn’t supported mid-flight)
    • Or spin a new instance and migrate using the portal copy/move tools

Hint: I’ve occasionally hit a “bad” host. If everything looks right but services won’t behave, destroy and pick a different provider—datacenter GPUs tend to be more consistent.


Things I wish I knew earlier

  • Press R inside ComfyUI to reload models—no restart required

  • Bandwidth $/TB can dwarf your hourly rate if you fetch large models often

  • 200GB is a sweet spot unless you’re hoarding multiple SDXL/Flux/Video models

  • aria2c is notably faster than curl/wget for big downloads

  • Stopping your instance preserves data cheaply—great for weekend projects

  • Syncthing is built into the portal; it’s convenient for background syncs


Example: quick test workflow

Once models are in place:

  1. Open ComfyUI and load a simple text-to-image graph
  2. Set batch_size=1 and 768x768 (or lower if VRAM is tight)
  3. Generate and confirm images land in /workspace/ComfyUI/output
  4. Zip outputs and download

Quick CLI snippets

# Create folders just in case
mkdir -p /workspace/ComfyUI/models/{checkpoints,loras,vae,clip,upscale_models,controlnet}

# Validate a model file after download
ls -lh /workspace/ComfyUI/models/checkpoints/*.safetensors
sha256sum /workspace/ComfyUI/models/checkpoints/*.safetensors | head

# Clean old outputs to free space
find /workspace/ComfyUI/output -type f -mtime +7 -print -delete
Enter fullscreen mode Exit fullscreen mode

Gotchas (so you don’t have to learn them the hard way)

  • You can’t resize disk on a running instance; plan storage up front

  • Some providers throttle bandwidth—aria2c with multiple connections helps

  • If the portal shows ComfyUI “running” but the page won’t load, wait. The server can still be warming up

  • Gated models on Hugging Face require a token (HF_TOKEN) and huggingface-cli login

  • LoRA and VAE folders are separate—don’t drop everything into checkpoints


What’s next

  • Add ControlNet workflows and experiment with video models on bigger GPUs

  • Automate model syncing with a bootstrap script or dotfiles

  • Expose the ComfyUI API and script batch jobs from your local machine

  • Try other clouds and compare $/hr + $/TB to build your own cost model

  • Containerize your custom nodes so you can lift-and-shift between hosts easily

Happy building—and may your bandwidth be cheap and your VRAM plentiful!

Top comments (0)