ComfyUI frontend to work with serverless?
Hi guys,
Is there a fork of https://github.com/Comfy-Org/ComfyUI_frontend that can work with serverless? or an extension.
I want to try serverless, but creating own frontend for it is a bit too much hassle for now.
Thanks
GitHub
GitHub - Comfy-Org/ComfyUI_frontend: Official front-end implementat...
Official front-end implementation of ComfyUI. Contribute to Comfy-Org/ComfyUI_frontend development by creating an account on GitHub.
2 Replies
@PBG You likely do not want to run a front-end instance in the task-oriented serverless manner Runpod offers.
Back-end instances are OK as they only have to serve the request - as long as there is some persistent storage for any necessary information.
The primary issue is that front-end clients need to live for as long as the client is interacting with them, however Serverless endpoints are designed to run a job, then terminate (on endpoint request).
You can however still get this to work if you wish, but it will require a secondary broker/manager server to manage connections.
It would essentially take the following:
Server
- calls a Serverless endpoint for a frontend instance
Serverless Endpoint
- Calls Server at some known IP or domain to report that it is alive, opens socket to server.
Server
- Server keeps socket alive, passes interface to client, auto-kills if socket breaks or time limit is reached (either in RunPod or at Server config)
- Server kills socket when user logs out
Serverless Endpoint
- If socket breaks, worker shuts down.
This is generally pretty bad architecture to use for a client UI - so I do not recommend it. It is less bad for shorter backend tasks.
ComfyUI-frontend does not require GPUs to run, only the backend. I would deploy a CPU Pod worker on Runpod and host the frontend there.
@Campbell yeah, this is what I want to do - i want a cpu pod or even separate hosting for frontend and make it interact with a serverless endpoint.
The problem is that official frontend uses a different input/output format than runpod endpoints.
Im looking for some extension that would catch all requests coming from frontend, modify it before sending to endpoint and vice versa.