comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
55.12k stars 5.82k forks source link

Can normal workflow json be converted to API version with python? #1647

Open baleksey opened 1 year ago

baleksey commented 1 year ago

I find it not very convinient to export workflow to API version and not be able to load it later in GUI again.

What I want to do is to work with normal workflow JSON (where I replace desired values) and then export it to API version with python right before sending it to Comfy server. This way wokflow can be easily modified and opened in GUI and also can be used as API.

Right now conversion is taking place on JS side and I haven't found any code to do that in Python.

P.S. It would be very useful to allow Comfy server accept any json workflow version: stripped for api or just regular one if we dont mind sending a lot of info to API but be able to edit it later in GUI.

Aaron-Porter commented 10 months ago

Agreed, this would be super helpful 🙏