How To Install Stable Diffusion Automatic1111 [2023]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right so you might be aware of like text to image models that are available in the market among them the most common ones are like mid Journey which is like the leading text to image generation model then we have Dolly 2 which is by open AI then we have like Bing image Creator all these models are actually working on the concept of stable diffusion so you might be wondering that if you can download and install a stable diffusion model locally onto your system well the answer is yes you can download and install an opensource stable diffusion model so in this particular video actually I will try to show you how to set up like stable diffusion locally into your system so that you can start generating uh images from textual prompts actually okay and let's get started first of all we will install git in our system so I'll just type git and download so you will come here on this website and here is the official website of git you can see right over here so you need to download it for Windows yeah 64bit git for Windows setup so yeah it will be done in a while so now I need to check like which version of python I'm using okay so I'll say python minus minus version inside of my command prompt yeah it's 3.11.4 and let's see what's the latest that's on the web okay python yeah if I go to downloads like currently the version is python 3.1.5 so if you are like up to 3.11 it's totally fine for you so I'll tell you like how you can download and install the python on your system okay first of all you need to click on this thing you need to download the setup so this one is the setup you can see right over here so I already have 3.11.4 so I'm not going to download like 3.1.5 they are pretty much the same if you are like running 3.9 3.10 so you need to update to the latest version which is like 3.11 something okay so my python is installed so what you need to do is you need to run the installer so now you need to just click on whatever you want to do I can just upgrade now if you don't have already installed it will say like install now okay so now let's update it to the latest one so that's fine make sure while installing you will receive a check box here like add python to path so make sure that you check that box okay otherwise it won't be added to path and you won't be able to use Python inside of your system so that's the important thing now what you need to do is you need to install stable diffusion onto your system okay this is the repository which we need to F for uh like installing this table diffusion for us the main interface would look like something uh like this where you can generate image like text to image image to image XR PNG info and uh many other options okay so for this you need a pretty much competent system like having a GPU like uh 1080 would be fine GTX 1080 or 1660 something like that so my python is successfully installed I can just close this thing okay so yeah this is the repository which we will be using to actually install stable diffusion onto our system now we actually need to clone this repository uh you remember we just downloaded this git so we need to actually install this first because you'll use this G to actually clone that repository for us okay so if you just click on next next yeah next that's fine just move on with the flow and install it onto your system okay it will take a while to install the git onto your system then we can clone the actual repository which is this one yeah it's done now what you need to do do is just get this URL open up CMD once again and now we can give it a prompt like get clone and the URL of the repository like this one so if we just hit enter so now it says like cloning into this thing so it will take a while and it will be done for you okay like this repository is now moving by the help of this package manager which is get into your local system yeah it's done you can see right over here it's now onto your system so now once it is actually installed onto your system you just need to move to the local dis C onto the users and the user on which you installed your git repository if you just move down so this is your repository you can see right over here that all of these files are now available locally onto your system that was something you needed to actually run this locally so you can see that all of the files are here except of the models the models are not here you need to actually put in your models here in order to run them okay the thing you downloaded is actually the UI for that models so the models are available online we will be downloading the models and then we will incorporate those models inside of the system so now you need to actually go to this website like which is hugging phase. Co It Is by Runway ml we already saw Runway because it's actually amazing so you can get the models and data sets from here so this is really an amazing app okay the L to this thing will be available in the description as well the first thing is that you need to just sign up on the hugging face website so you need to provide in with your email and then you need to just provide a password okay now we will see how to get this model inside of your UI so you can use that okay so to get the model if you just scroll down a little bit so you can see that there are two models okay the first one is like 4.27 GB and the second one is like 7.7 GB like they're pretty much similar in the working but the major difference is like you can see the first one it uses like EMA only weights uses less vram and suitable for inference okay second one uses like EMA plus non EMA weights uses more vram and suitable for fine tuning uh so the models you get from hugging phas they are actually designed differently to adapt to different conditions you don't need to worry about the differences between two we will discuss it later on as well so for now let's just download this thing okay so it will just take a while so I will be back when it's done all right so now as you can see our model has successfully being downloaded so if I just move on to my downloads folder so here it is so I will just cut the file from here go to local disk C inside of users and my user where I have saved that UI okay so here it is so now here what I will do is I will just come inside of models stable diffusion and I will paste in my model right here so you see it's done so now you need to make sure that you rename your model to model. ckpt if you don't rename this file so for some reason your UI won't be working so your model is here your UI you have just foged it from like it so now what you need to do is you need to run this file so now we need to run this file okay this window batch file webui dobat so if I just open this thing so for the first time it will take some time because it will load necessary libraries into your system but when you open it for the second time so it wouldn't take that much time okay it will just run straight away so you see it's installing torch and torch Vision so it's installing a bunch of libraries into your system so for the first time it's necessary so it will take a while yeah all right right you can see right over here that the pie torch is done and it's now installing the other libraries like ginger 2 numai pillow and other things okay you can see right over here like you can see install these packages into your system to make sure everything runs fine all right everything was done installing but I get this error like runtime error torch is not able to use GPU okay and it says add Skip like uh for C test to command line a variable to disable this check for some reason I'm getting this error because uh my system has like AMD uh graphics card okay so I don't have Nvidia graphics card so that is recommended for this thing but don't worry I will tell you like how to remove all of the errors and how to actually get rid of everything that you need to actually do here all right so let's see how to get get rid of these errors so the first thing you need to do is actually I instructed you to download python the latest version of python okay but when I came across this error and I just move onto the GitHub page of this repository and if I just scroll down it says like install specifically python 3.10.7 like newer version of python does not support torch so this is the main issue first we need to actually resolve this thing first to do so what you need to do is move on to your control panel okay and then you need to First uninstall Python 3.11 and python launcher okay and then what you need to do is go to Google and type python 3.10.7 you need to install this specific version just click on python release this thing and then download this window installer 64-bit then you just need to run it let me show you how you can do it but first you need to uninstall these both things okay so if I just just open this thing up so now what you need to do is you will just get a prompt like of install just click on install and click on add to path just check add to path down here and click on install it will be installed for you okay I already have installed so I will cancel this thing out so the next thing you need to do is you just need to delete this stable diffusion folder just get rid of this old folder come back to CMD okay and again type in get clone and you need to specify the URL again just paste the URL here you'll just press enter and it will again download that specific folder for you okay the third thing you need to do is obviously you just install the folder again so what you need to do is come back to the model section okay you need to import the stable diffusion model once again okay which we downloaded like it's here you can see right over here we downloaded this file just cop copy this thing paste it inside of like this folder and just rename it to model. ckpt file it's all done here then what you need to do is you need to again run this file which is webui do like Windows badge file now when you will again run this file what it will do is it will then initialize it according to that thing okay like initialize it according to the python 3.1.6 Okay so then it will again download torch and necessary libraries what it will do is it will then again give you this error like torch is not able to use GPU so that's not an issue so you see it just provides me with this thing add like this thing to commandline arcs so what you need to do is just copy this thing come to this thing like web UI user Windows badge file okay and then show more option and just click on edit it will open notepad so here you need to to three things okay first you need to add in this thing get pull because whenever a new update or model will come so it will update it accordingly so now here by default it would be empty so you need to add this thing like which we copied skip torch CA test okay so now it will skip the torch Cuda test so now if you don't have GPU it doesn't matter it will work with your CPU so your CPU should be a high-end system like having more cores and threads so you need to add this thing as well like Dash Das Precision full no half why because if you don't add this thing so you will get an error of like no half error if you get that error you can add this thing as well so after adding all of this thing it would be done so then what you need to do is you actually need to run this file not this one okay because you can see right over here so first it will like apply all of these things okay get pull set by python equal set git equal set VNV directory equal set command line equal then it will call like web UI dobat after setting all of these things okay so now you don't need to run this thing you need to actually run this file which is web UI user dobat so if I now run this file you will see like it says unpacking objects and something like that and now it's launching web UI with arguments like skip torch Cuda test like Precision full no half so now it it will take a while and the model will be ready and available to use so the first line which we add G pull it's actually showing the response here like already up to date because our model is already up to date so now it's giving you an exception just ignore this thing because it says no Nvidia driver on your system because I don't have any Nvidia graphics card okay so now you see my model is up and running it just provided you with this URL where you can test out your application yeah like you see it says model loaded in like 39 seconds load weights from dis 29.2 seconds and all of this stuff so this is the URL which you actually need to take and paste on your browser if I just copy this URL come back to my main page and paste my link here okay so now your application will be loaded okay all right so now we will see like what stable diffusion UI is all about out and how you can use it efficiently to create images uh to Showcase your creativity our UI is live now so now the first thing is like you need to choose your model so I have chosen like model. ckpt which would downloaded from the internet it was like 4 gabt of the file so the first thing here in this section is text to image okay the first one is text to image then there is image to image then X then PNG info checkpoint merger training setting and then extension okay so the first thing we will be explaining here today is like text to image okay the first thing here is the prompt the actual prompt for which you need to create an image like in the prompt section you need to describe what you want to see in the images for example you can give a prompt like a big elephant marching towards jungle anything okay and the negative prompt is something like you don't want your model to generate like this is the Dos that you want your model to do and these are don'ts like you can see blur image the image should not be blur or something like that so this is like negative prompt you also need to take care of that thing as well okay so if we talk about sampling method there are multiple methods you can like explore but UL a is the most basic one so first we can just check the width and height of the images you can actually make it large or small so make sure that to start off you just give like 512 x 512 it is the most uh effective way to like uh get the images from your model then we have actually the batch size this thing right over here okay it's the number of images to be generated each time you want to gener at at least a few when testing a prom because each one will differ okay like if you increase the badge size to like three or four I recommend to just keep it to four because it will produce four images for you after filling all of these things you can just click on generate button to generate the images we will be testing that as well okay you can also save the images to your local directory so that's an important feature okay so that's all you need to know for the basics the rest of this video will explain explain each function in more detail if you're not interested in like technicality of this thing you can just start generating and that's all for you if I talk about this thing like stable diffusion checkpoints you can add in like multiple models if you want to switch between models like different model have different outcomes different purposes so you can check out different models according to your need you can download the models from the website hugging face so if we talk about like sampling method in more detail basic basically the algorithm for D noising process like we can use DMP Plus+ okay this thing right over here if I just show you uh like DMP Plus+ 2m like this thing okay because it balances speed and quality well uh but to start off you can just uh choose UL a that's totally fine for now okay if you talk about like sampling steps it means that number of sampling steps for the denoising process the more the better but it also takes longer okay if you don't have a high-end GPU installed in your system it would take like ages okay 25 steps work for the most cases but at the beginning I would recommend to keep it to 20 that would be totally fine okay we talked about batch size so if we talk about like batch count so batch count is number of times you run the image generation pipeline obviously the higher the badge count is the uh more time it will take and the higher the batch count and badge sizes the total number of images generated basically equals the batch count times the badge size for example if you have a badge size of four and a badge count of two it will generate a total of eight images okay so make sure that as well now we will talk about like CFG scale actually means classifier free guidance scale it is a parameter to control how much the model should respect your PR if it is one it mostly ignores your prompt if it's three it's like being more creative if it's seven it means that a good balance between following the prompt and freedom okay so what it would do is it would follow your prompt as well and at the same time it will be creative as well if it's 15 so it will like more kind of Follow Your prompt okay and if it is like 30 in some case if you put it like 30 the maximum so the maximum means that it would like strictly follow your prompt so make sure that you keep it to seven when you're starting off then you can actually change it and do it according to your need okay then we'll talk about the seed this thing right over here okay the seed value used to generate the initial random tensor in the latent space like practically it controls the content of the image each image generated has its on seed value okay like this UI will use a random seed value if it is set to Min - one okay now we have discussed everything in this UI so now let's try to generate a image okay I will give it a prompt like photo of woman with dress like City night background background should be like City night life and she must be wearing a bracelet okay you can like specify maximum of like 75 words in it okay we are not going to provide negative promt if we just talk about like sampling method uler is fine sampling steps right 20 width and height 512 cross 512 okay badge count 1 and badge size 4 total it would generate like number of images would be four CFG scale would be seven seed minus one with these all settings I'll just go and hit generate okay so now if you move on to your uh this thing right over here so just says like uh total like 0 of 20 it would take some time 0% is done it's already produc producing this thing it will take a while okay all right so the generation is done but I am afraid like it took a lot of time okay so for some reason if you are using it just on your CPU and if you're not using GPU just then you should proceed with like uh what I can say here default setup okay just do not tweak with any parameters because you can see here like it just took me around like 77 minutes and 30.5 seconds so it's a lot of time for a single image generation so you can see the results they are great they look like cool and amazing if we just click on this one so this is you know a complete four images okay you can save it as well you can just uh choose one of them as well uh this one doesn't seems good okay eyes are blur this one seems kind of great this one the face is blurred so you can actually provide in here okay negative prompts like Blurry phase so it would take this actually to generate it not a blurry phase this one looks cool okay so yeah the art is actually how well you given a prompt so that's the thing okay and you need to actually fine tune the parameters as well so that's the basic actually the walkth through of this thing all right so I hope you got the idea like how this thing works and how to use it to generate images okay I think that marks the end of our this video already this is uh like going too long so I hope you like this one thank you so much for watching this video and I shall catch you up in the next one till then have a good day bye
Info
Channel: SkillCurb
Views: 14,490
Rating: undefined out of 5
Keywords: stable diffusion, stable diffusion tutorial, stable diffusion ai, stable diffusion ai art, stable diffusion 2.0, stable diffusion gui, stable diffusion installation, stable diffusion guide, automatic 1111, automatic 1111 local, 1111 install, git pull, git pull tutorial, python install, python setup, stable diffusion 2, adobe alternative, adobe competition
Id: 57H0Ah_iUO0
Channel Id: undefined
Length: 22min 57sec (1377 seconds)
Published: Mon Nov 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.