-
-
Notifications
You must be signed in to change notification settings - Fork 358
How To Install DreamBooth and Automatic1111 On RunPod and Latest Libraries 2x Speed Up cudDNN CUDA
How To Install DreamBooth & Automatic1111 On RunPod & Latest Libraries - 2x Speed Up - cudDNN - CUDA
Full tutorial link > https://www.youtube.com/watch?v=c_S2kFAefTQ
I have shown how to install latest version of Automatic1111 Web UI for Stable Diffusion and DreamBooth extension of Auto1111 on RunPod in this video. Moreover, I show how to upgrade to latest Cuda, Torch and cuDNN DLL files. With these upgrades the image generation speed literally doubles.
GitHub Readme File
Download Auto Install Scripts
https://www.patreon.com/posts/84716845
Our Discord server
https://bit.ly/SECoursesDiscord
If I have been of assistance to you and you would like to show your support for my work, please consider becoming a patron on 🥰
https://www.patreon.com/SECourses
Technology & Science: News, Tips, Tutorials, Tricks, Best Applications, Guides, Reviews
https://www.youtube.com/playlist?list=PL_pbwdIyffsnkay6X91BWb9rrfLATUMr3
Playlist of StableDiffusion Tutorials, Automatic1111 and Google Colab Guides, DreamBooth, Textual Inversion / Embedding, LoRA, AI Upscaling, Pix2Pix, Img2Img
https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3
00:00:00 Introduction to installation of DreamBooth on RunPod
00:00:28 How to register RunPod and login and select which Pod for DreamBooth training
00:00:45 How to deploy a RunPod and customize deployment
00:00:55 Which template to select for Automatic1111 & DreamBooth on RunPod
00:01:44 How to fix relauncher.py issue on RunPod
00:02:30 How to open JupyterLab interface on RunPod
00:02:40 How to install with automatic install scripts
00:03:05 Manual installation starts
00:03:37 First part of auto install completed - start second and final part
00:04:01 Continuing manual installation
00:04:18 How to install latest version of xFormers for Stable Diffusion
00:04:55 Automatic installation completed and ready to use
00:05:18 Continuing manual installation
00:05:57 How to change webui-user.sh file to prevent auto installation of libraries
00:06:22 How to start Automatic1111 Web UI
00:06:40 How to connect web ui interface on RunPod
00:06:50 How to set default VAE for best VAE to get better image quality
00:07:24 Image generation speed test on RunPod Stable Diffusion Automatic1111
00:08:15 How to upgrade to the latest version of xFormers
00:08:36 How to start again after restart of your Pod
00:09:30 Huge speed drop after restarting pod
00:09:49 The reason of huge it/s speed drop after restarting RunPod
00:11:29 With which command double the speed after restarting your Pod
00:12:12 Side by side speed comparison of default cuDNN vs my latest cuDNN
00:12:46 Batch size 8 speed test results
Installing Latest Automatic1111 Web UI, DreamBooth Extension, CUDA, and cuDNN DLL Libraries on RunPod | Detailed Tutorial
Welcome to this detailed video tutorial where I will guide you through the process of installing the latest Automatic1111 Web UI, DreamBooth extension, CUDA, and cuDNN DLL libraries on RunPod. If you're lacking a powerful GPU, RunPod is the ideal solution for utilizing Stable Diffusion with Automatic1111 Web UI. To facilitate your learning, I have prepared an amazing GitHub readme file that contains all the necessary commands which I will demonstrate step-by-step.
We will start by initiating our RunPod, and you can register or login using the provided link. Once logged in, navigate to the community cloud and select the desired deployment. While the RTX 3090 is my preferred GPU for DreamBooth training due to its exceptional speed and performance, for this tutorial, we will utilize the RTX 4090. Customize the deployment by adjusting the volume disk to approximately 110 gigabytes and select the "Stable Diffusion web automatic" template.
Please note that the version may vary when you watch this tutorial, but always opt for the "web automatic" version. Proceed with the deployment by clicking "Continue" and then "Deploy". This will initiate the manual installation process. Additionally, we will start another instance for automatic installation as I have prepared an automatic installation script. Follow the same steps for deployment, and name this instance "auto install".
The automatic installation process involves executing two scripts, which are available on our Patreon page. Access the provided link and download the attached SH files. Connect to your JupyterLab, and don't worry, as I have prepared step-by-step installation instructions for both automatic and manual installations. In both cases, you'll need to modify the "python relauncher.py" file.
To do this, enter the Stable Diffusion web UI, locate the "relauncher.py" file, open it, and copy the provided content. Replace the corresponding line with the copied content, save the file, and restart the auto install pod. This step is only necessary the first time you build these pods. Similarly, access the manual installation JupyterLab, enter the Stable Diffusion environment, open the "relauncher.py" file, make the required modification, save, and restart the pod.
-
00:00:00 Greetings everyone.
-
00:00:01 In this video, I will show you how to install latest Automatic1111 Web UI,
-
00:00:06 DreamBooth extension, CUDA and cuDNN DLL libraries on RunPod.
-
00:00:11 If you don't have a good GPU then RunPod is the best place to use Stable Diffusion
-
00:00:16 Automatic1111 web UI.
-
00:00:18 I have prepared an amazing GitHub readme file.
-
00:00:22 Every command
-
00:00:23 is written here and I will show you every one of
-
00:00:25 them.
-
00:00:26 Let's begin with starting our RunPod.
-
00:00:28 You can use this link to register or login.
-
00:00:31 Click login.
-
00:00:32 Let's go to the community cloud.
-
00:00:34 I usually prefer RTX 3090 because it is working very
-
00:00:39 fast and very well for DreamBooth training.
-
00:00:42 But for this tutorial, let's use RTX 4090.
-
00:00:45 Click deploy.
-
00:00:47 Customize deployment.
-
00:00:49 Change your volume
-
00:00:50 disk like 110 gigabytes.
-
00:00:52 Select your template from here.
-
00:00:55 Type stable and select Stable Diffusion
-
00:00:57 web automatic.
-
00:00:58 When you are watching this tutorial.
-
00:01:01 It could be higher version but always use web
-
00:01:04 automatic.
-
00:01:05 Click continue click deploy.
-
00:01:07 This will be manual installation.
-
00:01:09 Let's also start another
-
00:01:10 instance for automatic installation because I prepared
-
00:01:13 automatic installation script as well.
-
00:01:16 So with the same settings click continue, click,
-
00:01:19 deploy and I will name this as auto install.
-
00:01:22 The automatic installation is just two script execution.
-
00:01:25 The scripts are posted on our Patreon
-
00:01:28 page.
-
00:01:29 Open this link.
-
00:01:30 Download the attached SH files from here.
-
00:01:33 Connect your JupyterLab.
-
00:01:35 Don't worry I have prepared step-by-step installation as well and I will show you that too.
-
00:01:40 Both in automatic installation and in manual installation first, you need to change
-
00:01:46 python relauncher.py.
-
00:01:47 So to do that, enter inside Stable Diffusion web UI.
-
00:01:51 By the way currently it
-
00:01:52 looks like my web browser is bugged.
-
00:01:55 So I will restart it because when I double click it doesn't
-
00:01:58 enter inside it or it entered.
-
00:02:00 So maybe it was loading some of the scripts.
-
00:02:03 Open the relauncher.py
-
00:02:05 and copy this here.
-
00:02:08 Change this line.
-
00:02:09 Save and restart the pod which is the auto install.
-
00:02:13 This
-
00:02:14 is only necessary for one time.
-
00:02:15 Then connect the manual installation JupyterLab.
-
00:02:18 Enter inside
-
00:02:19 Stable Diffusion.
-
00:02:20 Open the relauncher.py file.
-
00:02:22 Let me show you closely.
-
00:02:24 So relauncher.py.
-
00:02:25 Change
-
00:02:26 this line.
-
00:02:27 Save and restart pod.
-
00:02:28 This is only necessary when you first time build these pods.
-
00:02:35 You don't have to do them anymore.
-
00:02:37 Okay let's connect the JupyterLab again.
-
00:02:39 So after you have
-
00:02:40 downloaded these script files.
-
00:02:42 Go to your workspace.
-
00:02:44 Click this upload files icon.
-
00:02:46 Let me:
-
00:02:47 zoom in.
-
00:02:48 Click it.
-
00:02:49 Select the files.
-
00:02:50 Open them.
-
00:02:51 Open a new launcher.
-
00:02:52 New terminal.
-
00:02:53 Make sure that
-
00:02:54 you are in this folder.
-
00:02:56 Currently we are in the workspace.
-
00:02:58 Copy the first command here and hit
-
00:03:00 enter and it will automatically start first part
-
00:03:02 of installation.
-
00:03:04 Then let me show you the manual
-
00:03:06 installation.
-
00:03:07 Let's connect the JupyterLab of the manual pod.
-
00:03:09 We will execute every step one by one
-
00:03:12 and never skip any of the steps.
-
00:03:14 So the first step is this one.
-
00:03:16 Copy it.
-
00:03:17 Go to your workspace.
-
00:03:18 Open a new terminal.
-
00:03:20 Paste the command and wait until it is completed.
-
00:03:23 Once it is completed.
-
00:03:24 You
-
00:03:25 will see cursor is blinking like this.
-
00:03:27 Then copy the next command.
-
00:03:29 Hit enter.
-
00:03:30 Copy paste and hit
-
00:03:31 enter.
-
00:03:32 Then copy the next command.
-
00:03:33 Copy paste and hit enter and be patiently wait until it starts
-
00:03:37 web UI instance.
-
00:03:39 Meanwhile automatic installation is going on.
-
00:03:42 First part of automatic installation
-
00:03:44 is completed.
-
00:03:45 How do I know?
-
00:03:46 You see running on local URL.
-
00:03:48 That means that you can move to the
-
00:03:49 next stage.
-
00:03:50 Click plus icon.
-
00:03:51 Open a new terminal.
-
00:03:52 Copy the second command.
-
00:03:54 Hit enter and automatic
-
00:03:56 installation will be 100% completed.
-
00:03:59 Let's continue with our manual installation.
-
00:04:02 In the
-
00:04:03 manual installation we see the same URL.
-
00:04:04 Then we can continue.
-
00:04:06 Click plus icon.
-
00:04:07 Open a new terminal
-
00:04:08 inside workspace folder.
-
00:04:10 Now we are at this command.
-
00:04:12 Copy it.
-
00:04:13 Copy paste and hit enter.
-
00:04:15 This will display you the latest version of xFormers.
-
00:04:18 Pip install xFormers == and
-
00:04:22 type the latest version and hit enter.
-
00:04:25 Automatic installation by default uses version 20.
-
00:04:29 However
-
00:04:30 you can apply same thing on automatic installation as well.
-
00:04:33 I will show you.
-
00:04:34 So we have installed the
-
00:04:35 latest development version of xFormers.
-
00:04:37 Then move to this script.
-
00:04:40 Copy.
-
00:04:41 Copy paste and hit enter
-
00:04:42 and patiently wait.
-
00:04:44 You see it is even automatically clicking yes for you.
-
00:04:47 I have prepared this
-
00:04:48 scripts meticulously to make it easy to use them
-
00:04:52 and automatic installation is going on.
-
00:04:55 Automatic installation is completed 100%.
-
00:04:58 It started.
-
00:04:59 Let's test it.
-
00:05:00 So click connect.
-
00:05:02 Connect
-
00:05:03 with 3000 port and we see the DreamBooth extension.
-
00:05:05 Let's check out the versions.
-
00:05:07 Okay you see currently
-
00:05:08 it is using python 3.10.6, Torch version 2.0.1 with
-
00:05:13 CUDA 11.8 the latest CUDA version.
-
00:05:16 xFormers
-
00:05:17 0.0.20.
-
00:05:18 Okay in the manual installation, we can continue.
-
00:05:21 So the next command is this one.
-
00:05:23 Copy
-
00:05:24 it.
-
00:05:25 Paste it and hit enter and wait.
-
00:05:26 This step is also completed.
-
00:05:29 Let's continue with the next step.
-
00:05:31 This one.
-
00:05:32 Copy it.
-
00:05:33 Paste it.
-
00:05:34 It is also completed.
-
00:05:35 Then copy this one.
-
00:05:36 This will download the latest
-
00:05:37 VAE file and then you need to change web UI user.sh
-
00:05:43 file because otherwise it may override
-
00:05:46 the requirements of DreamBooth installation.
-
00:05:49 However if you need to install other extensions,
-
00:05:53 first, install them, then make this change.
-
00:05:57 So go to the Stable Diffusion web UI user.sh file.
-
00:06:02 Edit this part and change it and save.
-
00:06:06 So as I said, if you want to install another extension,
-
00:06:09 you need to remove this.
-
00:06:11 Install it and edit back.
-
00:06:12 However installing another extension may break
-
00:06:15 your DreamBooth installation.
-
00:06:17 Then you need to re-execute these steps and we are ready to use.
-
00:06:22 Copy this command.
-
00:06:23 Open a new terminal.
-
00:06:26 Paste it and it will start web UI on the manual installation.
-
00:06:29 So we will always use this command to start our web
-
00:06:33 UI instance.
-
00:06:34 With that way you will be able
-
00:06:35 to see what is happening in this command line interface.
-
00:06:38 Okay web UI instance started on manual
-
00:06:42 installation as well.
-
00:06:43 Let's connect with 3000 port.
-
00:06:45 So the left one is automatic installation
-
00:06:47 and the right one is manual installation.
-
00:06:50 First let's set up our default Stable Diffusion VAE.
-
00:06:54 This
-
00:06:55 improves the output quality significantly.
-
00:06:57 Apply settings.
-
00:06:58 Let's also apply settings in this one
-
00:07:01 as well and let's do a speed test.
-
00:07:04 So the automatic installation has xFormers version 20.
-
00:07:07 I have a simple prompt, batch count, sampling steps, hit generate and this is the manual
-
00:07:13 installation.
-
00:07:14 It has latest version of xFormers 21.dev.549.
-
00:07:21 Let's type it as well
-
00:07:22 and hit generate.
-
00:07:24 Okay currently we are seeing the it/s of automatic installation.
-
00:07:28 It is about 24 to 25 it/s.
-
00:07:34 And let's check out the manual installation.
-
00:07:36 It is almost
-
00:07:37 same for manual installation as well.
-
00:07:39 24 to 25 it/s.
-
00:07:42 Looks like there isn't significant
-
00:07:44 difference between xFormers.
-
00:07:46 Actually the manual installation has 24.54 and 24.39.
-
00:07:55 Let's compare with automatic installation.
-
00:07:57 25.
-
00:07:58 Okay it is displayed very bad because I changed
-
00:08:02 the resolution.
-
00:08:03 Okay 24.29, 23.72 okay, 23.32.
-
00:08:10 Looks like xFormers is making a difference.
-
00:08:15 So let me show you how to upgrade to the latest version of xFormers in automatic installation.
-
00:08:21 Let's open a new terminal, copy this specific command,
-
00:08:25 paste it and then type same as we did.
-
00:08:29 Copy this.
-
00:08:30 Type like this: pip install xFormers == latest version.
-
00:08:34 Okay, it is installed.
-
00:08:36 Now I will restart both instances and show you
-
00:08:40 how to start from beginning.
-
00:08:42 So let's stop.
-
00:08:43 Let's start.
-
00:08:44 Let's stop.
-
00:08:45 Let's start.
-
00:08:46 Okay, let's connect to the automatic installation.
-
00:08:50 Connect
-
00:08:51 to jupyter lab.
-
00:08:52 After restart.
-
00:08:53 You need to use this command.
-
00:08:54 Copy it.
-
00:08:55 This is also written in the very
-
00:08:57 bottom of the readme file.
-
00:08:59 Open a new terminal.
-
00:09:00 This will kill the automatically started instance
-
00:09:03 and start a new instance in this command prompt in
-
00:09:07 this command line.
-
00:09:08 This will kill the previously
-
00:09:09 started instance and open a new instance in this
-
00:09:12 command line window so you will be able to see
-
00:09:15 everything.
-
00:09:16 It is getting started and you see by default.
-
00:09:19 Now it is using this best VAE file.
-
00:09:21 Okay
-
00:09:22 it started.
-
00:09:23 Let's connect with for 3000.
-
00:09:25 Okay test car and let's see the speed.
-
00:09:30 Let's also connect
-
00:09:31 to manual installation as well.
-
00:09:33 Okay wow now we are getting very terrible speed.
-
00:09:36 Why let's see
-
00:09:37 what could be the reason.
-
00:09:40 Okay we have Torch, Cuda, xFormers and our it per second is very bad.
-
00:09:45 Is using very minimal amount of GPU VRAM as well.
-
00:09:49 I have found why the it per second dropped.
-
00:09:52 So I closed the Pods and I am restarting them.
-
00:09:56 After you turn off your Pod and restart it,
-
00:09:59 it deletes the runtime folder.
-
00:10:02 Therefore, one of the very crucial improvement we are making is
-
00:10:07 gone.
-
00:10:08 Now I will show you how to fix it.
-
00:10:10 So both Pods are started.
-
00:10:12 Let's connect them with jupyterlab.
-
00:10:15 How did I found this?
-
00:10:16 I found this with the help of one of our members in our Discord channel.
-
00:10:21 That
-
00:10:22 is why you should join our Discord channel.
-
00:10:24 Because we have excellent people in our Discord channel.
-
00:10:28 Our Discord channel link posted here.
-
00:10:30 Click it and from here join our server.
-
00:10:32 We have over 3000
-
00:10:34 members.
-
00:10:35 Okay, Pods are started.
-
00:10:36 Let's restart our web ui instance and I will demonstrate you.
-
00:10:41 Normally
-
00:10:42 we use this command to restart.
-
00:10:43 So I will restart it in both of the RunPods.
-
00:10:46 Okay, let's start
-
00:10:47 testing with the automatic installation.
-
00:10:50 It doesn't matter which one because they are identical
-
00:10:52 right
-
00:10:53 now.
-
00:10:54 Okay, fast car and batch count and sampling steps.
-
00:10:57 Right now we are getting 13.50 it per second.
-
00:11:01 It will be same with the manual installation as well.
-
00:11:04 Therefore, let me also show you first.
-
00:11:06 Then
-
00:11:07 we can continue to how to improve them.
-
00:11:10 Connect: so this is auto install Pod 13.90 it per second.
-
00:11:15 This is manual installed Pod.
-
00:11:17 It will be same right now.
-
00:11:19 Let me just show you first.
-
00:11:20 Okay, it is
-
00:11:21 also getting 13.50 or 70.
-
00:11:24 After you turn off your Pod or after you restart your Pod it will delete
-
00:11:28 runtime.
-
00:11:29 So you need to execute this command.
-
00:11:32 This will install the latest cudDNN dll files and let's
-
00:11:36 show you the speed you will gain.
-
00:11:39 So I open a cmd window here.
-
00:11:41 I copy paste it like this.
-
00:11:43 I just wait.
-
00:11:44 Okay, it has installed the latest cudDNN files let's generate and let's compare the speed.
-
00:11:51 Now
-
00:11:52 you see we are getting 25 it per second.
-
00:11:55 On the default cudDNN, we are getting about 14 it
-
00:11:58 per
-
00:11:59 second.
-
00:12:00 And after you execute my cudDNN install command we are getting 25 it per second.
-
00:12:06 You see
-
00:12:07 it is almost double speed.
-
00:12:09 This is huge speed increase.
-
00:12:12 Okay let's see them side by side.
-
00:12:14 On the
-
00:12:15 upper we are seeing the default cudDNN version that
-
00:12:18 comes with the default template.
-
00:12:21 On the bottom
-
00:12:22 you see the speed of my version that I have shown you
-
00:12:27 how to install.
-
00:12:28 So don't forget this.
-
00:12:29 This will
-
00:12:30 speed up your inference time significantly.
-
00:12:34 Probably also your training times as well.
-
00:12:36 This
-
00:12:37 is huge improvement.
-
00:12:39 Let's also test higher batch size.
-
00:12:41 Okay, I make the batch size 8 and I will
-
00:12:44 make the batch size 8 here as well.
-
00:12:46 Okay let's hit generate now we will see batch size eight.
-
00:12:50 Okay,
-
00:12:51 you see in the batch size eight there is still significant
-
00:12:53 difference.
-
00:12:55 And let's calculate the
-
00:12:56 it per second we are getting.
-
00:12:58 Okay Six point sixteen multiplied with eight we are getting 49 it
-
00:13:04 per
-
00:13:05 second.
-
00:13:06 It is almost 50 it per second.
-
00:13:08 This is huge it per second with eight batch size we are
-
00:13:12 able
-
00:13:13 to get these speeds.
-
00:13:14 Let's also see the VRAM usage.
-
00:13:15 The VRAM usage is very insignificant still.
-
00:13:19 I will
-
00:13:20 update this readme file if it be necessary.
-
00:13:22 You will find this readme file link in the description
-
00:13:25 of the video.
-
00:13:26 Hopefully I am going to make my master workflow to show you super photorealistic
-
00:13:33 image generation with DreamBooth.
-
00:13:35 If you don't have a good GPU then you could follow this tutorial,
-
00:13:39 rent a RunPod and apply it.
-
00:13:41 That is why I have made this video today.
-
00:13:44 My realistic photos I am
-
00:13:45 telling this kind of realism.
-
00:13:47 You see this is a raw output without any resize, any upscaler,
-
00:13:51 hd
-
00:13:52 resolution fix or other things.
-
00:13:54 This is a raw output of the new model new workflow that I have
-
00:13:58 found.
-
00:13:59 Hopefully I will show you that I hope you have
-
00:14:02 enjoyed.
-
00:14:03 Please like subscribe.
-
00:14:04 Support me on
-
00:14:05 Patreon.
-
00:14:06 Your Patreon support is significantly important for me.
-
00:14:09 Without your support, I wouldn't
-
00:14:10 be able to continue producing high quality videos.
-
00:14:13 I wouldn't be able to do this much research.
-
00:14:16 If you
-
00:14:17 also leave a comment, like the video, share it.
-
00:14:19 I would appreciate it very much.
-
00:14:20 You can also support
-
00:14:21 me by joining from here.
-
00:14:23 Don't forget to subscribe!
-
00:14:25 You can also follow me on linkedin and twitter.
-
00:14:28 You will find the links from here.
-
00:14:29 Hopefully see you in another amazing video.
