ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Directly invoke workflow without running UI

Open hipstersmoothie opened this issue 2 years ago • 8 comments

Hey love the tool.

I'm trying to write code the implements my comfyui workflow using StableDiffusionPipeline. It doesn't seem to support the customization you can do with Loras in comfy.

I've been going thought the code to see what you do and it's A LOT! And it has me thinking that being able to run comfyui as a library would be really awesome. if I could just give it a workflow and it return the results without ever actually running the UI would be perfect.

My options as of now are:

  1. hope hugging face's stuff works once landed
  2. run comfyui app and run thing with http
  3. copy a lot of code (probably what I'll do?)

This could be such a cool "low code" way of making stable diffusion pipelines. Do you think the current code could be wrangled into use case like this? Would you be open to supporting it?

hipstersmoothie avatar Jun 05 '23 02:06 hipstersmoothie

Maybe you need check this.

https://github.com/jug-dev/hordelib

And this.

https://github.com/ltdrdata/ComfyUI/blob/Main/script_examples/basic_api_example.py

ltdrdata avatar Jun 05 '23 02:06 ltdrdata

Woah thank you I'll have to dig into that

hipstersmoothie avatar Jun 05 '23 02:06 hipstersmoothie

That does look nice but I'm really looking to run this in a way where I can just pay and don't have to worry about a queue. Building a service and idk if this would work for that

hipstersmoothie avatar Jun 05 '23 02:06 hipstersmoothie

Also saw the script but that's still invoked via https of a running ui. I just want a python lib to run in my own container

hipstersmoothie avatar Jun 05 '23 02:06 hipstersmoothie

If you do not intend to use ComfyUI as a service itself, there is no other option but to customize it directly.

ltdrdata avatar Jun 05 '23 02:06 ltdrdata

I understand that and that's why I opened the issue 😊 with the current code it isn't possible but I can imagine making the actual pipeline stuff a code api. Hordelib is a great example of what I would want. I bet they could find it useful too since they hard to fork

hipstersmoothie avatar Jun 05 '23 03:06 hipstersmoothie

Also want to keep my models/Loras private so I don't know if I would try the nature of the horde to keep them secret

hipstersmoothie avatar Jun 05 '23 03:06 hipstersmoothie

Maybe even just making the repo pip installable is a good start

hipstersmoothie avatar Jun 06 '23 00:06 hipstersmoothie

@hipstersmoothie you can start comfy and run a workflow using our cli tool as well. Only works with api json right now. https://github.com/Comfy-Org/comfy-cli

robinjhuang avatar Jul 03 '24 22:07 robinjhuang

That's awesome!

hipstersmoothie avatar Jul 04 '24 00:07 hipstersmoothie