stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Optional Accelerate Launch

Open d8ahazard opened this issue 3 years ago • 1 comments

Add option to export ACCELERATE="True", which will in turn cause the application to be launched via accelerate launch, versus python.

d8ahazard avatar Nov 09 '22 17:11 d8ahazard

I would like this

dathide avatar Nov 11 '22 20:11 dathide

What is the benefit to having accelerate launch SDWUI right now? Wouldn't the functions required by Accelerate need to be implemented?

ie.

We are under the presumption that training_dataloader, model, optimizer, scheduler, and loss_function have been defined beforehand.

papuSpartan avatar Nov 15 '22 12:11 papuSpartan

I pulled this and added set ACCELERATE=True in my webui-user.bat, but it didn't run the accelerate block in webui.bat. Is there possibly something wrong with this line? if [%ACCELERATE%] == ["True"] goto :accelerate (webui.bat:31)

ArrowM avatar Nov 16 '22 19:11 ArrowM

I pulled this and added set ACCELERATE=True in my webui-user.bat, but it didn't run the accelerate block in webui.bat. Is there possibly something wrong with this line? if [%ACCELERATE%] == ["True"] goto :accelerate (webui.bat:31)

Put "True" into quotes in your bat file. You'll also need to have restarted the app 2x, once to install the new requirements (accelerate), and again for the bat to find it in venv and run the accelerate launch command.

d8ahazard avatar Nov 16 '22 19:11 d8ahazard

What is the benefit to having accelerate launch SDWUI right now? Wouldn't the functions required by Accelerate need to be implemented?

ie.

We are under the presumption that training_dataloader, model, optimizer, scheduler, and loss_function have been defined beforehand.

Perhaps an extension (like dreambooth) wants to utilize accelerate without having to make the user add a whole new script to launch the app properly. ;)

d8ahazard avatar Nov 16 '22 19:11 d8ahazard

What does accelerating the launch do?

Jonseed avatar Nov 19 '22 18:11 Jonseed

What does accelerating the launch do?

you can read more about it here: https://huggingface.co/docs/accelerate/index

TripleKiller666 avatar Nov 20 '22 19:11 TripleKiller666

What does accelerating the launch do?

you can read more about it here: https://huggingface.co/docs/accelerate/index

Could you simplify it for laymen, what does it do exactly? Some kind of parallelizing of tasks to potentially increase speed of image generation in batches?

nawwman avatar Nov 21 '22 07:11 nawwman

Is it possible to accelerate launch using the linux version as well? can we stick if [%ACCELERATE%] == ["True"] goto :accelerate (webui.sh:31) into our sh file as well? I see the command in the webui.sh file to export accelerate="true" but i get an error when I uncomment it.

zono50 avatar Jan 19 '23 10:01 zono50