News

How to Publish ComfyUI Workflows as Apps

In this post, we'll show you how you can turn any ComfyUI workflow into a one-page app using InstaSD.

We launched InstaSD one month ago and we've been thrilled with the reception. Today, we some major improvements to our API functionality.

In short:

- Deploying workflows as serverless API endpoints is much faster
- Every API endpoint comes with a configurable demo page that you can publish to the world

Read on to see how API deployments work, or watch the short demo video blow.

Here, I have a basic workflow using the new FLUX [dev] model (btw, it's incredible, you should try it!). I want to deploy it as an API endpoint, and I also want my teammates to be able to use it to generate images for our projects.

Once I got the workflow working, I thought about what would be the key inputs that a casual user might want to provide to this workflow. This workflow is pretty simple, so the main input is the text prompt. Other workflows might have other parameters that a user should be able to configure.

A basic Flux workflow

Once I identified the key inputs, I made sure to capture them using one of the new InstaSD API input nodes that come with every ComfyUI workflow on InstaSD.

API inputs are recognized through special InstaSD API Input nodes.


For the prompt input, I'm using "InstaSD API Input - Multiline Text", and I'll rename it to "Prompt".

I could launch my API demo page now, but there is still one issue. Normally, when we run our workflows within ComfyUI, we often randomize seeds on each generation. This does not happen when the workflow is deployed as an API. We need to make the seed an explicit input that can be changed on each run. For this we have a special input node: "InstaSD API Input - Seed". I'll use it to create a seed input node and hook it up to my Random Noise node:


The seed input node gets special treatment by InstaSD as we'll see shortly.

Now that I've got both my inputs sorted out, I'm ready to deploy my API. I'll save the workflow.

InstaSD Control Bar.

Then in "My Instances", I'll click on "Deploy API". InstaSD will build my API endpoint and email me when it's ready.


Once my API is ready, I can view it and prepare a public page to share with my teammates. Here, I can name the workflow, rearrange the input fields, provide default values for the input fields, and choose which input fields to show or hide.

Inputs on the API demo page

Notice that the seed input from earlier now allows the user to randomize it at will.

When I'm ready, I can save my changes, and publish my page for the world. Now, anyone can access and run my workflow on InstaSD:

Go ahead, try it here.

If I'm a developer, and I want to include this workflow in my application, I can view the API instructions from my API view page as well. Here I'll find instructions on authorization in requests, triggering a task, and checking its status. I can also download a complete Postman collection to test my endpoint.

API instructions for developers

Other Posts