Table of contents
You can run ComfyUI workflows on Replicate, which means you can run them with an API too. Take your custom ComfyUI workflow to production.
You can use our official Python, Node.js, Swift, Elixir and Go clients.
We recommend you follow these steps:
fofr/any-comfyui-workflow
model (read our instructions and see what’s supported)You’ll need to sign up for Replicate, then you can find your API token on your account page.
In this example we’ll run the default ComfyUI workflow, a simple text to image flow.
Install Replicate’s Python client library:
Set the REPLICATE_API_TOKEN environment variable:
Import the client and run the workflow:
You’ll want to customise your workflow, to send in different prompts and other options. You can do this by changing the JSON you pass to the model.
For example, you could change the checkpoint and prompt like this: