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
51.38k stars 5.4k forks source link

Clean up the API for ComfyUI initialization through code (currently happens automatically through importation) #2102

Open oxysoft opened 9 months ago

oxysoft commented 9 months ago

Hi, I use ComfyUI directly in my codebase for AI animation and currently the whole ComfyUI initialization process is a little hard to schedule, as it is tied to code running at top level directly when importing some of the stuff. I'm not deep into Python but I think in general that kind of architecture is a little dubious, would be better off stuffing things into a function we can invoke right when we mean to initialize the core.

fidecastro commented 9 months ago

Hey @oxysoft -- I wrote this connector to address this issue among other things: https://github.com/fidecastro/ComfyUI-serverless

Hope that's useful for you.