-
-
Notifications
You must be signed in to change notification settings - Fork 362
How to use Stable Diffusion X Large SDXL with Automatic1111 Web UI on RunPod Easy Tutorial
Full tutorial link > https://www.youtube.com/watch?v=mDW4zqh8R40
Updated for SDXL 1.0. Our beloved #Automatic1111 Web UI is now supporting Stable Diffusion X-Large (#SDXL). In this video I will show you how to install and use SDXL in Automatic1111 Web UI on #RunPod. Moreover, I will show how to do proper high resolution fix (Hires. fix) workflow. Furthermore, I will test the speed of Automatic1111 with SDXL on a cheap RunPod RTX 3090 GPU.
Source GitHub Readme File
1 Click Auto RunPod Installer For SDXL and Automatic1111 Web UI
https://www.patreon.com/posts/1-click-runpod-86438018
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 How to install and use SDXL with Automatic1111 on RunPod tutorial intro
00:00:27 How to use Stable Diffusion XL (SDXL) if you don't have a GPU or a PC
00:00:55 How to login your RunPod account
00:01:11 Select which RunPod machine and template for SDXL
00:01:22 How to increase RunPod disk size / volume size
00:01:40 Where to see logs of the Pods
00:01:50 How to connect the Pod JupyterLab interface
00:02:04 The first thing you need to do is editing relauncher.py file
00:02:46 How to install SDXL on RunPod with 1 click auto installer
00:03:24 Continuing with manual installation
00:04:32 GitHub branches are explained
00:05:04 How to update your Automatic1111 Web UI to the latest version via git pull
00:05:50 How to download SDXL models to the RunPod
00:06:34 How to download Hugging Face models with token and authentication via wget
00:07:58 How to start Automatic1111 instance on RunPod after installation
00:08:44 Amazing Stable Diffusion prompts,
00:09:56 Sometimes pods may be broken so move to another new pod
00:10:15 Speed testing SDXL on RTX 3090 having pod
00:10:51 High resolution fix testing with SDXL (Hires. fix)
00:11:04 Hires. fix steps image generation speed results
00:11:41 How many steps do Hires. fix use
00:11:55 Amazing details of hires fix generated image with SDXL
00:12:24 The correct workflow of generating amazing hires. fix applied images
00:14:41 Base image vs high resolution fix applied image comparison
00:15:19 If you don't know how to use Automatic1111 web UI
In this video, the presenter demonstrates how to use Stable Diffusion X-Large (SDXL) on RunPod with the Automatic1111 SD Web UI to generate high-quality images with high-resolution fix. The video also includes a speed test using a cheap GPU like the RTX 3090, which costs only 29 cents per hour to operate.
The video starts with the presenter introducing the topics they will cover. They mention that they have prepared a detailed GitHub readme file containing all the necessary instructions and commands, which will be regularly updated in the future based on viewer feedback. The link to this file is provided in the video's description and comment section.
The first step demonstrated is how to log in to RunPod, and the option to register is also mentioned for those without an account. The presenter proceeds to show the audience how to start two instances of RunPod, one for automatic installation and the other for manual installation. They use the Stable Diffusion template and specify the volume disk size, choosing 100 GB in this case.
The presenter emphasizes the importance of modifying the relauncher.py file in Stable Diffusion web UI to enable proper functioning and killing of the initially started web UI instance. This step is necessary for both automatic and manual installations. They also show how to use their one-click installer for automatic installation, which streamlines the process.
For the manual installation, the presenter walks through the steps in detail. They explain the concept of branches in the Automatic1111 web UI repository and how to update the web UI to the latest version. They then proceed to download SDXL models from Hugging Face using tokens generated from the user's Hugging Face account.
Once everything is set up, the presenter demonstrates how to generate images using the Automatic1111 web UI. They provide example prompts and show how to generate images using both low-resolution and high-resolution fix settings. During the process, they encounter some issues with the pod and restart it to continue the demonstration.
After generating images, the presenter compares the results and emphasizes the high-quality output of SDXL, surpassing SD 1.5. They also show how to use the high-resolution fix to upscale images and improve their quality.
-
00:00:00 Greetings everyone. In this video, I will show you how you can use Stable Diffusion X-Large SDXL on
-
00:00:07 RunPod with our beloved Automatic1111 SD Web UI. Moreover, I will show you the way of generating
-
00:00:13 amazing quality images with high-resolution fix. And I will also do a speed test on RunPod on a
-
00:00:21 very cheap GPU such as RTX 3090 which is only 29 cents per hour. So if you don't have a good GPU
-
00:00:29 then RunPod is the amazing solution for you. So I have prepared a very detailed GitHub readme file.
-
00:00:36 All of the instructions and commands that you are going to need is posted here. I will update this
-
00:00:43 file as it be necessary in future. So just leave a comment to the video and then I will update
-
00:00:49 the file. The link of this file will be in the description of the video and also in the comment
-
00:00:54 section of the video. So let's begin with logging in into our RunPod. If you don't have an account,
-
00:00:59 you can also register. Click this link. Go to your RunPod. Login. I will start two instances.
-
00:01:05 In one of the instances I will make automatic installation and in another instance I will make
-
00:01:10 manual installation. So type here stable to search for the template. Select RunPod Stable Diffusion
-
00:01:15 template. Currently Stable Diffusion web UI 9.1.0. When you are watching this video it may be higher
-
00:01:22 version. You can increase your volume disk size from here such as 100 GB or 200 GB. It is up to
-
00:01:29 you. Let's go with 100 GB. Click set overrides and click continue and deploy. Let's go to my pods.
-
00:01:36 Let's click here and rename our pod. One click installer. Let's start another instance of pod,
-
00:01:42 deploy. This will be manual. It may take a while for pods to start. When you click logs,
-
00:01:49 you will see the logs of the pod. Click connect. Connect to JupyterLab. If you don't know how to
-
00:01:54 use RunPod I have an excellent master tutorial. The link is here. Please watch it and learn more
-
00:02:01 about RunPod. Okay we have connected to our JupyterLab. The first thing that you need to
-
00:02:06 do is go inside Stable Diffusion web UI and change relauncher.py file. Copy this from here and change
-
00:02:16 this line to this one. Save it and then restart your pod. You have to do this one time. This is
-
00:02:21 mandatory. Don't forget to restart. Let's also connect to our manual installation. Let's go
-
00:02:27 inside Stable Diffusion. Open relauncher.py file. Change this line. Save it and then restart the
-
00:02:34 pod. Why this is necessary? Because if you don't do this, you won't be able to kill the initially
-
00:02:41 started web UI instance. This is mandatory for both automatic and manual installation. Then I
-
00:02:47 have prepared a one-click installer. It is shared in this Patreon post. Let's open it. Download the
-
00:02:53 1_click_auto1111_SDXL.sh file from attachments. Enter inside workspace. Click this upload icon.
-
00:03:02 Let's go to downloads. Upload the sh file. Then all you need to do is execute this command. Copy
-
00:03:09 it. Open a new terminal. Paste the command and hit enter and everything else will be automatically
-
00:03:16 done. You will also get this permission denied message but it is fine. It is working. It is
-
00:03:21 killing the initially running web UI instance. Let's continue with manual installation. Let's
-
00:03:27 connect to JupyterLab. Manual installation is also pretty easy. I have prepared the steps. By the
-
00:03:33 way: if you want to learn how to use Automatic1111 web UI with SDXL, I have this excellent tutorial.
-
00:03:39 Please also check it out. So first we need to enter inside Stable Diffusion folder. First you
-
00:03:45 need to take a backup of webui-user.sh file. This file. Because this file will get overwritten. So I
-
00:03:54 will download it. Right click and download. The instructions are written here. Then open a new
-
00:04:00 terminal while you are inside workspace Stable Diffusion web UI. Currently this is where we are.
-
00:04:05 Open a new terminal. You will also see the terminal position here like this. Then we need to
-
00:04:12 do a git stash because we are going to overwrites some of the files. Then do a git checkout master.
-
00:04:18 This will check out the master branch. Then do a git pull. This will update the webui to the
-
00:04:25 latest version with all of the branches. Then git checkout development version like this. And
-
00:04:32 now we are inside development branch. If you don't know what are branches, let me open the
-
00:04:36 repository of Automatic1111 web UI. Currently there are 12 branches. Let's zoom in. When you
-
00:04:42 click the branches, you will see when were they last updated. There were release candidate branch
-
00:04:48 which was supporting SDXL. Then it is merged into development branch. When you click the development
-
00:04:53 branch, you will see it is 290 steps ahead of the master branch. When you click the commits,
-
00:05:00 you will see all of the commits and their messages. So whenever you want to update your
-
00:05:05 Automatic1111 web UI installation to the latest version, you need to use this command and it will
-
00:05:11 update to the latest version. Currently we are at the latest version. Then we will upload back to
-
00:05:17 webui-user.sh file. So while you are inside Stable Diffusion web UI folder, click upload icon, upload
-
00:05:24 it again and it will say overwrite. Yes. Then you need to remove skip install. Why? Because skip
-
00:05:30 install command will prevent the Automatic1111 web UI from updating its necessary libraries. However,
-
00:05:38 we want it to update them because we have updated our branch and commit version. It says file
-
00:05:44 changed. Yes. Click overwrite. And now we have saved it. Now open a new terminal like this. Now
-
00:05:51 we need to download SDXL models. You don't have to do this step with automatic installer that
-
00:05:57 I have shared on Patreon, but here we have to do it. First of all, join Hugging Face from here. If
-
00:06:03 you don't have an account, then click login and log into your account. Then you need to accept
-
00:06:08 terms and conditions. They are auto-approved. Open these both of the links. When you click the link,
-
00:06:14 it will ask you researcher early access agreement like this. Go to very bottom, fill the fields as
-
00:06:22 you wish. I am filling them with my. Check this checkbox and submit application. After that,
-
00:06:28 you will be automatically approved. Then we need to generate our tokens. So click this link. From
-
00:06:36 here let's generate a new token. Test test. You can give a name, anything. Generate token,
-
00:06:41 copy the token, open a notepad or any text editor and paste your token here. Then copy this, paste
-
00:06:49 it into same place. What you need to do is change your username to your Hugging Face username. My
-
00:06:54 Hugging Face username is MonsterMMORPG. Then copy the token and change the token here. So it is like
-
00:07:04 this at the end. Then copy entire thing. Then you need to move into the Stable Diffusion web
-
00:07:09 UI folder, inside models, inside Stable Diffusion and open a new terminal here. So you see this is
-
00:07:17 my terminal position, copy paste the command and hit enter and it will download SDXL base model.
-
00:07:24 Currently we only have 0.9 version, but when we have the newest 1.0 version, I will update the
-
00:07:32 GitHub readme file. The procedure will be same. We will do the same thing for refiner. Currently
-
00:07:38 refiner is not supported with Automatic1111 web UI, but I think it will come very soon. So let's
-
00:07:44 also copy this and copy the token. This file also goes into the same folder. So let's open another
-
00:07:51 terminal and copy paste the command. And now we are ready to start using Automatic1111 web UI.
-
00:07:58 For using Automatic1111 web UI it is same after both manual installation and with my 1 click
-
00:08:04 installer. This is the command. Let's copy it. This command is also written at the very bottom.
-
00:08:09 The automatic installer were already completed, so I will continue with it. Open a new terminal,
-
00:08:14 copy paste the command. It will kill the previously running instance. Then it will start
-
00:08:20 a new web UI instance for us. You see currently it is starting and it has started. We can connect,
-
00:08:27 so let's go back to our my pods. Let's click connect 1 click installer, click connect to
-
00:08:32 HTTP service. When you zoom in your Automatic1111 web UI, now you will get this message. Click here
-
00:08:38 to ignore and our SDXL based model is loaded. So I have some good prompts in my Stable Diffusion
-
00:08:45 GitHub repository. Please also star it, fork it and watch it if you haven't yet. These prompts
-
00:08:51 are shared inside amazing prompts list for Stable Diffusion. This file. In the very bottom there
-
00:08:58 are some amazing prompts, so I will copy this one. Pasted here. Then I will copy the negative prompts
-
00:09:04 pasted here. Don't forget to change resolution to 1024 and 1024 and we are ready. Let's generate an
-
00:09:12 image. Let's also look at the speed. We will see everything in the newly started terminal,
-
00:09:18 so it will appear here. I think it is currently loading the model, so still no messages. OK,
-
00:09:25 you see that we have CPU usage 100%. It is taking some time in the first run, I think.
-
00:09:32 Let's just patiently wait. This is not expected, but we have 100% CPU usage for some reason. OK,
-
00:09:39 for some reason it didn't start, so I will just stop the pod, start the pod again. I will delete
-
00:09:45 the manual installation because we already seen it. Let's terminate. Once you terminate your pod,
-
00:09:51 it will get deleted permanently. You will lose all of your data. OK, delete it. OK, now we got the
-
00:09:59 results. It turns out that this machine was the problem itself. It is not working. Maybe it's CPU
-
00:10:07 is broken, maybe GPU or maybe something else. So I made a quick another installation and now you are
-
00:10:13 seeing the results in the another installation. Let's make a speed test. So I will make the
-
00:10:19 sampling steps 150 and lets hit generate. When we open the CMD window we will see the speed since I
-
00:10:26 am zooming in and zooming out. The displayment is like this, but it is generating images with 3.4 it
-
00:10:34 per second, which is amazing. So I have generated another image with 150 steps to see its speed.
-
00:10:40 This is the generation result. You see it is amazing quality without refiner and it was 3.33 it
-
00:10:49 per second, which is amazing. Let's also try with high resolution fix. So I will upscale it into 4
-
00:10:56 megapixels and let's make the denoising strength 50%. Click ignore and hit generate. OK, now we
-
00:11:03 see this speed of high resolution steps. The speed of high resolution steps are much slower,
-
00:11:08 1.41 seconds per it. But it is expected. Why? Because it is upscaling 1 megapixel image into
-
00:11:18 4 megapixel image. So it is expected to be 4 times slower. And this machine is a very cheap machine
-
00:11:25 using only 30 cents per hour. Let me also delete this to show you. Let's refresh the page. You see,
-
00:11:32 I am only using 30 cents per hour and we have amazing image generation speed. By the way,
-
00:11:39 I think this image is going to be an amazing one. Since I made them 150 steps, it is taking
-
00:11:44 huge time. High resolution steps are using same number of steps if you don't define them with your
-
00:11:50 sampling steps. And here we got our results. Let's look at the details. Opening new tab and amazing.
-
00:11:57 This is the default resolution of the generated image. Just look at the details. These details
-
00:12:05 are amazing. There is some repeating of eyes in here, but this is not a cherry pick. This is the
-
00:12:11 first generation, but the details are just super amazing. You see the quality of SDXL is amazing.
-
00:12:18 It can't be even compared with the SD 1.5. By the way, this is also very weird. So how could you get
-
00:12:25 good images? All you need to do is don't make high resolution fix, generate some number of images,
-
00:12:31 then pick the good one and use the same seed. I will show you an example. So I will use batch
-
00:12:37 count four and I will make the width of the image 1536 like this. And let's generate forever. Right
-
00:12:46 click and generate forever. I will generate until I get a good image. Then I will apply
-
00:12:53 high resolution fix. By the way,: it is able to generate four images at the same time. The
-
00:12:58 it per second is 2.2 it per second. So basically, actually we are getting 8 it per second, which is
-
00:13:05 amazing. So let's say you have generated hundreds of images and you want to find the best one.
-
00:13:10 Open a new terminal while you are inside Stable Diffusion Web UI outputs. The terminal started,
-
00:13:17 then use runpodctl send and the folder name, which is this one, copy paste it and hit enter and it
-
00:13:24 will give us a new download prompt like this. I will download it into my music folder. Let's
-
00:13:30 open a CMD here, copy paste and hit enter and it will download entire folder into this folder. If
-
00:13:37 you don't know how to make RunPod CTL working in this tutorial, I have explained it. So here
-
00:13:42 our downloaded images. Let's extract it. Here we have images. Let's say I liked this image. I am
-
00:13:49 just giving an example. So what I need to do is go to PNG info tab, click here, go to music folder,
-
00:13:56 text to images. You can also alternatively drag and drop the image or you can also use this
-
00:14:01 method. Open the image. It should load the values. Yes, the parameters are here. Click text to image.
-
00:14:07 It will also load the seed value. Then click high resolution fix. By the way, 2x will not work from
-
00:14:14 this resolution probably. So I will upscale by 40% like this. Let's make the denoising strength 50%.
-
00:14:22 And yes, let's make the batch count 1 and let's hit generate. So we will get an improved version
-
00:14:29 of this image. Let's look at the it per second. It is 1 it per second right now. OK, we are getting
-
00:14:36 a very nice image. This is the methodology of obtaining amazing images. OK, here the final
-
00:14:43 image. It is improved. Let's compare it. Here we see on the left, the base image on the right, the
-
00:14:50 upscaled high resolution fix applied image. When we look at the details, we can see that the high
-
00:14:57 resolution fix is very, very good. By the way, I resized them to equal size. So you see from this
-
00:15:03 to this one. Let me also show you its original resolution. So this is high resolution fix applied
-
00:15:09 image. And this is the base image. High resolution fix applied the base. You see, it is amazing
-
00:15:15 quality. This is for all. I hope you have enjoyed. If you don't know how to use Automatic1111 web UI,
-
00:15:22 how to use SDXL RunPod, I have amazing tutorials in my channel. You can look all of them. All of
-
00:15:29 them are very useful. When you click the playlist, you will find also my playlist. For example,
-
00:15:35 in here we see the SDXL playlist. When you go here, you will see my Stable Diffusion tutorials
-
00:15:42 playlist. It is 46 videos. Please also support me by joining my YouTube channel from here.
-
00:15:48 Subscribe, leave a comment like the video. Also, if you support me on Patreon, I would
-
00:15:53 appreciate that very much. Your Patreon support is tremendously important for me. I'm also posting
-
00:16:00 useful stuff on Patreon so you won't regret it. I hope you consider supporting me. When you
-
00:16:06 click the about tab of our channel, you will see my LinkedIn profile and my Twitter profile. You
-
00:16:12 can follow me. You can connect with me. Hopefully see you in another amazing tutorial video.
