ComfyUI

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.

Prompting Pixels

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:

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.

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.

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

That's insane!

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

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.

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.

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 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:

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'.

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:

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

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

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'

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

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

The ComfyUI Manager provides a user-friendly approach:

  1. Open the Manager interface within ComfyUI
  2. Navigate to Custom Nodes Manager
  3. Search for "ComfyUI Model Downloader"
  4. Install the node
  5. Use it to download models from Hugging Face or Civitai
  6. The downloader automatically maps files to the correct ComfyUI directories

Method 2: Jupyter Terminal

For those comfortable with command-line interfaces:

  1. Return to the Vast.ai instance portal
  2. Click Launch Application for Jupyter Terminal
  3. 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

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

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:

  1. Visit the AI Launcher at promptingpixels.com/deploy
  2. Select Vast.ai as your provider
  3. Browse and add models from HuggingFace or CivitAI using the model browser
  4. Select any custom nodes you need for your workflows
  5. 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:

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.

  1. Go back to your instance portal
  2. Click Launch Application under Jupyter
  3. Navigate through the directory structure: - workspace → ComfyUI → output
  4. Your generated images appear in this folder
  5. Right-click to download individual files, or select multiple images and download them together
  6. 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:

  1. Save any important outputs via Jupyter
  2. Stop the current instance
  3. Create a new instance with larger storage
  4. 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