Running ComfyUI on Vast.ai Serverless: Simple, Scalable Image Generation

December 20, 2025
4 Min Read
By Team Vast
Share
Subscribe

Running ComfyUI on Vast.ai Serverless: Simple, Scalable Image Generation

ComfyUI has become one of the most popular open-source AI tools for image generation, for good reason.

Rather than typing a prompt and hoping for the best, you build the entire process yourself through a node-based interface that gives you full, visual control over how images are created. Every part of the workflow – from models, prompts, and parameters – can be adjusted or branched however you like, and workflows themselves are also shareable and reusable.

While ComfyUI runs well locally for smaller projects, it's a whole other challenge to use it for heavier custom workflows or at production scale. Complex ComfyUI graphs can exceed consumer GPU memory or demand more throughput than a single machine can handle – or simply take too long to iterate on locally.

That's where Vast.ai Serverless comes in.

ComfyUI Meets Vast.ai Serverless

Vast.ai Serverless makes it easy to run your ComfyUI workflows at scale, thanks to a ready-to-use template that handles all of the setup for you – and no need to manage GPUs or monitor capacity.

Simply send requests to ComfyUI and have your generated assets automatically uploaded to S3-compatible storage. The template will return pre-signed URLs in response to requests, as well as detailed process updates while the workflow runs.

It's a straightforward way to integrate ComfyUI into your applications or pipelines without worrying about infrastructure overhead.

What Comes in the ComfyUI Serverless Template

Our ComfyUI Serverless template provides everything you need right out of the box:

  • ComfyUI and its API wrapper (which manages asset uploads)
  • Stable Diffusion 1.5 for benchmarking
  • PyWorker for processing JSON workflows
  • Provisioning script for custom configuration

The template saves you from building or maintaining your own Docker image and ensures you get a consistent environment every time a worker spins up. Once the template is in place, several capabilities come built into the workflow by default.

1. Built-In Asset Handling with S3 Storage

Generated assets are automatically uploaded to your private S3-compatible storage buckets, and pre-signed URLs provide secure, temporary access to download results directly. This keeps storage and retrieval simple, even as workloads scale.

Just add your credentials once in your account settings, and every worker can use them. If you need different buckets for different jobs, you can override these variables on a per-request basis.

2. Flexible Configuration When You Need It

With ComfyUI Serverless, you can keep things simple or tailor your setup with optional configurations. For instance:

  • Add a webhook to be notified after generation completion or failure
  • Use a custom PyWorker git repository URL
  • Adjust benchmark settings to better reflect your workload

With these configuration tools, you're free to adapt the template to your unique needs.

3. Distributing Work Through Benchmarking

Each worker runs a quick benchmark when it initializes, to validate GPU performance and calculate a performance score. This score is what determines how requests are distributed across workers.

The template includes a default Stable Diffusion 1.5 benchmark for this purpose, but you can configure it to match your actual workload complexity or even supply your own custom benchmark.

Try It Out Interactively Before Going Serverless

The ComfyUI Serverless template is designed for serverless execution, of course, but you can test it as an interactive instance first. Interactive testing helps confirm that everything works as expected before you start sending requests through Serverless.

You'll have to enable port forwarding to access applications over the public interface, but the benchmarking process will be visible in the instance logs either way.

A Smoother Path to Production-Scale ComfyUI

Vast.ai Serverless and our ComfyUI template lets you go from a local workflow to a scalable, on-demand system with minimal setup. The environment is preconfigured – with customizable adjustments as needed – and assets are handled automatically while workloads are routed to the right GPUs based on real performance.

For creative work beyond images, we offer Serverless templates for text-to-video and text-to-music workflows, as well.

Ready to see ComfyUI in action? Just launch the ComfyUI Serverless template on Vast.ai and start running workflows at scale. It's that easy.

Vast AI

© 2026 Vast.ai. All rights reserved.

Vast.ai