Table of contents
You can run ComfyUI workflows directly on Replicate using the fofr/any-comfyui-workflow model.
It works by using a ComfyUI JSON blob. You send us your workflow as a JSON blob and we’ll generate your outputs. You can also upload inputs or use URLs in your JSON.
You’ll need the API version of your ComfyUI workflow. This is different to the commonly shared JSON version, it does not included visual information about nodes, etc.
To get your API JSON:
If your model takes inputs, like images for img2img or controlnet, you have 3 options:
If you’re using URLs, you should modify your API JSON file to point at a URL:
You can also give a single input file when running the model. If this is an image or video, we’ll put it directly into the input directory, as input.[extension]
– for example input.jpg
.
You can then reference this in your workflow using the filename:
If your model is more complex and requires multiple inputs, you can upload a zip file or tar file of all of them.
These will be downloaded and extracted to the input
directory. You can then reference them in your workflow based on their relative paths.
So a zip file containing:
Might be used in the workflow like:
We'll always validate that your inputs exist before running your workflow.
With all your inputs ready, you can now run your workflow.
There’s a couple of extra options you can use:
return_temp_files
– Some workflows save temporary files, for example pre-processed controlnet images. Use this option to also return these files.randomise_seeds
– Usually you want to randomise your seeds, so we’ve made this easy for you. Set this option to true
to randomise all your seeds.We support the most popular model weights, including:
Also included are all the popular controlnets and preprocessors. We recommend using the comfyui_controlnet_aux
custom node for preprocessors. And ComfyUI Advanced ControlNet
is included if you really know what you’re doing.
View the complete list of supported weights or request a weight by raising an issue.
If your exact model isn’t supported, you can also try switching to the closest match. Just update your JSON to use a different model filename.
Again, we’ve tried to include the most popular custom nodes.
Some of the custom nodes included are:
View the complete list of supported custom nodes. You can also raise an issue to request more custom nodes, or use the Github repo as a template to roll your own.