Install Stable Diffusion Locally in minutes (Step by Step)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this particular video I will show you how to set up like stable diffusion locally into your system so that you can actually start generating images from text textual prompts actually 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 Kit you can see right over here so you need to download it for Windows yeah 64-bit 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 if I go to downloads like currently the version is python 3.11.5 so if you are like up to 3.11 7 it's totally fine for you so I'll tell you like how you can download it 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.11.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 so let's update the python and then see like how things will move on for us okay it will be done in a while now what you need to do is actually you need to install stable diffusion onto your system okay so this is the repository which we need to fork for uh like installing this table diffusion for us so this would be the interface okay the main interface would look like something uh like this where you can generate image like text to image image to image access PNG info and many other options okay so for this you need like a pretty much competent system like having a GPU like 1080 would be fine GTX 1080 or 1660 something like that so so my python is successfully installed so you can see right over here I can just close this thing now if I check my python version once again I say python minus minus version so yeah it's updated on like 3.11.5 okay so that's pretty much cool we need to install like the latest version and I'm already on the latest one okay so yeah this is the repository which we will be using to actually install stable diffusion onto our system okay now we actually need to clone this repository okay uh you remember we just downloaded this git so we need to actually install this first because we will use this git 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 okay yeah it's done so just click on finish or maybe yeah just click on finish now what you need to do is just get this URL open up CMD once again and now we can give in a prompt like git clone and the URL of the repository like this one okay so if I 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 now what actually it is doing is it is actually cloning this repository locally onto your system like this repository is now moving by the help of this package manager which is get into your local system okay yeah it will take a while and yeah it's done you can see right over here it's done and it's now on to your system so now once it is actually installed onto your system you just need to move to the local list C on to 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 so that's the important thing and that's that was something you needed to actually run this locally okay so you can see that all of the files are here okay all of the files that that were important are now here if you see except of the models okay the models are not here you need to actually put in your models here in order to run them okay so we will be downloading the models in a while so just stay tuned we will be doing that just in a while okay the thing you downloaded is actually the UI for that model so the models are available online we will be downloading the models and then we will incorporate those models inside of the system okay so now you need to actually go to this website like which is huggingface.co it is by runwaymo 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 link 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 like you need to create one then I can just click next okay so now I can just choose my username full name Avatar it's optional optional optional optional okay so I can just click on create account it says like the username already exists so let's change the number or maybe I can just add in something else okay let's click on create account once again now it says like please click on the thumbnail that is not an animal I don't know how it works maybe this one next not an animal this one yeah now it's actually done so you will actually receive an email to confirm your email address so let's just move on to Gmail really quickly and then just confirm your address okay yeah it's done now if I just move back to my URL so this was it okay now we will see how to get this model inside of your UI so you can use that okay so to get the models you just scroll down a little bit so you can see that there are two models okay the first one is like 4.2 7gb and the second one is like 7.7 GB so the major difference between two like they're pretty much similar in the world King but the major difference is like you can see the first one it uses like EMA only weights uses less speed RAM and suitable for inference okay second one uses like EMA plus non-ema weights uses more vram and suitable for fine tunings so the models you get from hugging face they are actually designed differently to adapt to different conditions so every bottle has like different design and it's designed to actually work differently okay so you need to understand that thing for now 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 like my internet connection isn't like really good so it will take a while to download so I will be back when it's done okay so stay tuned all right so now as you can see I'm model has successfully been downloaded okay 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 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 okay so you see it's done so now you need to make sure that you rename your model okay to model dots ckpt okay 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 forged it from like git so now what you need to do is you need to run this file okay uh where is that file yeah let me just change the style of the display okay so now we need to run this file okay this window batch file web UI dot back okay 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 so for the first time it might take some time 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 the first for the first time it's necessary so it will also take some time like you see it's 2.6 gigabytes so it will take a while so I will just pause the video here and I will be back when it's done okay so like it's showing me that it would take like about 20 minutes so I will be back after that okay yeah all right you can see that right over here that the pie torch is done and it's now installing the other libraries like ginger 2 numpy pillow and other things okay you can see right over here so probably it will be done in a while okay yeah then yeah now it's installing numpy markup and installing like necessary libraries okay now you can see install these packages into your uh 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 torch Cuda test to command line orgs were able to disable this check okay for some reason I'm getting this error because my system has like AMD graphics card okay so I don't have Nvidia graphics card so that is recommended for this thing but don't worry in the next video I will tell you like how to remove all of the errors okay and how to actually get rid of everything that you need to actually do here okay so the first thing you need to do is actually in the previous video I instructed you to download python the latest version of python okay but when I came across this error and I just moved on to the GitHub page of this repository and if I just scroll down it says like uh you can see right over here okay wait yeah here installation and running yeah you can see that it says like install specifically python 3.10.6 okay like newer version of python does not sport torch so this is the main issue first okay then you need to add python to paths and then install git okay we already have installed git so we need to actually resolve this thing first to do so what you need to do is move on to your control old panel okay just type in control panel in Windows if you're on Windows then you need to move to like uninstall a program and then you need to First uninstall Python 3.11 and python launcher okay and then what you need to do is you need to go to the python just go to Google and type python 3.10.6 okay you need to install this specific version just click on python release this thing and then download this window installer 64-bit okay like it will be installed on your system then you just need to run it okay let me show you how you can do it but first you need to uninstall these both things okay so if I 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 so 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 okay just get rid of this old folder come back to CMD okay and again type in git clone and you need to specify the URL again this thing right over here okay 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 copy this thing paste it inside of like this folder and just rename it to model dot ckpt file it's all done here then what you need to do is you need to again run this file which is web UI dot like Windows batch 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 3.10.6 okay so that it will again download torch and necessary libraries okay but 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 command line 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 two to three things okay first you need to add in this thing git pull because it will actually update the model accordingly whenever a new update or model will come so it will update it accordingly so now here by default it would be empty like this okay so you need to add this thing like which we copied skip torch Cuda test okay so now it will skip the torch Cuda test so now if if you don't have GPU it doesn't matter it will work with your CPU okay so your CPU should be like a high-end system like having more cores and threads so you need to add this thing as well like dash dash 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 if I just go to like edit option so first it will like apply all of these things okay git pull set python equals set git equal set VNV directory equals set command line equal then it will call like web UI dot bad 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 Dot bad so if I now run this file so you see 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 okay so now it will take a while and the model will be ready and available to use so the first line which we add git pull it's actually showing the response here like already upgraded 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 okay 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 okay load waves from disk 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 here actually I just tested it out before so this image you can see right over here okay so let's close all of these instances and I can just open up a new tab and paste my link here okay so now your application will be loaded okay so that's it for this video unlike how to remove errors and successfully run stable diffusion on your local machine or local system okay so that marks the end of our this video I hope you like this one thank you so much for watching this and I shall catch you up in the next one till then have a good day bye all right
Info
Channel: SkillCurb
Views: 8,485
Rating: undefined out of 5
Keywords: install, stable, diffusion, stable diffusion, midjourney alternative free ai, midjourney competitor, image generation ai, stable diffusion ai, free midjourney alternative, stable diffusion tutorial, AI, AI Art, AI Art Models, AI Art Tutorial, Artificial Intelligence, Cloud Stable Diffusion, Generative Art, GitHub, Hugging Face, Install Stable Diffusion, Local Install, Local Stable Diffusion, Machine Learning, MidJourney Alternative, Stable Diffusion, Stable Diffusion Tutorial
Id: tXGlNraLvAc
Channel Id: undefined
Length: 18min 31sec (1111 seconds)
Published: Sat Sep 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.