How to Run ComfyUI on Vast.ai: A Complete Setup Guide
You don’t need a pricey local GPU to build powerful ComfyUI workflows. In this guide, you’ll learn how to spin up ComfyUI on Vast.ai step by step—selecting budget-friendly GPUs, dialing in storage, launching the official template, and adding models fast. Follow along to optimize costs and get creating in minutes.
What You'll Learn
This step-by-step guide shows how to run ComfyUI on Vast.ai, from choosing cost‑effective GPUs and avoiding hidden bandwidth fees to configuring the official template and storage. It walks you through launching your instance, accessing ComfyUI, and adding models via ComfyUI Manager, Jupyter Terminal, or AI Launcher. You’ll also learn practical tips for retrieving outputs and keeping costs under control.
How to Run ComfyUI on Vast.ai: A Complete Setup Guide
If your local machine lacks the GPU power for ComfyUI, cloud-based GPU services offer an excellent alternative. Vast.ai stands out as a particularly cost-effective option, connecting you to GPUs worldwide at competitive rates.
This tutorial walks you through setting up ComfyUI on Vast.ai from start to finish!
Prerequisites
Before diving in, you'll need two things:
-
A Vast.ai account (create one at vast.ai)
-
Sufficient credits in your Vast.ai balance
Finding and Selecting Your GPU
After logging into your Vast.ai account, navigate to the Console in the upper right corner and proceed to the Search section. You'll encounter an extensive list of available GPUs from providers around the globe.
For ComfyUI workflows, most modern high-end consumer GPUs will suffice. Here's what to consider:
-
RTX PRO 6000 — Workstation grade GPU that can fit all models without quantization
-
RTX 4090 or RTX 5090 series — Excellent performance for standard workflows
-
RTX 3090 (24GB VRAM) — Great value for most use cases
Important Cost Considerations
When reviewing GPU listings, pay close attention to the complete pricing structure. While you might see an attractive hourly rate like $0.38/hour, The provder of the GPU may charge additional bandwidth fees that can significantly impact your total cost:

Critical tip: Hover over the pricing to reveal bandwidth costs, which can reach $20+ per terabyte transferred. When working with large models like Flux, Wan, Qwen Image, or Hunyuan Video, these transfer fees can quickly take a chunk out of your account balance.

That's insane!
To find more cost-effective options, adjust your search filters to prioritize lower bandwidth costs before making your selection.

Configuring Your Instance
Before clicking that "Rent" button, you need to select the appropriate template.
Click on Change Template and search for "ComfyUI" in the template marketplace. Select the official Vast.ai ComfyUI template — it's reliable and comes pre-configured with essential dependencies.

Storage Configuration
Adjust your container disk size based on your needs:
-
100GB minimum — Sufficient for basic setups
-
200GB recommended — Provides comfortable headroom for multiple models
-
300GB+ — Ideal for extensive model collections and custom nodes
For this guide, we'll allocate 200GB to balance cost and functionality.
Launching Your Instance
Once you've selected your GPU and configured the template, click Rent. Navigate to the Instances section in the left sidebar to monitor your machine's initialization:

The boot process typically completes within 2-4 minutes. You'll know your instance is ready when the "Open" button appears.
Accessing ComfyUI
Click the Open button on your instance to launch the Vast.ai portal. This dashboard provides access to multiple applications:
-
ComfyUI interface
-
API wrapper
-
Jupyter Notebook
-
Jupyter Terminal
-
Syncthing
Click Launch Application next to ComfyUI to open the workspace:

Congratulations! You now have ComfyUI running on a powerful cloud GPU:

Adding Models to Your Instance
The default template includes a couple of starter models (RealVision and Stable Diffusion 1.5), but you'll likely want to add your own.
Method 1: ComfyUI Manager

The ComfyUI Manager provides a user-friendly approach:
- Open the Manager interface within ComfyUI
- Navigate to Custom Nodes Manager
- Search for "ComfyUI Model Downloader"
- Install the node
- Use it to download models from Hugging Face or Civitai
- The downloader automatically maps files to the correct ComfyUI directories
Method 2: Jupyter Terminal
For those comfortable with command-line interfaces:
- Return to the Vast.ai instance portal
- Click Launch Application for Jupyter Terminal
- Use wget or curl commands to download models directly:
bash
cd /workspace/ComfyUI/models/checkpoints
wget [YOUR_MODEL_URL]
If you're unsure about the exact commands, any modern AI assistant can help you construct the appropriate bash scripts for downloading from Hugging Face or Civitai.
Method 3: AI Launcher @ Prompting Pixels

For the most streamlined setup experience, AI Launcher generates a complete installation script tailored to your exact specifications.
Show Image
Here's how to use it:
- Visit the AI Launcher at promptingpixels.com/deploy
- Select Vast.ai as your provider
- Browse and add models from HuggingFace or CivitAI using the model browser
- Select any custom nodes you need for your workflows
- Copy the generated one-liner script
Once your Vast.ai instance has booted, open the Jupyter Terminal from the instance portal and paste the script. AI Launcher handles everything automatically—installing ComfyUI, downloading your selected models to the correct directories, and configuring your custom nodes.
Retrieving Your Generated Images
ComfyUI doesn't offer a built-in bulk download feature, so you'll need an alternative method to collect your creations.
Using Jupyter Notebook:

- Go back to your instance portal
- Click Launch Application under Jupyter
- Navigate through the directory structure: - workspace → ComfyUI → output
- Your generated images appear in this folder
- Right-click to download individual files, or select multiple images and download them together
- This workflow allows you to efficiently manage and retrieve all your outputs from the cloud environment.
Managing Costs and Instance Control
Vast.ai's pricing structure offers flexibility based on your usage pattern:
Active Instance: Approximately $0.39/hour (varies by GPU selected)
Stopped Instance: Around $1.30/day for storage retention:
When you're finished with a session, you have two options:
-
Stop the instance to pause billing while maintaining your setup and files
-
Destroy the instance completely to eliminate all costs (you'll lose any custom configurations)
To stop your instance, simply navigate to your instance dashboard and click the Stop button.
Troubleshooting Common Issues
Models Not Appearing in ComfyUI
Verify that downloaded files are located in the correct directories:
-
Base models:
ComfyUI/models/checkpoints -
LoRAs:
ComfyUI/models/loras -
VAE models:
ComfyUI/models/vae -
CLIP/Text encoders:
ComfyUI/models/clip -
Upscale models:
ComfyUI/models/upscale_models -
ControlNet:
ComfyUI/models/controlnet
After adding models, refresh ComfyUI by pressing R on your keyboard within the workspace.
Memory Errors During Generation
If you encounter out-of-memory errors, you have several options:
-
Switch to a GPU with more VRAM
-
Reduce your batch size
-
Use lower-resolution outputs
-
Optimize your workflow by removing unnecessary nodes
-
Consider quantized model versions when available
Connection Issues
If you can't access ComfyUI after launching:
-
Wait 60-90 seconds — the service may still be initializing
-
Refresh your browser
-
Check the Vast.ai instance status to ensure it's fully running
-
Verify your firewall isn't blocking the connection
Note: There has been on occasion that I simply got a "bad machine" and had to destroy it and start again. I have noticed that datacenter GPUs tends to fail less often.
Expanding Storage Mid-Project
If you run out of space, you can't resize a running instance. Instead:
- Save any important outputs via Jupyter
- Stop the current instance
- Create a new instance with larger storage
- Transfer any essential files by using the Vast copy/move commands in the instances page.
Final Thoughts
Vast.ai provides an economical gateway to powerful GPU computing for ComfyUI users. By leveraging their global marketplace, you can access high-performance hardware at competitive rates while paying only for what you use.
Remember to monitor your bandwidth usage alongside compute time to keep costs predictable, and always stop or destroy instances when you're not actively generating to avoid unnecessary charges.
Happy creating!
Want More AI Image Tutorials?
Get the best AI image tutorials and tool reviews—no spam, just 1 or 2 helpful emails a month.
Continue Learning
More ComfyUI Tutorials
Explore additional tutorials in the ComfyUI category.
View All Tutorials