Getting Started with Stable Diffusion in 2024 for Absolute Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone and welcome back to the channel in this video I want to show you how you can start generating your own AI images using stable diffusion which runs locally on your own machine so you can run it at will however often you want without any limitations and if you don't know what stable diffusion is you may have been living under a rock stable diffusion is one of the currently most popular text to image AI based models that you can use to generate AI images whether you call it AI art or not is a whole another discussion maybe a topic of another video that I'll be making but you can generate some really really amazing photo realistic or artistic or you know just Creative Images for all sorts of things using stable diffusion I've been using it for a lot of my own wallpapers that I've generated just you know just because I wanted something nice on my desktop that I couldn't just get online as here's one for Japan you can also generate you know images of cats of cityscapes of people of you know monsters cuz I like grimy and horror so I've done a whole bunch of that sort of stuff with stable diffusion the other thing I I've used stable diffusion for a lot as well as to generate some concept images for a video game I've been trying to create so there's a whole bunch of images generated by stable defusion it has a lot of really powerful features you can you know use input images to generate images that are like the images that you feed into it it now supports text to video as well as video to video and a whole bunch of other Advanced features but in this video I just want to go over the absolute basics of how do you get started setup install stable diffusion and how do you start running and generating your own images on your own computer so I want to run through all of that in this particular video timestamps and everything so you can jump to what you might find relevant or interesting will be down in the video description YouTube also adds the chapter so you can just jump to wherever you want to and any questions you might have comments feedback leave that down in the comment section I'm pretty proactive reading everything and try to answer as much as I can so just utilize that as much as you want to now in order to run stable diffusion you do need a couple of things the first thing you need to do is you need to download python python is a programming language and stable diffusion runs on python so any machine that you can install python on be that Windows Mac Linux you can run stable diff Fusion on so if you jump over to python.org downloads and I'll drop all of the links down in the video description as well as well as a little you know step-by-step instruction of what you need to do to get up and running as well just jump to python.org downloads and then just simply cck download python 3.1 2.1 or whatever the latest version of that might be and then just save that out your local computer and then all you have to do is run that installer to make sure that you add python to the path because you still need to execute it from the command line but again VI scripts and I'll show you how to do that later it's not difficult it just it sounds scary first just install python onto your machine then that is done the next thing you need to do is you need to download a stable diffusion model which is essentially the AI built model that contains all of the knowledge of how to generate the images now there's a bit of misconception that these models contain copies of images that they found online which isn't really the case it's more like imagine a a robot looking at every single image within a very big image database and remembering what's the shape of a cat what's the general shape of a human or house or tree and so that when you ask the AI to generate me a tree it just has the knowledge of how generally to shape up a tree based on all the images it seen it's kind of like drawing from memory now that is not to say that there isn't you know legal issues and copyright questions and a whole bunch of things that people are still trying to figure out a lot of controversy around that and again might be the topic for another video if you guys are interested but you can get these stable diffusion models for free online and the easiest place to get them is just come to stability AI which is the company that makes and releases stable diffusion and by the way stable diffusion is open source so the source code for stable diffusion is freely available online you can look at it you can download it you can modify it it's all free in that way and so are the models that stability AI releases so come to stability. a and then you can come down and you can look at the different models and all of these AI models excel at something specific the latest one is sdxl Turbo which is a really fast version of the stable diffusion model but it you know Works slightly different to what you'll find mostly online so the one I want to go with for this video at least is stable diffusion XL and you can see some of the example images that have been generated using this model and it's it's just mind-blowing what you can do with this so let's close this out and down here now you can generate images online without running anything on your computer but you will have to pay for that privilege on a Pro Plan for stability AI we actually just wanted to downloaded the model and run everything locally on our machine so let's click on download code and this will open up a GitHub repository which is essentially a a place where developers can place code and you know technical stuff don't worry too much about it let's just scrub all the way down skip over all of the news and all of the other bits and pieces what you looking for are these links to sdxl base 1.0 there's also a refiner which is kind of like a second pass over your image to improve some of the details and hands and feet and enhance the image we're not going to worry about that at least not for this particular video so simply click into this sdxl base 1.0 and again don't worry I'll I'll put all of the download links down below the video and then you're going to come to huggingface doco which is a site that houses a lot of the stable diffusion and AI text to image or text to video models and information um and in here this is the one for stability Ai and stabil diffusion XL the base model 1.0 again just ignore all of the technical stuff but it is actually really interesting if you want to know how these models work again I can make a separate video on that read through some of the text specs it's actually really exciting I think on how these models actually work or if none of that is of interest you you just want to generate some images just come into files and versions up here at the top come down a little bit and the one you want to download is sdxl base 1.0 vae which stands for variable Auto encoder again just a part that improves the image as it comes out but it's all baked into this one model here and let just click on this download file Link at the base then let's download this file now it's pretty massive some of these models are you know many gigabytes this one is 6 GB I'm going to let that download in the background while we get set up with the rest of the stuff now we've installed python which is the runtime that's going to run stable diffusion and we are downloading the model that stable diffusion will use to generate our images we do need stable diffusion itself however and the way to get that simply come into Google and search for stable diffusion UI and again another GitHub code repository called stable diffusion web UI and again links down in the video description and this is the actual code the actual executable code that runs stable diffusion with a nice little webbased interface that you can then enter your text in and run your prompts and you know look at your images and everything like that so up here if you have git installed if you know what that means you can just download the GitHub repo you can just clone it to your local machine if you don't know what git is you don't really care up here where it says code just click on this little drop down here and we're just going to say download zip so we can bypass all of the deie things and just download the whole thing thing it's going to download stable diffusion webui Master zip to our local machine so let's do that back in the folder where you downloaded everything so there's our stable diffusion webui Master zip file let's unpack all of that here why not into stable diffusion web UI master so let's jump into this particular folder okay a sub folder doesn't really matter too much and in here is stable diffusion everything that you need to run it as well as add the models that you want to use to generate your images or tools for modifying images or trending your own models everything sits in here and again if you're a Dev or an engineer there's some fascinating stuff in here worth looking through and understanding how it all hangs together if you're not the easiest thing you need to do is you need to execute web user UI batch file if you're on Windows or web user UI shell file if you're on Mac or Linux so I'm on Windows I'm just going to double click this web UI user batch file and that is going to now kick off and execute Python and install all of the dependency all of the packages and all the other bits and pieces that I need to run stable diffusion locally now this might take a while because it's going to download quite a lot of data run through a lot of different tools and get everything set up and then it's going to launch the web UI that we're getting which will then allow us to enter our prompts and run images as well as use our different models to generate the images so I'm going to let this run you may see me just hop out a little bit while this runs because again this this can take a little bit so I'm just going to Tinker while this runs okay here we are and don't worry this only happens the very first time you launch stable diffusion from here on it usually starts up within 10 to 20 seconds so it's just the first time that this is really slow so now stable diffusion has installed all the dependency and it has launched the webui which is where you can do everything with stable diffusion that you may want to do now the first thing you need to do if you want to generate any images with stable diffusion is you need to select a stable diffusion checkpoint by default if you click on this drop down here there's V 1.5 pruned EMA only safe tensil it's like a dummy model but it's enough to test whether this whole thing is even working so let's simply in this prompt field here right uh cute sleeping cat Outdoors quaint porch evening light and then let's hit generate over on the right hand side and see what happens and show enough it looks like a cat sleeping outside on the porch so this seems to be working however the default model isn't terribly great so let's come back to our download folder and yes the sdxl base 1.0 safe tenses file has downloaded and it's 6.7 GB so that took a little bit so let's cut this out and we need to move this into the stable diffusion webui Master folder and it goes under models and in here you'll find stable diffusion so double click into that and paste or move your model into that let's come back to the webui hit Refresh on those checkpoints and now in this drop down you should have sdxl Base 1.0.9 VA let's click on this and load it up it's it's going to take a little while while this model is being loaded and if you pull up the console where you've launched the web you can see what's happening down here it's now loaded this model let's come back to stable diffusion repap and hit generate again to regenerate that image using a different model and yeah that is still a cat on the porch outside at evening light now with stable diffusion XL you should really be changing your resolution so right now the resolution of our output is set to 512 x 512 which used to be the resolution at which some of the earlier models for stable diffusion were trained so they trained on images at this resolution which meant the outputs were best using that resolution stable diffusion XL however and some of the new models use higher resolution so I highly recommend change your width to 768 by 768 obviously that's going to take longer to generate depending on your graphics card and stable diffusion does require a fairly decent graphics card I would recommend at least 4 GB of vram the Nvidia RTX cards work really really well for this so let's hit generate and regenerate that image and yeah it's still a cat on a port outside don't like that it's kind of cartoony looking so let's refine our prompt just a little bit let's add photo and realistic into our prompt and let's regenerate our image and that looks pretty cool you can click on this image to zoom in and you can see the iess and the fact that it's generated and the fact that this cat seems to be missing a leg this is just some of those things that you'll have to encounter and you'll have to fix them manually either with in painting or with some other trickery to kind of get them to look just right but let's just come back let's just maybe just generate one more so you can see that every single time I get a new image generated that matches my prompt and there is a lot to how you do the prompting both the positive as the negative prompt some of these parameters they all influence that final image but that's beyond the scope of this video from this point just play around and just have some fun and see what you can get there's some amazing stuff you can do and I'll cover all of these parameters and how to prompt properly as well as some more advanced prompts and other stuff with stable diffusion in later videos and again if you have questions you want to see something specific or you're just getting stuck somewhere just drop me those comments down below and I'll get back to you I'm just I'm really excited I really like stab diffusion and some of these other cool tools that are coming out everywhere with AI everything um even though there are you know questions around copyright impact of eye on the workforce and how everything is Shifting know there's a lot to unpack don't want to get too much into it but it is a really cool tool to play with and I've used it for tons of my own personal stuff and just have fun with and play around but with that I'm going to wrap up this video If you enjoyed it please hit that like button subscribe to this channel if you want to support me it really helps me out and I greatly appreciate it and with that thank you very much for watching and until next time I will see you later
Info
Channel: Surfaced Studio
Views: 3,400
Rating: undefined out of 5
Keywords:
Id: mcqREz9xE74
Channel Id: undefined
Length: 12min 56sec (776 seconds)
Published: Sat Feb 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.