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.
Hover the price to reveal the full breakdown, especially internet bandwidth:
If that TB cost looks wild, filter it down first:
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.).
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.
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
Then launch ComfyUI from the portal and confirm the UI loads.
If the UI opens, you’re golden:
Step 4 — Load models (three practical paths)
Option A: ComfyUI Manager (GUI-first)
Use the Manager inside ComfyUI to install a downloader node:
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
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:
- 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:
- 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.
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
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:
- Open ComfyUI and load a simple text-to-image graph
- Set batch_size=1 and 768x768 (or lower if VRAM is tight)
- Generate and confirm images land in /workspace/ComfyUI/output
- 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
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)