AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.52k stars 26.45k forks source link

[Feature Request]: Distributed execution for multiple users. #12777

Open Nikit4v opened 1 year ago

Nikit4v commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

Add ability to run webUI executors on multiple machines while keeping UI on only one.

Proposed workflow

No actual changes to UI itself UI will post a message to queue and executor will report about progress/results/errors back to the UI. In this way, when user will try send generation request, any available executor will process it. No need for multiple instances of actual ui.

Additional information

I currently have several computers (not always available, don't have their own IP addresses) with GPUs and 1 server. I want to use these machines to run SD so me and my friends can create images/textures. Currently we agree on who uses which machine (each has its own WebUI), which doesn't always make sense. It will be nice if these machines will be able to connect to some message broker (like RabbitMQ) and execute tasks while webui itself will send generation requests to this queue.

SpenserCai commented 1 year ago

I developed a discord bot that supports multi-node deployment of sd-webui, which may actually compound your needs, which realises the automatic scheduling of nodes.

sd-webui-discord sd-webui-discord-ex

Nikit4v commented 1 year ago

I developed a discord bot that supports multi-node deployment of sd-webui, which may actually compound your needs, which realises the automatic scheduling of nodes.

sd-webui-discord sd-webui-discord-ex

It's great! But for us this is a problem. We are not trying to replicate Midjorney's bot and we already have written some extensions that helps us to work with SD + I doubt many people would want to learn another tool.

Nikit4v commented 1 year ago

Also, your bot uses an inverse architecture: it connects to the UI, (the master connects to the executors), but I want the executors not to be the point of failure.

SpenserCai commented 1 year ago

Also, your bot uses an inverse architecture: it connects to the UI, (the master connects to the executors), but I want the executors not to be the point of failure.

This is an idea that can replace the dbot with anything else, and the queue can check in real-time whether the executor is alive. If not, no tasks will be distributed to this node until it is restored

Nikit4v commented 1 year ago

Than question is: can WebUI use its own API?

SpenserCai commented 1 year ago

Than question is: can WebUI use its own API?

You can develop a new interface through the API

Nikit4v commented 1 year ago

I opened this issue because I need this UI. Also, implementing a new UI from scratch is basically not worth it. If no one is interested in this feature, I'll probably just create a fork and implement it. But in that case, it won't get any updates. So, I would like to get this feature in the original WebUI.

Nikit4v commented 11 months ago

Any updates?

SpenserCai commented 11 months ago

I have developed a discord robot: sd-webui-discord with sd-webui node connected to the backend, which implements a multi user (user center) mechanism.