-
-
Notifications
You must be signed in to change notification settings - Fork 362
How Use Stable Diffusion SDXL ControlNet LoRAs For FREE Without A GPU On Kaggle Like Google Colab
How Use Stable Diffusion, SDXL, ControlNet, LoRAs For FREE Without A GPU On Kaggle Like Google Colab
Full tutorial link > https://www.youtube.com/watch?v=dpM02YMj8FY
You want to use Stable Diffusion, use image generative #AI models for free, but you can't pay online services or you don't have a strong computer. Then this is the tutorial you were looking for. By watching this tutorial, you will learn how to use Kaggle free cloud service with famous Stable Diffusion #Automatic1111 SD Web UI as easy as it is running on your local computer. I have prepared an amazing Kaggle notebook that even supports SDXL and ControlNet of SDXL and LoRAs and custom models of #SDXL. Of course it supports all of the Stable Diffusion SD 1.5 based models too.
Kaggle Automatic1111 Notebook File
https://www.patreon.com/posts/run-on-free-like-88714330
Tutorial GitHub Readme File
00:00:00 Introduction to how to use Stable Diffusion for free without a computer or a GPU
00:02:44 How to register a Free Kaggle Account and activate it
00:03:28 How to create a new Notebook on Kaggle
00:03:42 The two very important steps that you need to make before start using Kaggle Notebook
00:03:52 How to set accelerator (select GPUs) and enable Internet
00:04:28 What is persistence and should you use it
00:04:45 How to write code on a Kaggle notebook and use the code shared in the GitHub readme file
00:04:55 How to manually setup your Stable Diffusion Automatic1111 Web UI notebook if you are not my Patreon supporter
00:05:08 How to download and import the Automatic1111 SD Web UI notebook used in this tutorial
00:06:20 Suggested resources before following this tutorial
00:07:28 How to start your Free Kaggle Dual GPU session
00:07:39 How to see how many resources you are using in your current session in a Kaggle notebook
00:08:04 How to install Automatic1111 on a Kaggle notebook
00:08:43 Explanation of the right section of the Kaggle notebook, working directory
00:09:00 How to clear the outputs of a Kaggle notebook session
00:09:10 How to download Stable Diffusion SD 1.5, LoRAs and SDXL models into the correct Kaggle directory
00:09:39 How to download models manually if you are not my Patreon supporter
00:10:14 An example of how to download a LoRA model from CivitAI
00:11:11 An example of how to download a full model checkpoint from CivitAI
00:11:48 How to start downloading all the model files
00:13:41 How to install ControlNet extension and download ControlNet models
00:15:50 How to use custom LoRAs from CivitAI or Hugging Face
00:16:29 How to start Automatic1111 Web UI instance with correct parameters and settings
00:18:42 How to understand installation of Automatic1111 Web UI has been completed and ready to use
00:19:09 First time model loading may be very slow
00:19:26 How to enable quick VAE selection drop down list
00:19:50 How to set correct folder scan path for ControlNet
00:20:29 How to reload UI for extensions and setting changes to be effective
00:20:51 Automatic1111 Web UI is ready to use on a Free Kaggle notebook
00:21:22 How to use embedded VAE of the models
00:21:48 Which image generation sampler is the best one
00:21:58 Why and how much first image generation is slower
00:22:57 How to install extensions (e.g. After Detailer) of Automatic1111 on a Free Kaggle notebook
00:23:35 You need to reload Web UI to see new extensions
00:23:55 How to use your downloaded LoRA models in Automatic1111 Web UI
00:25:17 First image generation with SDXL model
00:26:16 First time image generation speed vs consequent images generation on SDXL
00:26:54 First image generation with the custom LoRA model from CivitAI
00:27:20 Image generation speed of SDXL when using LoRA
00:27:41 How to use your own trained LoRAs, models or LoRAs, models from your computer
00:29:03 How to import your files, datasets in to your current session on Kaggle
00:29:21 How to use files imported as data set such as LoRAs or models that you have uploaded as dataset
00:30:23 How to restart Automatic1111 Web UI on a Kaggle notebook
00:31:06 How to prompt your own trained LoRA
00:31:32 How to enable After Detailer (adetailer) extension to improve faces of Stable Diffusion generated images
00:33:01 Where are the SD generated images are saved on a Kaggle notebook
00:33:45 SDXL with LoRA image generation speed
00:34:20 How to use Stable Diffusion XL (SDXL) ControlNet models in Automatic1111 Web UI on a free Kaggle
00:35:05 Where to download SDXL ControlNet models if you are not my Patreon supporter
00:36:13 Notebook crashes due to insufficient RAM when first time using SDXL ControlNet and how I fix it
00:37:39 First image generation results of SDXL ControlNet
00:39:21 SDXL ControlNet development discussion topic
00:40:22 Possible bug with ControlNet
00:41:10 How to use Stable Diffusion 1.5 version based ControlNet instead of SDXL ControlNet
00:43:29 What happens if you exceed your assigned disk space on a free Kaggle notebook
00:44:35 First time using SD 1.5 ControlNet model on a SD 1.5 based Realistic Vision 5.1 model
00:44:55 How to fix runtime error when changing SDXL to SD 1.5 based model
00:46:42 How to use PNG info to get the prompt
00:47:57 How to download all generated images
-
00:00:00 Have you ever wanted to harness the full power of image-generation AI, Stable Diffusion,
-
00:00:05 but felt held back by the limitations of your computer or budget?
-
00:00:10 Today I have just the solution for you.
-
00:00:13 In this comprehensive tutorial, I will guide you through a Kaggle notebook detailing how
-
00:00:19 to utilize custom models from CivitAI and Hugging Face such as the renowned Realistic
-
00:00:25 Vision.
-
00:00:26 Explore the capabilities of Stable Diffusion X-Large commonly referred to as SDXL.
-
00:00:33 Implement custom LoRAs from CivitAI like the Pixel Art XL.
-
00:00:38 Incorporate your very own trained LoRAs compatible even with SDXL.
-
00:00:43 Dive into the advanced extensions of Stable Diffusion ControlNet, tailored for both Stable
-
00:00:50 Diffusion 1.5 based models and the SDXL models.
-
00:00:56 The SDXL support for Automatic1111 Web UI just arrived today.
-
00:01:02 I will show you how to use ControlNet models for SDXL in this tutorial.
-
00:01:07 Hopefully, a much more comprehensive tutorial for ControlNet for SDXL is coming.
-
00:01:14 Moreover, install any extension you want such as After Detailer.
-
00:01:19 And finally, download all of the generated images with just one click.
-
00:01:25 The best part, we will achieve all of these by using Kaggle, a leading machine learning
-
00:01:32 platform.
-
00:01:33 Not only does Kaggle offer free GPU capabilities akin to the Google Colab, but it stands out
-
00:01:40 in its generosity.
-
00:01:41 With Kaggle, you gain access to powerful T4 GPU for 30 hours weekly, and you are always
-
00:01:48 in the know about your usage and refresh times.
-
00:01:52 You can follow this tutorial even from your mobile phone.
-
00:01:55 You don't even need a computer.
-
00:01:58 So if you are ready to elevate your AI capabilities without spending any money, without owning
-
00:02:03 a strong GPU, without owning a strong computer, this tutorial is tailor-made for you.
-
00:02:09 And we will use the best and most easy to use UI for Stable Diffusion models, Automatic1111
-
00:02:16 Web UI.
-
00:02:17 It will be exactly as using in your computer like you have a very strong computer.
-
00:02:22 I have prepared a very detailed GitHub readme file for this tutorial.
-
00:02:27 Everything that you are going to need will be in this file, the links, the codes, and
-
00:02:32 everything else.
-
00:02:34 I will update this file if it be necessary in future.
-
00:02:38 Also, the link of this file will be in the description of the video and also in the pinned
-
00:02:43 comments of the video.
-
00:02:44 So we will begin with registering and logging in to our Kaggle account.
-
00:02:51 If you don't have a Kaggle account, open this link.
-
00:02:54 Register with either Google or with email.
-
00:02:57 I prefer to register with Google.
-
00:02:59 I have already registered my account.
-
00:03:02 After you registered your account and logged in, go to settings.
-
00:03:05 You can click this link to go to settings.
-
00:03:08 And in here, you have to verify your phone number.
-
00:03:11 As you are seeing right now, my phone is verified.
-
00:03:14 This is necessary to be able to use the free GPUs that the Kaggle provides us.
-
00:03:20 If your phone number verification fails for any reason, you can contact the support of
-
00:03:26 the Kaggle from this link.
-
00:03:28 After registered and logged into your account, we will begin with creating a new notebook.
-
00:03:34 Click this create button here and click new notebook.
-
00:03:38 It will start a new fresh notebook like you are seeing right now.
-
00:03:42 There are two important things before you start.
-
00:03:45 First of all, you need to select accelerator from here.
-
00:03:49 Select GPU T4 x 2.
-
00:03:52 This will provide us dual T4 GPU.
-
00:03:56 You see, you can use it 30 hours every week.
-
00:03:59 This is amazing.
-
00:04:00 This is for free and each week this resets.
-
00:04:04 So each week you can use 30 hours this dual GPU.
-
00:04:08 These GPUs will be only assigned to you while you are using.
-
00:04:12 This is not like Hugging Face spaces if you have ever used them.
-
00:04:16 This will be totally reserved to you so you will have full control of these dual GPUs.
-
00:04:22 And one another thing is Internet on.
-
00:04:24 You need to set Internet on otherwise you will get error.
-
00:04:28 You can also select persistence.
-
00:04:30 However, this is not working very well in many cases.
-
00:04:34 Also, it will slow you down when you start your session, restart your session to reload
-
00:04:40 the data.
-
00:04:41 But you can also enable persistence if you wish.
-
00:04:44 I don't prefer it.
-
00:04:46 So what you need to do is you need to delete this code and use the codes I shared here.
-
00:04:52 You see, for example, copy this one, paste it and run the notebook.
-
00:04:56 Then copy this one, paste it and run the code and continue.
-
00:05:01 You can also add new code, copy paste the new code to there like this, and execute them.
-
00:05:08 However, if you are my Patreon supporter, which I hope you will be, you can download
-
00:05:13 the entire notebook from this link.
-
00:05:16 Let me download it.
-
00:05:17 When you open this link, you will get to this Patreon page and you can download the notebook
-
00:05:23 from this attachment or you can also click here to download.
-
00:05:26 The notebook is downloaded.
-
00:05:28 Then we are going to click file and import notebook.
-
00:05:33 Then browse files, go to download, select the notebook, click import and the entire
-
00:05:40 notebook is imported.
-
00:05:42 I am going to show entire code in this video.
-
00:05:46 So if you are not my Patreon supporter, you can still follow this video perfectly fine
-
00:05:52 and you will be able to do everything that we are doing with this notebook because the
-
00:05:57 code that is necessary and the instructions are all shared in this GitHub readme file.
-
00:06:04 So read this readme file very carefully.
-
00:06:06 Moreover, I will update this readme file if it be necessary in future.
-
00:06:11 So if it gets broken, just reply to this video or join our Discord channel and ask me questions
-
00:06:18 or tell me what is broken.
-
00:06:20 Moreover, before starting, I suggest you to check out the suggested resources.
-
00:06:25 For example, this link will open the ControlNet extension development for Stable Diffusion
-
00:06:33 XL with Automatic1111 Web UI.
-
00:06:36 Also, I suggest you to watch this tutorial video where I have shown how to train your
-
00:06:43 own Stable Diffusion XL LoRA on a free Kaggle account.
-
00:06:47 You can also do Stable Diffusion 1.5 based versions training as well.
-
00:06:53 So it is not limited to SDXL.
-
00:06:55 Whatever I show is not limited to Stable Diffusion XL.
-
00:07:00 SDXL.
-
00:07:01 You can do everything with Stable Diffusion 1.5 based versions as well.
-
00:07:06 And I also suggest you to watch this ControlNet tutorial.
-
00:07:10 This is a huge tutorial where I have shown how to install Automatic1111 Web UI, how to
-
00:07:15 install ControlNet, how to download its models, which ControlNet model and option do what.
-
00:07:21 So this is a huge tutorial that you should watch.
-
00:07:25 After that, you are ready to start following this tutorial.
-
00:07:28 First of all, we need to start our session.
-
00:07:31 So we click this icon.
-
00:07:33 It will start our session.
-
00:07:35 Once the session has been started, you will get a green circle here.
-
00:07:39 When you click this tab, it will open the session details.
-
00:07:44 You see, I am using 4GB of my maximum temporary disk, which is 73GB, which is a huge disk
-
00:07:52 space.
-
00:07:53 We are using 500MB RAM memory at the moment.
-
00:07:56 We are not using any of the GPUs that we have.
-
00:08:00 You see, I have 2 GPUs.
-
00:08:02 You should also have dual GPU here.
-
00:08:04 Then we will begin with installing everything written here.
-
00:08:08 This is going to install this library to manage the RAM better in a Kaggle notebook.
-
00:08:15 This is going to clone the Stable Diffusion Web UI into our working directory.
-
00:08:20 These lines are going to generate these temporary folders because we are going to download ControlNet
-
00:08:27 models and the Stable Diffusion models into the temporary disk.
-
00:08:30 Because the temporary disk is 70GB.
-
00:08:33 However, our working directory is only 20GB.
-
00:08:37 Since we have cloned our repo into our working directory, it is now shown here.
-
00:08:43 So this right section of the notebook is really important.
-
00:08:46 This right section can be hidden and opened back from here as you are seeing right now.
-
00:08:52 So the Kaggle working directory is our main directory.
-
00:08:56 I will show everything, so don't worry.
-
00:08:58 You see, everything were properly installed.
-
00:09:01 Let's clear the output.
-
00:09:02 So for clearing the output, right click anywhere and clear all outputs and it will clear all
-
00:09:07 the output.
-
00:09:08 Now the second step.
-
00:09:10 In here, I am going to download the SDXL base model, SDXL refiner model, SDXL best VAE model
-
00:09:19 into the respected folders.
-
00:09:21 I am going to download the main models into the Kaggle temporary models folder because
-
00:09:26 as I said, we have much more space in the temporary folder.
-
00:09:29 However, I am going to download the best VAE into the working directory.
-
00:09:35 Don't worry, these are all explained here.
-
00:09:38 The logic is so simple.
-
00:09:40 First, you need to find the repository.
-
00:09:42 For example Stable Diffusion XL base repository on Hugging Face.
-
00:09:47 Then go to the files and versions tab and in here you need to copy the link of the file.
-
00:09:53 To copy the download link, you see there is a download arrow here.
-
00:09:57 Right click and copy link address.
-
00:09:59 Then all you need to do is come here, change this link with that one.
-
00:10:05 For example, I deleted it and copy pasted it.
-
00:10:08 Then change the model file name that you want it to be saved as.
-
00:10:13 You can also change this.
-
00:10:14 So with this strategy, you can use any custom model on Hugging Face or even on CivitAI.
-
00:10:20 The difference with CivitAI is that it is like this.
-
00:10:25 Let me show an example from CivitAI.
-
00:10:28 For example, this model.
-
00:10:31 This is a pixel art SDXL LoRA.
-
00:10:34 Let me open its page from CivitAI.
-
00:10:37 So this is the CivitAI page of this LoRA file.
-
00:10:41 Either it can be LoRA or it can be model.
-
00:10:43 It doesn't matter.
-
00:10:44 The logic is same so I am teaching you the logic.
-
00:10:47 So to download this, right click here and copy the link address from here.
-
00:10:51 Then go back to your notebook, delete this link, paste it.
-
00:10:56 You see the link is here.
-
00:10:58 And in here, just define its path and the download file name.
-
00:11:03 The extension of the file name is really important.
-
00:11:05 Since this is a SafeTensors file, I need to make it a SafeTensors extension.
-
00:11:12 What if it was a checkpoint like you are seeing Juggernaut XL?
-
00:11:17 Still same.
-
00:11:18 I just right click, copy the link address.
-
00:11:20 And in the Kaggle, then this time I need to download it into the models folder here.
-
00:11:26 So I just need to change the download link from here, paste it and download it into the
-
00:11:32 models folder with its name.
-
00:11:35 If you also reply to the Patreon post and if you need any additional models that you
-
00:11:39 need here, I will change and modify the notebook file, update the Patreon post.
-
00:11:46 So I will make it easier for you.
-
00:11:48 So when I click this link, it will start downloading the models one by one.
-
00:11:52 You see the download speed is huge on Kaggle.
-
00:11:56 You are seeing 300 megabytes, 200 megabytes at the moment.
-
00:11:59 200 megabytes per second means that actually it is around 2000 megabits per second.
-
00:12:06 So this is a huge speed.
-
00:12:07 You see the entire SDXL model is being downloaded in just under one minute as you are seeing
-
00:12:14 right now.
-
00:12:15 So Kaggle is super fast in downloads as well.
-
00:12:19 Kaggle is much better than Google Colab if you ask my opinion.
-
00:12:24 So the entire download is completed in just 32 seconds for the SDXL main model as you
-
00:12:31 are seeing right now.
-
00:12:32 32 seconds.
-
00:12:33 So it will download all of the models written here.
-
00:12:36 If you don't need any model, just put a hashtag like this in front of it and it will get commented
-
00:12:44 out and that line will not be executed.
-
00:12:47 So wait until you see this circle has been stopped.
-
00:12:51 That means the cell execution has been completed.
-
00:12:55 You can only execute one cell at a time.
-
00:12:58 This is a rule commonly shared in Google Colab or Kaggle or other similar platforms that
-
00:13:05 you may have used or you may use.
-
00:13:08 So it is downloading all of the models.
-
00:13:10 And you see while that cell is being executed, I have cancel run option here.
-
00:13:15 So when you see this option is gone, that means that the cell execution has been completed.
-
00:13:22 You can also watch the parameters here.
-
00:13:24 You see our disk usage is getting increased.
-
00:13:26 Okay, all files have been downloaded.
-
00:13:29 You see 7 gigabytes file downloaded in just 51 seconds.
-
00:13:33 This is super fast.
-
00:13:35 And that cancel run option is not here anymore.
-
00:13:39 So I right click and clear all outputs.
-
00:13:41 Now the next thing is whether you want to use ControlNet or not.
-
00:13:45 The ControlNet is the best extension and the most advanced extension of the Stable Diffusion
-
00:13:51 and Automatic1111 Web UI.
-
00:13:54 So if you don't know what is ControlNet, as I said, watch this ControlNet tutorial.
-
00:14:00 This is a huge tutorial, about 100 minutes fully chaptered.
-
00:14:05 So by watching this tutorial, you will learn a lot of things, almost everything about ControlNet.
-
00:14:12 Let's begin with downloading the ControlNet for Stable Diffusion X-Large, SDXL.
-
00:14:18 This just arrived like yesterday.
-
00:14:20 This wasn't supported by Automatic 1111 Web UI.
-
00:14:24 However, now Automatic 1111 Web UI also supporting ControlNet models for SDXL.
-
00:14:30 Hopefully, I will make a new whole tutorial about ControlNet in SDXL.
-
00:14:36 But it is not ready yet.
-
00:14:37 So in this tutorial, I will just show an example of how to use it.
-
00:14:42 So wait my next tutorial about ControlNet in Stable Diffusion XL when using Automatic1111
-
00:14:47 Web UI.
-
00:14:48 Previously, you had to use Comfy UI to use SDXL and ControlNet.
-
00:14:55 However, now we can both use SDXL Refiner and ControlNet with Automatic 1111 Web UI.
-
00:15:02 All thanks to the guy that develops this extension, which is this guy you see.
-
00:15:10 The name is Lyumin Zhang.
-
00:15:12 I am not sure how am I pronouncing it.
-
00:15:15 Lyumin Zhang.
-
00:15:16 Yes, he written his pronouns.
-
00:15:18 So this guy is an amazing developer.
-
00:15:20 You can also read this thread to learn a lot of information regarding Stable Diffusion
-
00:15:26 XL ControlNet models.
-
00:15:28 Okay, all ControlNet models are downloaded while I was talking in just few minutes because
-
00:15:35 of download speed of Kaggle.
-
00:15:37 Then I am going to skip this cell for now because this is going to download ControlNet
-
00:15:42 models for SD 1.5 based models.
-
00:15:44 You see, we are already using 50 GB of our disk space.
-
00:15:50 Now, whether you want to use LoRA or not, this is the cell you need.
-
00:15:55 We are also going to download the LoRA's into the temporary folder.
-
00:16:00 So I will just download the LoRA of this pixel art as an example.
-
00:16:05 But you can download and use any LoRA's.
-
00:16:07 I will also show example of your trained LoRA's how to use them.
-
00:16:12 But let's just begin with a custom LoRA hosted on either CivitAI or HuggingFace.
-
00:16:19 Currently I am going to use from CivitAI.
-
00:16:22 So the LoRA file is also downloaded.
-
00:16:23 It is already very small file only 160 MB.
-
00:16:28 And now we are ready.
-
00:16:30 These are our Automatic1111 Web UI command line arguments.
-
00:16:34 You see xFormers, share and I am giving a custom folder name for the model files.
-
00:16:41 Why?
-
00:16:42 Because I downloaded models not inside models Stable Diffusion folder, but inside Kaggle
-
00:16:47 temporary models folder.
-
00:16:49 This is really really important because we are utilizing the temporary folder that Kaggle
-
00:16:53 gives us.
-
00:16:55 If you use my Patreon Kaggle notebook you don't need to make any changes.
-
00:16:59 This is also shared in the GitHub readme file in the bottom as you are seeing right now.
-
00:17:04 So don't worry about that either.
-
00:17:06 And we are going to start with no-half-vae command because this command is for SDXL.
-
00:17:13 I think they also added a new command.
-
00:17:16 Let's also find it with you.
-
00:17:18 So this is the space where all of the command line arguments are shared.
-
00:17:23 Okay it is not written here yet.
-
00:17:26 So let's search the repository.
-
00:17:28 Okay I couldn't find it.
-
00:17:30 Currently they added --medvram-sdxl option which enables the medium VRAM only for SDXL.
-
00:17:38 I believe I have seen they added the similar option for VAE as well.
-
00:17:44 So let me look one more time.
-
00:17:46 Okay I couldn't find it, but we are going to start with no half VAE.
-
00:17:51 This is going to make the SD 1.5 based models image generation slower.
-
00:17:57 So if you are not going to use SDXL, you should also comment this VAE precision like this.
-
00:18:05 But if you are going to use SDXL make it like this.
-
00:18:09 Okay let's begin.
-
00:18:10 So I will click this cell and start Web UI.
-
00:18:13 The first time when you start this cell.
-
00:18:16 When you execute this cell, it will install the necessary requirements of the Stable Diffusion
-
00:18:22 Automatic1111 Web UI.
-
00:18:23 You see it is downloading Torch version 2.0.1.
-
00:18:27 So this is only first time installation.
-
00:18:32 After that if you just stop this cell and restart it, it won't install the libraries
-
00:18:37 again until you restart your session or terminate your session and start again.
-
00:18:42 The installation has been completed.
-
00:18:44 How will you know?
-
00:18:45 You will get this Gradio live link.
-
00:18:48 This is really important.
-
00:18:49 Let me zoom in.
-
00:18:51 This link.
-
00:18:52 Open this link.
-
00:18:53 After opening this link, you can right click and clear all outputs like this.
-
00:18:58 And this cell is still being executed because this is the cell which is running our Automatic1111
-
00:19:05 Web UI instance.
-
00:19:07 And our instance is getting loaded.
-
00:19:09 When you first time load your Web UI the load of the model may take a lot of time because
-
00:19:16 we have a very limited RAM as you are seeing here.
-
00:19:19 So it has loaded with Realistic Vision version 5.1 because we have also downloaded that model.
-
00:19:26 First let's go to the settings.
-
00:19:28 Go to the interface in the settings section.
-
00:19:32 You will find it here.
-
00:19:33 User interface.
-
00:19:35 Go to the info quick settings list.
-
00:19:38 Type VAE and select SD VAE.
-
00:19:40 This is really important because with this we will be able to select which VAE to use.
-
00:19:47 Apply settings.
-
00:19:48 Then reload UI.
-
00:19:50 But before doing that since we are also going to use ControlNet.
-
00:19:54 Let's also select its folder.
-
00:19:57 So go to the ControlNet tab in here.
-
00:20:00 And you see it has extra path to scan for ControlNet models.
-
00:20:04 This is really important.
-
00:20:05 This is the place where we will set the model folder.
-
00:20:09 So the model folder is going to be.
-
00:20:12 Let's find it in here.
-
00:20:14 Kaggle temp CN models.
-
00:20:16 This is the folder we have given.
-
00:20:18 You can also define different folder pathing.
-
00:20:21 It is totally up to you.
-
00:20:23 The Kaggle temp part is the important part.
-
00:20:26 Apply settings.
-
00:20:27 Now ControlNet will scan this folder.
-
00:20:30 Then reload UI.
-
00:20:31 When you reload UI you will get a new Gradio public link.
-
00:20:35 This won't work anymore.
-
00:20:37 So close this.
-
00:20:39 Wait link to appear here.
-
00:20:41 You see now we got a new public URL for the Gradio live.
-
00:20:46 Open it.
-
00:20:47 And Automatic1111 Web UI has been started successfully.
-
00:20:51 This is now going to work as in your computer as it is running locally.
-
00:20:57 But this is going to run on the remote server.
-
00:21:00 So nothing will be actually executed in your computer.
-
00:21:04 Everything will be executed on the cloud.
-
00:21:06 However you will be able to use it as easy as in your computer.
-
00:21:11 So let's begin with generating some images with Realistic Vision.
-
00:21:14 Therefore I am going to select the best SD 1.5 based models VAE from here.
-
00:21:22 If you want to use the embedded VAE of the model you need to select none option from
-
00:21:29 this selection.
-
00:21:30 You see none.
-
00:21:31 When you select none it will use the embedded VAE.
-
00:21:34 If you don't know what is VAE just search Google.
-
00:21:36 You will get a lot of information.
-
00:21:38 So let's generate an example image.
-
00:21:40 Photo of an amazing sports car.
-
00:21:44 Let's make the resolution 768.
-
00:21:46 768.
-
00:21:48 I find that the best sampler is DPM++ 2M SDE Karras.
-
00:21:55 So I am going to select it.
-
00:21:57 And let's hit generate.
-
00:21:58 The first generation may be slower than expected.
-
00:22:01 Let's see the speed.
-
00:22:02 So you see for the speed I am checking here.
-
00:22:05 It is reaching about 2.4 IT per second which is a very very good speed because we are generating
-
00:22:11 with a higher resolution.
-
00:22:13 When the first time it is generating image, the VAE decomposition decoding part is going
-
00:22:20 to take more time as you are seeing right now.
-
00:22:23 So it has generated all the steps and now generating the final image.
-
00:22:27 So the entire generation took 24 seconds.
-
00:22:31 Let's look at the image.
-
00:22:32 So this is the image we got.
-
00:22:34 We didn't use any negative prompts.
-
00:22:36 Let's generate another one.
-
00:22:38 Okay it is generating with 2.4 IT per second.
-
00:22:42 You see this time VAE didn't take almost any time because it was cached in the RAM memory.
-
00:22:48 And this time the total generation took 9 seconds.
-
00:22:52 So the first time was 24 seconds.
-
00:22:54 The second time is 9 seconds.
-
00:22:56 And we got another image.
-
00:22:57 When you are running on Kaggle you can also install extensions.
-
00:23:02 All you need to do is go to extensions tab.
-
00:23:04 Install from let's say available.
-
00:23:07 Click load from.
-
00:23:08 Let's install After Detailer which is one of the favorite extensions that I have.
-
00:23:13 You see After Detailer.
-
00:23:14 Click install.
-
00:23:16 After you clicked install you should watch what is happening in here.
-
00:23:21 This is the command line interface that we have when we are running on our local computer.
-
00:23:25 You see it is installing all of the extension requirements.
-
00:23:28 And it is successfully installed.
-
00:23:31 Also this screen is now unfrozen.
-
00:23:33 When we go to text to image tab.
-
00:23:35 Why?
-
00:23:36 Because we need to reload the UI.
-
00:23:37 So I clicked to reload UI.
-
00:23:40 It is going to reload the UI.
-
00:23:42 You see it is downloading the necessary files for that extension to become available.
-
00:23:47 And then I have got a new link.
-
00:23:49 Click it.
-
00:23:50 Now I have the After Detailer extension installed.
-
00:23:53 So it is also supporting extension installation.
-
00:23:56 So let's say you have downloaded some CivitAI LoRAs.
-
00:23:59 You just need to click here.
-
00:24:01 After that you need to click refresh.
-
00:24:03 But currently I don't have any Stable Diffusion 1.5 version based LoRA.
-
00:24:09 However I have a LoRA for SDXL.
-
00:24:13 So to use SDXL LoRA I will first select the SDXL base safetensors from here.
-
00:24:20 It is going to take some time to load it because we have a very limited RAM.
-
00:24:25 Therefore the model changes are taking some time like one minute.
-
00:24:30 Maybe sometimes over one minute.
-
00:24:32 Just patiently wait here to fully executed.
-
00:24:36 Okay it has been like 110 seconds.
-
00:24:39 It is still loading.
-
00:24:40 Okay almost done.
-
00:24:42 Yes it is finally loaded.
-
00:24:44 You should also watch the messages printed here.
-
00:24:47 So model loading took a lot of time.
-
00:24:50 It says actually 49 seconds but it was more here.
-
00:24:53 Then you also need to change the VAE.
-
00:24:56 This is really important.
-
00:24:58 You need to change it to either none or SDXL VAE.
-
00:25:01 Now it is going to load the SDXL VAE.
-
00:25:05 You can also watch here and see what is happening.
-
00:25:08 You see it is using more RAM because it is going to de-load the previous VAE.
-
00:25:12 Okay VAE is loaded.
-
00:25:16 Okay now we are ready.
-
00:25:17 So let's generate our first image with SDXL base model.
-
00:25:22 For SDXL there are several resolutions.
-
00:25:25 The very best one is 1024x1024.
-
00:25:29 So let's generate photo of an amazing sports car.
-
00:25:33 I am going to select DPM++ 2M SDE Karras.
-
00:25:38 Let's generate.
-
00:25:39 The first generation will be slower just like the previous time I presume.
-
00:25:43 However if you don't have a strong GPU this is working very well.
-
00:25:47 This speed is very decent.
-
00:25:49 With RTX 3090 and a very powerful GPU on my computer I am only getting like 3.5 IT per
-
00:25:57 second and this is like 1 IT per second.
-
00:26:00 Which is only 3 times slower, but this is totally free.
-
00:26:04 You don't spend like $1000 even more for a strong GPU.
-
00:26:08 You are able to use this 30 hours every week.
-
00:26:11 You see the VAE part is taking a lot of time because it is going to cache the VAE.
-
00:26:16 Okay it took total 39 seconds.
-
00:26:19 And this is the image we got.
-
00:26:21 Let's generate another one and see how much time it is going to take this time.
-
00:26:25 So since everything were cached, it is going to take lesser time.
-
00:26:29 Let's wait.
-
00:26:30 The speed is now 1.15 IT per second.
-
00:26:34 Okay 15.
-
00:26:35 Okay now this time it took only 19 seconds.
-
00:26:39 So it was first time 49 seconds.
-
00:26:42 In the second time it is only 19 seconds which is a very, very good timing.
-
00:26:47 You can't get this timing in Google Colab.
-
00:26:50 You can only get this like timing in a very strong computer.
-
00:26:53 Now we can use the first LoRA which we downloaded from the CivitAI.
-
00:26:59 So I click the LoRA tab.
-
00:27:01 I click refresh.
-
00:27:02 Now that LoRA should appear.
-
00:27:04 Okay you see it has appeared.
-
00:27:05 Let's append it and let's try to generate this image.
-
00:27:09 So I click info.
-
00:27:10 I copy the prompt.
-
00:27:12 Let's copy paste it.
-
00:27:14 Let's add the LoRA name and let's copy paste the negative prompt and paste it.
-
00:27:19 So let's hit generate.
-
00:27:20 Okay let's see the speed.
-
00:27:22 Since we have added LoRA.
-
00:27:24 It will be probably slower than the previous time.
-
00:27:27 But I will generate two images and see the final speed when we are using LoRA.
-
00:27:33 It is looking still very decent.
-
00:27:35 All right it took 20 seconds so we didn't lose much speed and we got a picture.
-
00:27:39 Okay it is working very well.
-
00:27:41 How about if you want to use the your own trained LoRAs.
-
00:27:47 Please watch this tutorial to learn how you can train your own LoRAs on a free Kaggle
-
00:27:52 account.
-
00:27:53 Currently I have my LoRAs uploaded into my data sets.
-
00:27:58 These are private so to upload your own models, ownb LoRAs you just need to click this icon.
-
00:28:05 Enter a title.
-
00:28:07 Don't enter non-English characters.
-
00:28:09 So let's say test 111 LoRA.
-
00:28:13 Then select browse files.
-
00:28:15 I have my last training LoRAs inside here, inside models, inside LoRA.
-
00:28:20 Okay, I have test Kaggle LoRA.
-
00:28:22 I will just going to upload it.
-
00:28:24 Open it.
-
00:28:25 It is going to get uploaded.
-
00:28:27 This totally depends on your upload speed.
-
00:28:29 Let's look at the upload speed from performance.
-
00:28:33 Okay it is uploading with my full speed.
-
00:28:35 It is 20 megabits per second.
-
00:28:37 This is my upload speed.
-
00:28:39 Okay the upload has been completed.
-
00:28:40 Now I will click create.
-
00:28:42 This will be private so no one else will have access to it.
-
00:28:46 It is test 111 LoRA.
-
00:28:48 Okay it was success.
-
00:28:50 However we can't use it directly.
-
00:28:52 You see it is getting added into my current session.
-
00:28:56 You can also use your uploaded data sets, your files in every other session that you
-
00:29:01 may have in future.
-
00:29:03 All you need to do is click this add data.
-
00:29:06 Select your data sets and click the plus icon here and then they will get added into this
-
00:29:12 session.
-
00:29:13 For example: let's also add class images from my previous video.
-
00:29:16 You see it is going to get preparing to download and they will get added into my session.
-
00:29:21 However we can't directly use this new LoRA.
-
00:29:24 Why?
-
00:29:25 Because our LoRA folder is not this one.
-
00:29:29 It is using the default LoRA folder at the moment.
-
00:29:31 So how am I going to use my new LoRA?
-
00:29:34 First of all you need to click either cancel run or this cell execution.
-
00:29:40 So let's click cancel run.
-
00:29:41 Let's clear all of the outputs.
-
00:29:44 Clear all outputs.
-
00:29:45 Then copy the path of this LoRA and paste it here.
-
00:29:50 Then I need to remove this # so it will get uncommented.
-
00:29:56 And now the Automatic1111 Web UI will look this folder for LoRA files.
-
00:30:02 However we have now some residual RAM.
-
00:30:05 You see it is using 3 GB RAM.
-
00:30:08 Unfortunately I couldn't find how to clear this RAM usage.
-
00:30:12 Even though I have installed this library, it is still using some RAM when it shouldn't
-
00:30:19 use any.
-
00:30:20 But let's try and see if it will work.
-
00:30:23 So we will start another instance of the Automatic1111 Web UI.
-
00:30:29 This time it won't install the libraries again because it was already installed and we didn't
-
00:30:35 restart our session or we didn't terminate our session.
-
00:30:39 Okay it is getting started.
-
00:30:41 This start should be very fast.
-
00:30:43 Yes it is getting started in like 30 seconds.
-
00:30:45 Maybe under one minute.
-
00:30:47 I am not sure.
-
00:30:48 Let's wait.
-
00:30:49 Yeah it took like 32 seconds and now we got our new link.
-
00:30:54 Let's open it.
-
00:30:55 Okay it is loaded with the SDXL base model file and the VAE.
-
00:31:01 Okay it is not using much RAM.
-
00:31:02 That is very good.
-
00:31:04 So let's use our new LoRA.
-
00:31:06 So I am going to use this prompt.
-
00:31:08 This is my LoRA activation tokens.
-
00:31:11 If you watch the other tutorial.
-
00:31:13 you will learn what is it.
-
00:31:14 Let's select our sampler.
-
00:31:17 Let's make the resolution 1024x1024.
-
00:31:19 This is the resolution that I trained.
-
00:31:22 Then I need to add my LoRA.
-
00:31:23 So click LoRA and now you see that LoRA is loaded.
-
00:31:27 Let's click it.
-
00:31:28 Let's generate 12 images and see which one will be very good.
-
00:31:33 Also I will enable After Detailer and I will just use this prompt when inpainting the face.
-
00:31:41 So let's copy this, paste it and let's delete this part.
-
00:31:45 Okay so this will inpaint the face.
-
00:31:47 I will also make the inpainting denoise strength to 50% like this.
-
00:31:53 Okay let's hit generate and let's watch the progress in here.
-
00:31:58 After this I will show ControlNet.
-
00:32:01 How to use ControlNet.
-
00:32:02 When the first time we generate after we restarted our Automatic1111 Web UI it will take a lot
-
00:32:09 of time.
-
00:32:10 It is also loading the LoRA weights.
-
00:32:11 Okay it is started.
-
00:32:13 The first time is slow as expected, but not very slow.
-
00:32:16 This is a 32 rank dimension having LoRA.
-
00:32:20 This was trained for SDXL on a free Kaggle account.
-
00:32:24 As I said watch this tutorial to learn how you can train your own LoRA's.
-
00:32:28 They can be style, they can be person, your face, anything.
-
00:32:33 Okay in the first generation it is taking time at the VAE.
-
00:32:37 Then it will cache the VAE and it will become much faster.
-
00:32:42 Okay let's see the second one.
-
00:32:45 But first it is inpainting the face because we are using After Detailer.
-
00:32:49 It is also working very well as we are seeing right now.
-
00:32:52 This is the first time run.
-
00:32:53 Then it will move to the next.
-
00:32:56 Okay it moved to the next one.
-
00:32:57 Now it is much faster.
-
00:32:58 You can see the speed comparison.
-
00:33:01 By the way if you are wondering where are the outputs are saved.
-
00:33:05 They are saved inside the Kaggle working.
-
00:33:08 Inside Stable Diffusion Web UI.
-
00:33:11 Inside outputs folder.
-
00:33:13 Inside text to images folder.
-
00:33:15 And we will see our outputs.
-
00:33:17 This is working exactly as it would work in your computer.
-
00:33:20 When you click here.
-
00:33:22 You will see all of the generated images.
-
00:33:25 Here you can download them.
-
00:33:27 So to download them, go to here.
-
00:33:29 Right click and click download.
-
00:33:30 And it will download the image.
-
00:33:33 Let's open it so I click it.
-
00:33:34 And you see this is the previous image we generated.
-
00:33:38 The new images will also appear here when I refresh.
-
00:33:42 You see the new one has arrived.
-
00:33:43 Okay the speed is very decent.
-
00:33:45 It is taking only 17 seconds to generate each image.
-
00:33:49 Then 18 seconds.
-
00:33:51 Of course, the face inpainting is also taking time.
-
00:33:53 It is taking like 10 seconds.
-
00:33:55 So total image generation is being like 28 seconds right now.
-
00:34:01 This is 1024x1024.
-
00:34:03 So this is a really high resolution when you consider Stable Diffusion SD 1.5 models.
-
00:34:09 You can also watch the progress here.
-
00:34:11 So all of the images have been generated.
-
00:34:13 The LoRA is working.
-
00:34:14 This was a very simple prompt.
-
00:34:16 So therefore, the results are not very good.
-
00:34:18 But the LoRA is working.
-
00:34:20 Now we can begin testing the ControlNet of Stable Diffusion.
-
00:34:26 How are we going to do that?
-
00:34:28 So I will disable After Detailer and I will open ControlNet.
-
00:34:31 This is the ControlNet interface.
-
00:34:34 To learn more about ControlNet please watch this master tutorial.
-
00:34:39 Hopefully I will also make a very comprehensive tutorial about Stable Diffusion XL ControlNet
-
00:34:45 options.
-
00:34:46 But they are pretty much similar.
-
00:34:49 So let's also clear all outputs here.
-
00:34:51 And let's load a beginning image.
-
00:34:54 So I will use my this image.
-
00:34:56 I will use this as a Canny.
-
00:34:59 So let's select Canny.
-
00:35:00 And you see it is automatically seeing the Diffusers XL Canny full model.
-
00:35:05 Where you can download these models yourself if you are not my Patreon supporter?
-
00:35:09 They are all shared in this Hugging Face repository.
-
00:35:13 The link is in the GitHub readme file.
-
00:35:15 That is why it is really important to read this readme file.
-
00:35:19 Okay Canny is selected.
-
00:35:21 Canny model is selected.
-
00:35:23 Let's enable preview.
-
00:35:25 So when I click this, it will show me the preview of this image as a Canny preprocessed.
-
00:35:31 You see like this.
-
00:35:32 Let's also enable Pixel Perfect.
-
00:35:34 And we are ready.
-
00:35:35 Now we can generate a new image based on this image.
-
00:35:40 So I will use my own LoRA and this prompt.
-
00:35:44 And let's generate one image.
-
00:35:46 Maybe two images.
-
00:35:47 And see the results.
-
00:35:49 It should be as in this format.
-
00:35:53 Okay let's look at the output of the command line.
-
00:35:57 Equivalent of the command line.
-
00:35:59 So it is going to load the SDXL config for ControlNet.
-
00:36:03 Since this is first time using.
-
00:36:06 By the way it is going to use more RAM because now it is combined with LoRA and the ControlNet
-
00:36:13 Okay we got a connection error.
-
00:36:16 Okay.
-
00:36:17 Okay, so what can we do since we have a connection error?
-
00:36:20 We can reload the browser and see if it is working.
-
00:36:25 Okay it is not working.
-
00:36:27 So we need to restart the Web UI instance.
-
00:36:31 So I will click cancel run.
-
00:36:32 This is all because of the limited RAM it provides.
-
00:36:37 Yeah we are having a RAM problem and it is not able to cancel run.
-
00:36:41 So sometimes you may encounter similar issues.
-
00:36:45 Sometimes the only solution could be restarting the entire session.
-
00:36:49 Be prepared for it.
-
00:36:51 When you also combine more things you may also get such out of RAM errors.
-
00:36:58 Okay it was restarted.
-
00:36:59 Okay very nice.
-
00:37:00 Now our RAM usage is dropped a lot.
-
00:37:03 It is entirely cleared.
-
00:37:05 Let's clear all of the output.
-
00:37:07 Clear all outputs.
-
00:37:09 Restart our Automatic1111 Web UI session.
-
00:37:12 Remember if you click this or click this, you will start from beginning.
-
00:37:16 You will install everything from beginning.
-
00:37:18 Okay it is going to start the instance pretty quickly.
-
00:37:22 Okay we got the new Gradio live link.
-
00:37:24 Let's open it.
-
00:37:25 It is getting loaded.
-
00:37:26 Alright so let's go to ControlNet.
-
00:37:29 Reload the image.
-
00:37:31 Maybe let's use this one.
-
00:37:33 Not that one.
-
00:37:34 So I will select Pixel Perfect.
-
00:37:36 Then I will select Canny.
-
00:37:37 Okay it is selected.
-
00:37:39 Let's say photo of a very famous and very handsome actor.
-
00:37:46 Or let's say very handsome male actor.
-
00:37:50 Let's change this to 1024 1024.
-
00:37:54 Let's change the sampling method and let's generate 4 images.
-
00:37:59 Okay everything looking good.
-
00:38:00 Make sure that you have enabled the ControlNet.
-
00:38:03 And selected the correct model and the preprocessor.
-
00:38:06 Let's watch the status here.
-
00:38:08 So the first time it will cache into RAM.
-
00:38:11 I am spending huge time to prepare these tutorials.
-
00:38:15 These easy to use scripts for you.
-
00:38:18 So I appreciate that if you support me on Patreon or with other ways that you wish.
-
00:38:23 You can also support me with cryptocurrency if you wish.
-
00:38:26 So I am open to every support or you can support me by purchasing my Udemy course.
-
00:38:31 Or giving me a Coffee or sponsoring me on GitHub.
-
00:38:35 All of them are available in the GitHub repository.
-
00:38:39 All of the links are here.
-
00:38:40 If you also go to this Stable Diffusion link and Star our repository I would appreciate
-
00:38:46 that very much.
-
00:38:47 We are almost 1,000 stars.
-
00:38:49 It is all thanks to you.
-
00:38:50 You can also fork this, watch this and sponsor me from here.
-
00:38:54 Okay the image is being generated.
-
00:38:57 And we can see the progress here.
-
00:38:59 It is not also using a lot of RAM.
-
00:39:02 So it also freed up the previously 3 GB RAM.
-
00:39:05 If you remember we had 3 GB RAM usage even though it should have been zero.
-
00:39:10 Okay the images are getting generated.
-
00:39:13 By the way ControlNet developer is doing a lot of updates all the time.
-
00:39:18 At this moment he could have made updates.
-
00:39:21 Let's look at the discussion thread from here.
-
00:39:25 So it is not perfect yet.
-
00:39:27 But he is working very hard.
-
00:39:29 You see his last reply is 1 hour ago.
-
00:39:33 So therefore, when you are watching this tutorial, it could be much better.
-
00:39:38 All right, we are getting some results.
-
00:39:41 So it should be much faster in the second image.
-
00:39:44 The first image took 25 seconds.
-
00:39:46 Actually the first image took 31 seconds.
-
00:39:49 Then 25 seconds.
-
00:39:51 Then it is 26 seconds.
-
00:39:53 Yeah.
-
00:39:54 And we are using the best Canny model.
-
00:39:56 Diffusers XL Canny full.
-
00:39:58 There are also smaller models hosted on the Hugging Face.
-
00:40:01 You can also download and use them.
-
00:40:03 We are generating 4 images.
-
00:40:05 Okay we got the results.
-
00:40:07 Let's see.
-
00:40:08 Okay this is the first result.
-
00:40:10 You see it is almost same picture.
-
00:40:14 And this is second result.
-
00:40:15 Third and the fourth.
-
00:40:17 And this was the used Canny preprocessed map.
-
00:40:20 I think this is because of the selected options error.
-
00:40:25 I also made several test sets.
-
00:40:27 So let's test with my prompt is more important and compare the results.
-
00:40:32 I will use the same seed.
-
00:40:34 So I click this icon.
-
00:40:35 It will use the same seed.
-
00:40:37 You see.
-
00:40:38 Let's see the results.
-
00:40:39 Okay this time the results are pretty significantly different.
-
00:40:43 So let's look at them.
-
00:40:44 First, second, third and fourth.
-
00:40:48 How well it can keep the shape of the input is amazing.
-
00:40:53 You see.
-
00:40:54 Almost perfect hands.
-
00:40:56 Almost perfect hand composition.
-
00:40:58 The face direction.
-
00:40:59 It is superb.
-
00:41:01 So after I have investigated all of the ControlNet options hopefully I will make an amazing tutorial
-
00:41:08 for ControlNet for Stable Diffusion XL.
-
00:41:10 Let's say you want to use ControlNet for SD 1.5 based versions.
-
00:41:15 So what you can do?
-
00:41:17 Let's clear all outputs.
-
00:41:19 Let's stop this cell execution.
-
00:41:22 Instead of starting from zero I will delete the temporary folder models.
-
00:41:29 However you can just click this and restart from beginning.
-
00:41:33 So I will type here a new command.
-
00:41:36 Which will be equal to rm -r and the path.
-
00:41:41 Actually I will add this into this command.
-
00:41:44 So you will be able to use this command when you are downloading from my Patreon.
-
00:41:51 Therefore you won't be needed to restart your session.
-
00:41:55 It will delete the older files and redownload them.
-
00:41:59 And this should get better.
-
00:42:01 Let's see.
-
00:42:02 Okay it is showing like this.
-
00:42:03 But let's execute and download all of the Stable Diffusion 1.5 based models.
-
00:42:08 And see if we will get sufficient space.
-
00:42:12 Okay it says that it already exists.
-
00:42:14 It is fine.
-
00:42:16 And okay, yeah.
-
00:42:18 The problem is I know the problem.
-
00:42:20 So I also need to add this command to here.
-
00:42:24 So let's delete this cell.
-
00:42:27 Then add this here.
-
00:42:29 And also add this here.
-
00:42:32 Alright.
-
00:42:33 And now let's clear all of the outputs.
-
00:42:36 And execute this again.
-
00:42:37 You won't need to do these changes when you are watching this tutorial.
-
00:42:42 Just download the notebook file and you will have this command ready.
-
00:42:47 So it did delete the older files from the disk space.
-
00:42:52 And then it is going to download the SD 1.5 ControlNet model files.
-
00:42:57 But it is still showing the disk space utilization high.
-
00:43:01 This shouldn't happen actually.
-
00:43:03 Because we deleted the older file.
-
00:43:06 I think it didn't fully delete them.
-
00:43:08 Yeah this is weird.
-
00:43:10 But let's see what happens.
-
00:43:11 If we get out of disk space error I will just start from the scratch.
-
00:43:17 I think it did put them into the trash bin.
-
00:43:22 Which shouldn't happen but it looks like it happened.
-
00:43:25 Let's see what will happen when we fully use it.
-
00:43:27 The download speed is amazing.
-
00:43:29 So it is not a problem if we start from the beginning.
-
00:43:32 Okay we are almost full.
-
00:43:34 Yeah I think we will get out of error.
-
00:43:37 Okay it says that you are approaching the limit of disk space outside Kaggle working.
-
00:43:42 Continued use may cause your notebook to crash.
-
00:43:45 Let's see if it will crash or it will give us some extra space.
-
00:43:48 Okay it downloaded all of the models.
-
00:43:51 Also our removal didn't remove the space.
-
00:43:55 So I won't add that line in the Kaggle notebook.
-
00:43:58 However it is allowing us to use 80 GB so there is some probably flexibility.
-
00:44:05 Let's restart our Web UI.
-
00:44:08 So probably we didn't need to stop our..
-
00:44:11 Oh we had to stop our Web UI instance because otherwise we wouldn't be able to execute this
-
00:44:17 cell.
-
00:44:18 That means when you are watching this tutorial, you can download both of the model files at
-
00:44:23 the same time since it allowed us to use 80 GB instead of max 73 GB which is nice.
-
00:44:31 Okay it is getting started and it started.
-
00:44:34 Let's open it.
-
00:44:35 Since this time we are going to use ControlNet models based on Stable Diffusion 1.5 based
-
00:44:41 models I am going to change the base model.
-
00:44:44 I am going to use Realistic Vision 5.1.
-
00:44:48 You can also use the base SD 1.5 model as well.
-
00:44:52 It is also automatically downloaded.
-
00:44:53 Okay let's see message.
-
00:44:55 Okay it says that it was a runtime error.
-
00:44:59 Okay let's try again because sometimes we may get this error.
-
00:45:03 We may get such errors.
-
00:45:05 Okay let's just wait.
-
00:45:07 Okay it is loading the VAE.
-
00:45:09 We will also change the VAE.
-
00:45:11 Okay model loaded I think.
-
00:45:13 Yeah we got another error.
-
00:45:16 I think this is because of the VAE.
-
00:45:17 Maybe let's first set the VAE none.
-
00:45:21 Okay then change the model.
-
00:45:24 This could be due to we are out of HDD.
-
00:45:29 Actually it shows the HDD here as green.
-
00:45:32 Maybe because of the it is displaying output not temporary.
-
00:45:36 Okay it is loading.
-
00:45:39 You see I will not cut these parts of the video because you may also encounter same
-
00:45:44 problems and you will learn how to solve them.
-
00:45:47 This is really important.
-
00:45:48 This is why you shouldn't skip my tutorials.
-
00:45:52 You should watch them entirely.
-
00:45:54 Okay this time it is loaded.
-
00:45:55 So first I made the VAE none, then reloaded the model and then let's select the best VAE
-
00:46:02 from the VAE selection.
-
00:46:04 Okay it is loaded.
-
00:46:05 Now we are ready.
-
00:46:07 So let's use 1.5 based ControlNet models.
-
00:46:11 I will use the same image.
-
00:46:14 You see enable Pixel Perfect.
-
00:46:16 Okay then select Canny.
-
00:46:18 Let's see which model it will select.
-
00:46:19 Okay by default it has selected the SD 1.5 version based Canny model as you are seeing
-
00:46:26 right now.
-
00:46:27 Let's also make the my prompt is more important and let's use the same prompt.
-
00:46:32 You can click this but I wonder if it will change the Stable Diffusion checkpoint.
-
00:46:36 Let's try.
-
00:46:37 This should load the last used prompt.
-
00:46:40 Okay it didn't load.
-
00:46:42 Yeah so I will download the last generated image.
-
00:46:47 I just click this refresh icon to it to expand the folder output.
-
00:46:53 Okay I think the last file is 23.
-
00:46:56 Yeah they are not sorted by name, so let's download.
-
00:47:00 Then let's go to png info.
-
00:47:02 Load the image.
-
00:47:03 We should see the prompt here.
-
00:47:05 Yes this was the prompt.
-
00:47:08 Let's type it.
-
00:47:09 Okay and since this is Realistic Vision, which one we should use.
-
00:47:14 Okay let's use 512 to 512.
-
00:47:19 Let's see the message here.
-
00:47:20 Okay it is going to load the ControlNet model.
-
00:47:23 It is loading the model, loading everything.
-
00:47:26 The generation will be much faster of course because it's a lower resolution.
-
00:47:30 And we got the output and this is the Realistic Vision output with this Canny.
-
00:47:37 You can also see the Canny preprocessor.
-
00:47:39 So this is the Canny preprocessor of the ControlNet extension.
-
00:47:43 I don't know if the preprocessor output is changing based on either it is SD 1.5 model
-
00:47:50 or SDXL model.
-
00:47:51 I think it wouldn't change but I haven't compared.
-
00:47:54 So I don't think so anything left except one thing.
-
00:47:57 What if if we want to download all of the generated images.
-
00:48:01 To do that I have a pretty easy script here.
-
00:48:05 So to be able to execute this cell, you see I am not able to execute it right now because
-
00:48:11 it is running another cell at the moment.
-
00:48:14 So I cancel run.
-
00:48:16 After canceling run you may get such messages.
-
00:48:18 It is not important.
-
00:48:19 Clear all outputs.
-
00:48:21 Then this cell execution will begin.
-
00:48:23 What this cell is going to do is it is going to zip entire outputs folder into the Kaggle
-
00:48:31 working directory with the name of generatedimages.zip file.
-
00:48:35 So you see it is zipped.
-
00:48:37 It is 62 megabytes because we didn't generate too many images.
-
00:48:41 So I click here and click download and I will download all of the images.
-
00:48:46 If you download multiple files it will ask you to allow multiple files download from
-
00:48:52 somewhere around here.
-
00:48:54 So pay attention to it and allow it.
-
00:48:57 Otherwise you won't be able to download multiple files, download any files.
-
00:49:02 So let's look at the inside of this downloaded folder.
-
00:49:05 I will extract it.
-
00:49:07 To extract it right click and extract.
-
00:49:09 I am using Winrar but on Windows you can also directly extract or if you can't extract,
-
00:49:15 you can install Winrar.
-
00:49:17 So extract generated images.
-
00:49:18 So they are here.
-
00:49:20 You see text to image grids and text to image images.
-
00:49:23 It has downloaded both grid images.
-
00:49:25 You see the grid images we generated and let's go back and all of the images we generated
-
00:49:32 in this tutorial are here.
-
00:49:35 And finally, when you are done, you need to click this and it will terminate your session
-
00:49:40 and delete all of the data if you didn't select persistence.
-
00:49:45 Everything here will be deleted.
-
00:49:47 Only the data sets you upload will remain.
-
00:49:50 Okay let's terminate and we have turned off our session.
-
00:49:54 Everything deleted and still I have 20 hours this week GPU time.
-
00:50:00 Next week it will get reset.
-
00:50:03 I hope you have enjoyed.
-
00:50:04 Please support me on Patreon.
-
00:50:05 This is super important.
-
00:50:07 You can also support me with buy me a Coffee.
-
00:50:10 You can also follow me on Medium.
-
00:50:12 I am writing articles there.
-
00:50:13 I am writing articles on CivitAI as well.
-
00:50:16 You can support me there.
-
00:50:17 You can follow me on DeviantArt.
-
00:50:20 Also on our channel.
-
00:50:21 We have amazing videos as you are seeing right now.
-
00:50:25 You should watch all of them.
-
00:50:26 If you want to learn more about Stable Diffusion, more about AI because I have mixed tutorials
-
00:50:33 and videos but mostly about Stable Diffusion recently.
-
00:50:37 You can also follow me on LinkedIn.
-
00:50:39 I am not an anonymous person.
-
00:50:41 I am a PhD computer engineer.
-
00:50:44 So you can follow me on LinkedIn.
-
00:50:45 You can connect with me on LinkedIn.
-
00:50:48 I also have a Udemy course.
-
00:50:50 If you purchase my Udemy course I would appreciate that very much.
-
00:50:54 You can support me by purchasing my course.
-
00:50:56 You see I have already 182 students and we are growing.
-
00:51:01 I thank all of you who purchase my course or support me on Patreon.
-
00:51:08 It is super important.
-
00:51:09 You can also follow me on Twitter.
-
00:51:10 I am sharing a lot of useful information here so you won't regret it.
-
00:51:11 Hopefully see you in another amazing tutorial video.
