Workflows
Workflows how do they work?
Workflows and their related concepts
Workflows in Comfy Deploy represent your ComfyUI workflows that you’ve uploaded and want to use in your own applications.
Workflow Verisons
Workflows have versions. Versions let you iterate on your workflows without losing track of previous work.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/workflow-version-arrow.webp)
Machines
Your workflows run on a machine learn more here The custom nodes your workflow depends on should be installed into your machine.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/machine-select-workflow.webp)
Deployments and APIs
Deployments are how you can expose your workflows as APIs! Select your version and machine. Then select either “production” or “staging” for your deployment
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/deploy-dropdow%20.webp)
You should see a deployment popup shortly in the bottom left, this means your deployment is live!
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/deployments-underline.webp)
Integrating your Workflow API
When you click this you’ll find code snippets to integrate your Comfy workflows with your applications with a simple API call.
If you’re using js/ts
you can install our SDk
Then you can intilize your client and create a run
// Initialize your client
const client = new ComfyDeployClient({
apiToken: process.env.COMFY_DEPLOY_API_KEY!,
});
// Create a run via deployment id
const { run_id } = await client.run({
deployment_id: "<YOUR DEPLOYMENT ID>",
// these inputs will change based on your situatoin
inputs: {
"positive_prompt": "",
"negative_prompt": ""
}
});
// Check the status of the run, and retrieve the outputs
const run = await client.getRun(run_id);
Dependencies
Dependencies are the models, static assets and custom nodes that you need to run your workflows. We figure this out based on your local environment and collect them so that you can get up and running quickly. Currently we don’t get all the dependencies but we do get a lot of the obvious ones out of the way.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/dependencies.webp)
Public Share
Public share is a way that you can quickly share your workflows with your teammates or prospective clients.
Selecting “public”, it will show up in your “deployments” section.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/sharepage-highlight.webp)
When you click the public share tab in the deployment section, a popup with fields to customize your Share page will show up. You’ll be able to add a - description of your workflow, - a “cover photo” to showcase. - The title of the page will be the name of the workflow. - Users will be able to test out the workflow, with the inputs you defined
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/sharepage-description.webp)
Your view share page will look something like this
Check out this examples page for Comfy Deploy workflows! (They use sharepages!)
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/sharepageexample.webp)
External inputs
External inputs are how you define the inputs of your deployed APIs! This is done by connecting Comfy Deploy’s “External nodes” to your existing workflows. You can find them by searching “external” for in your ComfyUI
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/find-external-inputs.webp)
Setting External Inputs
Let’s say this is my workflow If I wanted to make it so that the positive prompt was an external input.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/example-workflow.webp)
- Right click and select “Convert text to input” (this option is availble to all your input values).
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/convert-totext-input.webp)
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/turned-to-input.png)
- Connect the Comfy Deploy “External text” node to it. Optionally write a default value
- Then deploy!
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/connect-external-text.png)
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/showing-input.webp)
Outputs
Outputs are determined by “Save image” and “Preview img” we allow differnt types of outputs.
.png
.jpg/jpeg
.webp
.octet-stream
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/outputs.webp)
Observability
Workflow observability means being able to undersatnd what happens on your runs. What you see here is the inputs given, a link to the logs as well as the final output.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/observability.png)
Also you are able to see the time spent in the different operations. As well as the fine grained breakdown if you hover over the Duration.
![](https://pub-dc1367a5c1274d5fab74470cc70817e2.r2.dev/time-observability.png)
Models and Storage
The models your workflows depend on will be in storage learn more here