A.I. image generators have changed the arts, graphics and design industries forever. You can now write prompts and direct the Artificial Intelligence to behave the way you like. Of course it all comes down to how good a prompstar you are, but the A.I. image generation model you are using plays a big role too. Midjourney, Dall-E, Stable Diffusion etc are some of the big names on this industry today. The main reason Stable Diffusion is different from others is because it is open sourced. Anyone can download the dataset from github repository and run this model locally on their pc. They can also design apps and softwares based off of Stable Diffusion.
Now, if you are on a very tight budget and your pc doesn’t have a good graphics card, then using something like Midjourney, Dall-E or Dreamstudio (Which uses stable diffusion as its operating model) is the best idea. But if you already have a capable computer with at least 4GB of V-Ram and cuda support, installing SD locally might be the cheapest, easiest and most versatile way to go. But the problem is that most of the people, that want to try out A.I. generated images, aren’t computer experts. That’s why they have to stick to other image generation platforms that goes with a subscription model. Here I’ll try to explain the process on how to install stable diffusion in your pc in such a way that anyone can do it even without any prior knowledge of coding.
1. Is your Graphic Card Compatible to Sd?
At first you have to check if your graphic card even run SD locally. You can check this list here (https://en.wikipedia.org/wiki/CUDA) and see if you can find your graphic card. If not, then sadly you can’t run SD in your computer.
2. Download Git For Windows :
The next step is to download Git for Windows from their official website. Before that, create a folder Named ‘StableDiffusion’ in C Drive.
Now just download and install the software from this link (https://gitforwindows.org/). From the 1st page of the installer uncheck the ‘Windows Explorer’ option as you are not gonna need that. Keep all of others default and press install. Once complete, launch ‘Git Bash’. On the second line write cd /c/StableDiffusion and press Enter. Now you are inside this folder via Git Bash.
3. Installing the WebUI from Github :
First you have to sign up for Github. Skip this step if already done. Next go to the Automatic webui page. There click on the green button on the top right corner mentioned ‘Code’ and copy the code. Now go back to Git Bash, on the last line write ‘git clone <link>’. In the place of <link>, paste the link you already copied. Then hit Enter. It takes a while and when it’s finished you can see the Stable Diffusion Webui folder all ready, inside the ‘StableDiffusion’ Folder in C drive.
4. Downloading Stable Diffusion Models :
To download SD models you need to go to Hugginface. First you have to create an account there (https://huggingface.co/). Then follow any of these links to download different versions of Stable Diffusion and download the .ckpt file.
SD Version 1.4 : https://huggingface.co/CompVis/stable-diffusion-v-1-4-original
SD Version 1.5 : https://huggingface.co/runwayml/stable-diffusion-v1-5
SD Version 2 : https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/768-v-ema.ckpt
Here is the Face restoration model which will be a nice addition. https://github.com/TencentARC/GFPGAN
Copy the downloaded SD model files, go to ‘models’ folder inside ‘stable diifusion webui’ folder and paste them there. For the Face Restoration Model, copy and paste the file directly inside ‘stable diffusion webui’ folder.
5. Download and Install Python :
Go to https://www.python.org/downloads/release/python-3106/ and download for your operating system. For windows it would be Windows installer (64-bit)
Install the software and remember to check ‘Add Python 3.10 to path’ while installing. After installation is done, go to windows search bar, type ‘Manage app execution aliases’ and hit enter. There turn python.exe off to avoid problems in detection of python in the next stage.
6. Run the webui :
This is the most crucial step. Now go to the Stable Diffusion webui folder, find the webui-user file. It should say ‘windows batch file’ in the descriptions. Double click on the file and it starts running.
It would take some time on the first time installation depending on your computer and the speed of you connection. It took me about 30 mins to get it ready. Once you see something like an url appear on the interface (e.g. http://127.0..:____) you’ll know that the webui is ready. Now just copy and paste the url in your browser and you are ready to go.
7. Bonus Tip – SD Upscalers :
Once the webui is running, go to the settings. There check all the upscaler models and now they appear under the ‘Extras’ tab inside the webui.
If you are facing issues like generating black images or Runtime error due to low vram, read this article here for a fast and prompt solution.