
This weekend marked the end of my free use of Midjourney, my favorite image-generating AI.
So it was time to look for alternatives and see if any are worth it, or whether it is better to move to the paid plan of the current one.
I already had Stable Diffusion installed locally, since it was the first one I tried, although I liked it less than Midjourney and hardly used it for that reason.
It was version 1 of the application, so, since the extension made the news this week ControlNet which lets you do fairly advanced things, I decided to give version 2 a chance, just to see how it goes.
Although if you Google it a bit and you will see there are different methods, but most of them failed for me at some point.
In the end, I found two methods that worked for me without errors. One is simpler and the other more manual.
I am going to explain both in this article: I will start with the easy method (Easy Diffusion) and then I will explain the manual method (created by Automatic1111), with the added advantage, for the second one, that I explain how to add the module Xformers, which speeds up image creation time by between 30% and 50%.
Also, to round off the tool installation, I would like to publish an article soon explaining how to install ControlNet.
That way you can have a good arsenal for creating custom images, completely free, at your disposal.
But before we begin, one important point.
Índice de Contenidos del Artículo
- PC requirements for using Stable Diffusion
- Install Stable Diffusion on your PC for free and easily
- Install Stable Diffusion manually on your PC
- Step 1: download what you need
- Step 2: create the installation folder
- Step 3: Install Python
- Step 4: Install the program interface
- Step 5: paste the files with the face correction models
- Step 6: paste the models into the corresponding folder
- Step 7: Install Git
- Step 8: write the Python path
- Step 9: launch the program installer
- Step 10: configuration for “low-resource” PCs
- Step 11: close the program
- Step 12: reopen the program
- Time to enjoy
- Bonus track 1: how to update the models to the new versions of Stable Diffusion
- Bonus track 2: how to install the Xformers module in Stable Diffusion easily
- Hey, I think this will interest you
PC requirements for using Stable Diffusion
Although you do not need a latest-generation processor to generate images, and 16 GB of RAM should be fine, there are a couple of relevant aspects.
Disk space
The data models I downloaded weigh between 4 and 7 GB, and you have to add the rest of the code on top of that. If you only have one model, set aside 15 GB of disk space. If you have several, well, keep adding.
That was the easy requirement.
The second requirement is more complicated.
The graphics card
Here is the thing: if you want to use this AI on your PC, you will need a good graphics card. One with at least 4 GB of vRAM and the developers of the methods I explain recommend that it be NVIDIA.
AMD cards can be used with Stable Diffusion, but the application and installation system are different, if you want to get proper performance out of them.
As for NVIDIA models, I would say that a GTX 1650 which you can find for €70–80 on Wallapop (and falling) is enough, buuut…
It only meets the minimum requirements, which in principle let you obtain 512×384 pixel images in 4:3 format. In other words, fairly small images.
To get larger images, graphics cards with more than 10 GB of vRAM are recommended. An RTX 3060 with 12 GB is the ideal model, in terms of price and performance, since in March 2023 you can find it new slightly above €300 and second-hand for €200.
That said, there are ways to get around these limitations:
- If your GPU has those 4 GB of vRAM, Easy Diffusion includes an upscaling engine by default that also works well.
- If you prefer to use the Automatic1111 method, we can use Waifu to make them larger without losing too much quality and use them on social media or banners, as I mentioned in my previous article
- If your PC’s GPU does not even have those 4 GB of vRAM, you can configure Easy Diffusion to use the CPU to generate the image, but I am warning you now that it will take much longer to produce results. Half an hour, easily, depending on the power of your processor.
Is it worth generating images on the CPU? Personally, I would go straight for the GTX 1650. Depending on the number of "passes", an image can take between one and five minutes with this card.
If you add to this that it is rare to nail the prompt on the first try and that you will have to try several until you get the image you want, do the math on how long it would take you to get a good image rendered on the CPU…
Well, once the hardware requirements are clear, let us start with the easy installation method.
Install Stable Diffusion on your PC for free and easily
For this first method, as I said earlier, we are going to use Easy Diffusion, specifically version 2.5.
You can find the original guide and its files here:
https://github.com/cmdr2/stable-diffusion-ui#installation
The process is pretty straightforward.
Step 1: download the Windows installer
- Go to the link above.
- Scroll down until you see this image:

- Click the Windows button.
- The file “stable-diffusion-ui-windows.zip” will download:

Step 2: unzip the file in the root of the drive
- Cut or copy the file you just downloaded.
- Go to the root folder of the drive. It will usually be “C:” or “D:”
- Paste the zip file.
- Right-click it and choose “Extract all”:

A folder called “stable-diffusion-ui” will have been created:

Step 3: launch the program
- Go into the folder and find the file “Start Stable Diffusion UI.cmd”:

- Double-click it
- The Windows command console will open and start installing the program. Do not close it at any point.
- When the installation finishes, a browser tab will have opened:

- You can now start creating your images. I will explain all the options later in another article, although it is enough to write some text (prompt) and click the "Make Image“:

- You will get something like this:

Step 4: settings for PCs with (relatively) low resources
A couple of notes if your PC only half meets, or does not meet, the recommended requirements.
If your PC has a 4 GB graphics card
Basically, you will have to do two things:
- Go to Settings and switch to “Low”:

- Adjust the image size. If you do not want it square, but horizontal or vertical, I recommend 512×384 pixels for landscape format and 384×512 for vertical images. These settings work with a 4 GB GTX 1650:

If your PC has a graphics card with less than 4 GB
You will have to render on the CPU (and wait quite a while for each image). To do that:
- Choose here render on the CPU:

Step 5: close the program
- Simply make sure you are not generating any image and close the Windows console.
Step 6: reopen the program
- You only have to go to the folder where you installed it (most likely “C:stable-diffusion-ui”) and double-click the file “Start Stable Diffusion UI.cmd” (just like in step 3):

- The Windows console will open again and, when initialization finishes, the browser tab will open.
- If, for some strange reason, the browser does not open, or you accidentally close it yourself, go to http://localhost:9000/ and the program interface should appear (as long as you have not closed the command console, in which case you should repeat step 6 from the beginning):

Done.
You now have Stable Diffusion installed on your PC.
It was not that hard, was it?
Now let us move on to the manual method, which has a bit more substance.
Install Stable Diffusion manually on your PC

If the option above is easier, why would anyone want to do it manually?
Well, because some people prefer to understand what the application does and requires.
If you understand it, you can modify whatever you consider necessary and adapt it to your use and your machine.
And add extensions, as in the case of Xformers, which I explain below.
For this reason I am adding this other tutorial, in which I explain each element the application uses, separately.
And you will see there are quite a few.
Step 1: download what you need
We are going to need several things for this manual installation:
- A text editor: I use Sublime Text (click to go to the download), but if you have Notepad, that will also do.
- Python: the language the program is written in and that we need to install on our PC. https://www.python.org/downloads/release/python-3106/
- Git: the code repository from which we will install the application. https://git-scm.com/download/win

- Stable Diffusion model 1.5: the two models that will generate the images. Download one or both. https://huggingface.co/runwayml/stable-diffusion-v1-5

- Stable Diffusion Web UI: the program’s web interface, which lets us interact graphically. https://github.com/AUTOMATIC1111/stable-diffusion-webui

- GFPGAN: the algorithm that helps the model “fix faces”. https://github.com/TencentARC/GFPGAN

Download everything into one folder so you have it more at hand.
Once you have it, we start the installation.
Step 2: create the installation folder
Two things to keep in mind:
- You can create it in whatever path you want on your disk. I installed it in the root, next to the folder I created in the previous tutorial.
- Do not leave spaces in the name. Use something like “stablediffusion”:

Step 3: Install Python
- Open “python-3.10.6-amd64.exe” with a double-click.
- Select “Install Now” in the first option that opens:

- Wait for it to install and close the window once it has finished.
Step 4: Install the program interface
- Extract the downloaded file “stable-diffusion-webui-master.zip”.
- The folder “stable-diffusion-webui-master” will be created.
- Copy all its contents (all folders and files):

- Paste them into the installation folder you created in step 2.
Step 5: paste the files with the face correction models
- Copy the downloaded files “GFPGANv1.3.pth” and “GFPGANv1.4.pth”.
- Paste them into the installation folder:

Step 6: paste the models into the corresponding folder
- Copy the downloaded files “v1-5-pruned.ckpt” and “v1-5-pruned-emaonly.ckpt”. If you only downloaded one model, then copy the one you downloaded.
- Paste them into the following path inside the installation folder:
“my-folder-namemodelsStable-diffusion”.
In my case:
“C:stablediffusionmodelsStable-diffusion”:

Step 7: Install Git
- Open the downloaded file “Git-2.39.2-64-bit.exe”
- We do a normal Windows installation. You know, “next”, “next”, “next” (a few more times than usual):

- We close the window when it finishes.
Step 8: write the Python path
This step is not always necessary, but there is no harm in doing it.
It is, perhaps, the most complex for people who are not used to browsing through Windows folders.
Let us go step by step:
- The first thing is to find out the path where we installed Python on our PC. To do this, go to the Windows search box and type “Python”.
- It will find the already installed program (do not confuse it with the file we downloaded at the beginning) and on the right we will see “Open file location”. Click there:

- The folder containing the program shortcut will open. We right-click and select the “Open file location” option:

- A new Windows folder will open. We copy the path of that folder from the top bar:

- The next thing is to go to our program installation folder and open the file “webui-user.bat” (careful, not “webui-user.sh”) with Sublime Text or whatever text editor we use. The easiest way is to right-click the file and select “Open with Sublime Text”, but everyone can open it however they like.
- Once the file is open in the editor, look at line 3:

- We paste the Python folder path we have copied to the clipboard and add “python.exe” to it (without the quotes) at the end, so it looks like this:

- Save the file and close it.
Step 9: launch the program installer
- We now have everything ready to install the program, so double-click the same file we just edited (“webui-user.bat”) to run it.
- The Windows command console will open and start running processes:

- It will take a while to finish. It will even seem to be stuck at some points. We must never close it. When it finishes we will see these lines:

- In red I point out the address we have to enter in any browser installed on the computer to access the application interface:

- We would now have Stable Diffusion ready to create images using prompts:

Step 10: configuration for “low-resource” PCs
- If your PC does not have a very powerful graphics card but does have one with at least 4 GB of vRAM, you can use the program to produce 512×384 px images (landscape or portrait):

- Unlike the easy installation, this manual method does not include any upscaling engine by default. So there you go: time to use Waifu to enlarge the image. That is what I did with the header image of this second tutorial.
Step 11: close the program
- To close the application, it is enough to close the command console that opens when I run the “webui-user.bat” file.
Step 12: reopen the program
- To reopen the program once I have closed it (or on another day), you have to run the “webui-user.bat” file, which is in the folder we created in step 2 for the program installation.
Time to enjoy
I hope you were able to follow either of the two tutorials and can start generating your infinite, free images from your PC.
You have a ton of options and tabs to try, so do it. Getting good results is more a matter of practice than luck in nailing the prompt, as with everything.
Another option is visit pages like these, which show you the images and the prompts that generated them:
- https://prompthero.com/stable-diffusion-prompts
- https://mpost.io/best-100-stable-diffusion-prompts-the-most-beautiful-ai-text-to-image-prompts/
I think it is the ideal way to start tinkering with this extremely powerful application.
And create warrior princesses like this one:

Bonus track 1: how to update the models to the new versions of Stable Diffusion
Well, in reality you would already have finished installing the program on your PC, but if you do it exactly as I described, you will only be able to use Stable Diffusion model 1.4.
And as I write these lines, 1.5 is already available.
It matters because each model improves the results. Or, at least, generates different ones.
So I am going to explain how to update it so you can use the new version.
Step 1: download new models
- This one is easy; visit this link: https://huggingface.co/runwayml/stable-diffusion-v1-5
- Scroll down until you see the models:

- Download the model you want, one or both. See what I was saying earlier about the size? 4 and 7 GB is no small thing.
Step 2: copy the models to the right folder
- Take the downloaded files as they are and copy them (or better, cut them).
- Navigate to the right folder where you installed the program, specifically this one: "C:stable-diffusion-uimodelsstable-diffusion".
- Paste the files. You will see that you already had version 1.4 ("sd-v1-4-ckpt"):

Step 3: restart the program
- This step is only necessary if you had the application running. If it is running, close the Windows command console. If not, skip it.
Step 4: select the model you want before generating the image
- Once the program has started with the new models, you only have to select the one you want to use to generate the image in this dropdown, where the models you have installed will appear:

That is how you can keep updating the model whenever a new version comes out.
Also, you should know that through this system you could add other trained models that are out there on the web, not just the official Stable Diffusion one. It would be done in the same way.
Bonus track 2: how to install the Xformers module in Stable Diffusion easily
To finish this Stable Diffusion installation mega-tutorial, we are going to install the Xformers module.
For now I have not figured out how to do it in Easy Diffusion, so, if you want to use this module, you will have to use the manual Automatic1111 installation.
If at some point I discover how to do it with Easy Diffusion, I will add it here too.
With that clarified, I will explain what needs to be done, which is not much.
Step 1: open the webui-user.bat file
We start from the assumption that Stable Diffusion is already installed and working on our machine (I repeat: using the Automatic1111 system).
When we open it as we installed it, it does not load the module:

- The first thing you have to do to make it load is go to the program installation folder and open the “webui-user.bat” file with the text editor. Yes, it is the same one you edited during installation to add the Python path:

Step 2: add argument
- The next thing to do is add this argument: "–xformers" on line 6 (command-line arguments):

Step 3: open the program and check that the module loads
- Once we open the program as usual, it will be enough to look at the command console and check that the module has loaded correctly:

If we see these lines, everything has gone as it should and we will enjoy its advantages.
Advantages of using Xformers in Stable Diffusion
The main one is that you take much less time to generate images. You can see benchmarks at this link.
With current graphics cards, unless you have one above €1,500, this increase in generation speed is not trivial at all.
It also has positive effects on vRAM consumption, allowing modest graphics cards to create larger images.
Disadvantages of Xformers
Okay, but if this module is so good, why is it not implemented by default?
Well, the reason is that it may cause you to lose quality in image generation.
The important nuance is that it may.
Because it does not always happen. In fact, it happens quite rarely.
You have more info here.
And that wraps it up.
Only for now.
Because in the next article I will explain how to install the ControlNet extension, which lets us do even cooler things.
So, if you do not want to miss them, you know what to do: subscribe just below and I will let you know as soon as I publish it.



Leave a Reply