Generate Your Images Faster by Installing Stable Diffusion With Google Colab!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello today we are going to be talking about how to store stable diffusion using Google call up stable diffusion is a generative model mainly used for image generation and video generation and can be used for free by anyone I already made a video on how to install stable diffusion on Mac locally but stable diffusion is computationally expensive so sometimes can be very slow that is why today we are going to use Google collab to install it on the GPU instead of locally on your computer Google collab or collab is a cloud-based platform which allows you to run python code on a jupyter notebook environment there are many advantages for using Google collab the first one is for free you don't have to install softwares or libraries on your computer locally which can be time consuming and it's very good when you are collaborating on a project because you can share the notebook first and second you can work on a project on real time so let's get started this is The Notebook we need to open the link is in the description below the first thing we want to do before starting is to make sure that we are running our code on GPU to do that we go into runtime up here change runtime type and then you need to make sure that this is GPU and Save great so now let's have a look at this notebook we have different section we have install update automatic one one one one repository we have some requirements to install we have the model download we have control not extensions and we have start stable diffusion great this notebook is quite straightforward but let's have a look together what each section does before going into installation process we need to connect Google collab to Google Drive and this is what this code does before running it make sure that you are connected to the right drive I mean if you have more than one Google account as I do make sure that you are connected on the Google account you want to use for installing stable diffusion to do that you just go onto your drive and then here on top right you have Google account if you click here you have different options and you choose the one you want to use you connect once done it we can run this code this will tell me this notebook was not authored by Google that's fine we can run anyway and then it's gonna ask us the permission to connect Google call up to Google Drive we click on connect to Google Drive you just follow the steps you allow done it says mounted at content Google Drive so now if we download something is going to download that inside this folder here if you want to change this folder you just need to change this direction here then the next step is to install or update in case you have it already automatic one one one one repository if you want to look at the sorts of this repository you just go into show code here and then you can see here there is an URL address you can click on this and then you will see that this is the GitHub repository where we have stable diffusion web UI so usually when we install stable diffusion locally on our computer and we use the terminal we will git pull or git clone initially and get pulled after using this link here so what this code is doing is simply get cloning or get pulling but in our Drive so let's run this done the next step is to install some requirements for stable diffusion if we look at the code again there is an URL we can click here to see which are those requirements and we can see they are libraries and tools we need for running stable diffusion for example we have here Google perv tools which are a set of tools for performance profiling and memory checking and we have one two three of them I don't want to go into many details so let's go back we run this cool next up is to download the model here you can choose the model version you want to download you have different options you have version 1.5 version 1.5 in painting version 2.1 version 2.1 these two are older than version 1.5 so I will go for the 1.5 a very useful one it's a 1.5 in painting if you want to do in painting within painting you can modify your image using a mask you can fill in missing parts or damaged parts of the image using information from surrounding pixels so it's quite useful when you want to adjust or improve your image adding the details or removing details you also have the possibility to reinstall the original model by clicking this checkbox otherwise if you have your own model if you train your model if you fine tune the model and you have the path for this you have a folder in Google Drive you can simply insert the path here or if you have a link to a model you can insert this here too in this case you also have the possibility to use safe tensors instead of checkpoints and to use a temporary storage for who doesn't know what safe tensors are these are the equivalent of checkpoints with the difference that they cannot have malicious code what do I mean we checkpoints you may run things you don't want to be running but with safe tensor as the word says they are safe and you can load share notebook with other people and the code is safe in addition to that they usually run quicker than checkpoints so it's good to use them in my opinion so once you're happy with the model chosen you can run this code if you want to have more information of what model you want to download you can go into again face to have a look look at them you can click on show code and again you have different URLs here you can look for them in the code so in in my case version 1.5 this is the URL if you click on this code it will direct you on hugging face and you have all of the information about this model when it was developed what database was used to train the model who developed it so it's quite interesting let's go back to our notebook and let's run this okay and this is done now if we go back to our drive we can see that we have a new folder under my drive which is called SD for stable diffusion and if we click into stable diffusion web UI you can see we have all the folders from GitHub if we go again into models and then stable diffusion you can see here the model we downloaded it's called Model dot ckpt which stands for checkpoints let's go back to the notebook okay next step is to install control net extensions control net is a neural network structure to control the fusion models by adding some conditioning what do I mean so usually very briefly we have an input that goes into a model which generates an output now in the case of a diffusion model in particular in the case of a text to image the input will be the text so the description The Prompt the output will be the image which is based on the prompt so we have and we have emote here now with control net extension what we do we add an additional input in the model so we'll have conditioning now this conditioning can be different depending on which extensions we are using there are different type of extensions a very common one is scribbled with scribble we input inside the model a sketch of an image and then the model will generate an image more realistic of that sketch for example if I have the sketch of a cat face we can probably make one quickly foreign something like this I know it's not very nice but that's why we are using a diffusion model and we input this picture inside the model that the model May generate something nice based on the SketchUp something like this lovely cat cool so if we go back to our notebook we can see here a different type of control net extensions I'm not gonna go into that on all of them but I think it will be useful to to know what they are maybe I can make another video to explain each of them so for now I'm going to install all of them so let's run this okay done and now the final step is to install stable diffusion if you have a gradual interface account you can insert your user and password here and connect to radio directly otherwise you can just run the code this is our last step and that's it so we are now connected you can see that from here you just need to click on this URL and we have stable diffusion now running on GPU which is great because it's gonna be way faster than when you have it locally okay that's it for today this was a very quick tutorial if you have any question if you want me to explain you better how to do whatever with stable diffusion just let me know in comments I hope this was useful and see you at the next video bye
Info
Channel: Laura Carnevali
Views: 48,102
Rating: undefined out of 5
Keywords: midjourney, stable diffusion, dream studio, stable diffusion v2, diffusion, ai art, diffusion model, generative ai, generative art, dalle 2, dalle, openai, openai dalle, stability ai, ai artist, imagen, nft, install stable diffusion, install stable diffusion on mac, install stable diffusion apple silicon, stable diffusion on m1, stable diffusion with python, stable diffusion hugging face, stable diffusion github, stable diffusion v1.5, stable diffusion tutorial, googlecolab, colab
Id: uFNz4y8Ebz4
Channel Id: undefined
Length: 11min 43sec (703 seconds)
Published: Thu Mar 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.