The fastest way to deploy a ComfyUI workflow

With the pace of AI progress, developing a process for prototyping and deploying AI workflows rapidly is key to staying on top. For people working with images, videos, or audio, ComfyUI offers an extremely flexible way to build workflows using the latest AI models and techniques. The challenge comes when it is time to make those workflows accessible to other people inside your organisation or to clients, whether inside an existing application or a new one.

In this tutorial, we will go over how to use ViewComfy Cloud to rapidly deploy any ComfyUI workflow as an API or a web app. This no-code solution will save you the hassle of dealing with each workflow’s unique set of dependencies and writing custom code to scale your process on multiple GPUs. By using the cloud solution with the ViewComfy app builder, you can also add simple and intuitive interfaces on top of any workflow, effectively turning your deployment into a web app.

Deploy your workflow

Whether you are going for the API, the web app solution or just want to run a workflow in the cloud, the process is more or less the same. The first thing to do is to download your workflow_API.json from ComfyUI and drop it into ViewComfy Cloud.

ViewComfy has a huge library of models that are ready to use and will be linked to your deployment during the installation process. If your model is not part of that library, for example because you are using your own LoRAs, no worries you will be prompted to add a download link during this step.

Once ViewComfy can locate all the models required by your workflow, you will be taken to the app builder. This step allows you to select the parameters you want to expose via the API, or to your web app users. If you are making an API, you can click deploy right away and skip the next section.

Customize your user interface

In addition to selecting the parameters, the app builder gives UI customisation options. For example, you can group parameters into different categories, add preview images and control the type of outputs that will be displayed. You can view the final interface by going into the playground tab on the left. Once you are happy with the way it looks, you can deploy your app.

Set up your deployment 

After clicking deploy, you can select the type of hardware you want to use as well as the number of GPUs. Flux and SD3 workflows tend to work well on A10G and A100-40GB, while video models usually need at least an A100-80GB.

ViewComfy charges per second of active GPU time, so that you only pay for what you use. To take advantage of that you should set the minimum instance number to 0. This will enable the cluster to shut down if it is idle. As the number of people using your workflow at the same time increases, the cluster will add GPUs to meet the demand until it reaches the maximum number you’ve set. 

For example, if you set the maximum to 2, your cluster will go from 0 to 1 GPU when a user starts using your app, and when the number of requests in the queue goes over a certain amount the cluster will scale to 2 GPUs. This allows you to handle multiple users at the same time. 

After deploying your application, you will be taken the the ViewComfy dashboard, where you can manage all of your deployments. 

Update your workflow

Each of your deployments is also accessible via the standard ComfyUI interface. You can use this feature to install new custom nodes and edit your workflows. 

For those of you who struggle to get a specific workflow working, this feature can be used on its own. It is a great way to serve ComfyUI and display any workflow without having to install anything.

Conclusion

This simple process allows anyone to run any ComfyUI workflow rapidly from prototype to production without having to write a line of code. And because ViewComfy takes care of installing all the dependencies, you don’t need to worry about the specifics of each of the nodes.

Previous
Previous

Using custom Loras to make videos with ComfyUI

Next
Next

Install and run Stable Diffusion 3.5 in ComfyUI