Setup and run comfy workflows. This tool automatically downloads all the neccessary nodes and models and executes the provided workflow. This repo can make it easier for people to use ComfyUI as a backend.
simple_demo.mp4
- Auto installs missing nodes
- Auto downloads workflow models. (Check the data folder for supported models)
- Executes the workflow without starting the UI server
- Suggests similar models if the ones in the workflow are not found
- Link to custom nodes and models can be provided for installation/Setup
After loading the workflow into ComfyUI turn on the "Enable Dev mode Options" from the ComfyUI settings. Click on "Save (API format)" button to save the workflow in API json format.
Clone the repo and install the requirements. Below is a setup using python virtual environment.
git clone https://github.com/piyushK52/comfy-runner
cd comfy-runner
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
Provide the path to your workflow and input files. (Check main.py for sample code)
from inf import ComfyRunner
runner = ComfyRunner()
runner.predict(
workflow_input="examples/img2img/i2i_workflow_api.json",
stop_server_after_completion=True
)
If you are running multiple queries then you can use stop_server_after_completion=False
and after completion manually stop the server using runner.stop_server()
- Add support for normal workflow json and image files
- Add support for fetching models through Civit API
- Add function to generate static python code for the workflow
- Publish this as a library for easy usage
Open issues/discussion if you want to suggest changes or have feature requests. This repo was basically created in an effort to make it easier for people to use ComfyUI as a backend in their apps and decrease their setup time.