Hello, in this video I'm going to walk you through
the steps to install Stable Diffusion on a Mac. Now it does require the latest Apple Silicon, so
M1 or M2. So to get started, you're going to want to go ahead and go to the Stable Diffusion GitHub
repository, which I'll link to in the description. And then if you scroll about halfway down, you'll
see how to install on Apple Silicon. So we'll go ahead and click here, and follow each of these
steps. We'll go ahead and go through the new installation steps. So to get started, you need
to have Homebrew installed onto your machine. So to do that, you're just going to want to head over
to brew.sh, and then go ahead and click copy here. Open up a terminal window, and press paste,
and put in your password. So it can go ahead and install the packages, and then just go ahead
and click enter. And it will go ahead and do its thing. Okay, so now that that has been installed,
we want to go ahead and follow the next steps on the instructions here. So you're just going to
want to go ahead and run these two commands in the terminal to add Homebrew to your path. So
first up, we'll get this one here, and then we just paste that right into the terminal here.
And then you can go ahead and do this line as well too. And then that's it. And so it's best to
go ahead and close out your terminal window, just in case if there's any sort of caching, before
proceeding with any further steps. So go ahead and close that out. And then we're going to go
ahead and jump to the next step here, which is to go ahead and install the necessary packages to run
stable diffusion via Homebrew. So as you can see, it will go ahead and go out and fetch any packages
if they aren't on your machine. Now if you already had Homebrew installed, you might need to go ahead
and do a brew upgrade command to go ahead and get the latest updates to these packages. So yeah,
so we'll just go ahead and let this install and then proceed to the next step. All right, so now
that all the packages are installed, now it's time to go ahead and install stable diffusion, the
repository itself. So to do that, we are going to go ahead and clone the repository. So we're
just going to go ahead and copy this command. And I created a directory on my machine that is
right here called AI Art. So I want to go ahead and install it there. So I'm just going to go
ahead and navigate to that, and go to CD AI Art, and then go ahead and just paste in that git clone
command, and then press enter. And so now this is downloading the whole repository from GitHub
onto the machine. It's a fairly quick process, it's about 32 megs. So now the next part is to
actually get some checkpoints or models and add them to stable diffusion. So this is what stable
diffusion uses in order to generate images. One of the most common models that a lot of people
start with is 1.5. So I already downloaded this, but if you want to download it, you can just
go ahead and go here, and then just click on this pruned EMA only checkpoint, and then it
will go ahead and download to your machine. It's about a 4.27 gigabyte file, so it will take
a little bit of time. I'll have a separate video on stable diffusion 2.0, or the stable diffusion
XL models. But at this time, we're just going to keep it simple with the 1.5. So we're going to
go ahead and navigate to that directory once it has been cloned. And then in order to install
the checkpoint or add it to stable diffusion, we're going to go ahead and go to the models
directory, and then to stable diffusion. And it will tell you right here, put stable diffusion
checkpoints here. So go ahead and drop that into here. So now we're going to go ahead and start
up stable diffusion on our machine. So I'm going to go back to terminal here, and then go to the
stable diffusion directory that we created. And to launch it, you just want to put in this period and
then the slash web UI. So period slash web UI.sh, and then press enter. So this might take a minute
or two to get started, at least on the first go, because it's going to have to download additional
packages, because I believe what stable diffusion is going on here is actually creating its own
kind of Python environment. So there's just some dependencies that it will need for your machine in
order to run properly. All right, so it looks like stable diffusion downloaded all the necessary
packages to get up and running here. So we're going to go ahead and generate our first image. So
I'm going to go ahead and select that checkpoint that we downloaded. So for the first prompt
here, I'm just going to put in grassy field, and then click generate. So we can take a look
here and see how it's progressing, and if it will fail or not. Because typically on the machine
here, I have noticed that it will often fail, unless if you put in a option for when starting
it up. So which it did, which is actually good, because here we go, we can see, because this will
probably happen to you if you're trying to install it. So it's telling us here that we should set
this upcast cross attention layer to float 32 within the settings in stable diffusion. Now I've
actually tried that on my machine, and I have not found that it has worked before, but we can go
ahead and give it a shot. And if it does work, that's great. But what we're going to go ahead and
do is go ahead and restart stable diffusion again. And then it should open up this new window. And
just as a heads up, if you ever close this tab, the URL to get back to stable diffusion is going
to be right here. And so we'll go ahead and try grassy field and see if that option worked at all.
And if not, we can put in the option whenever we boot stable diffusion with a no half option
flag. As it looks like it is erroring again, and just for reference, I am using a MacBook Pro
M1. So let's go ahead and try one more time here, no half. And if you want to kill the process, you
just are going to press control C on your keyboard in order to stop stable diffusion and then restart
it. So let's try it one more time. Grassy field, we have our checkpoint, and we're just going
to go ahead and generate here. And we can see that we have launched with that argument, no half,
and then it looks like stable diffusion also adds on some other options along the way here too. So
as we can see, this is now actually working with that no half flag. So yeah, that settings option
doesn't appear to work, at least in this version of stable diffusion in order to reduce the error.
We can see that everything is generating as it should. And here we go, our grassy field, perfect.
So now, just as a heads up, I wanted to go over one other thing here, is that stable diffusion
will release updates on a regular basis to the web interface to fix bugs or any sort of new exciting
updates. If you go back to the repository, you can see the releases that they have. The
last one here was on August 31st. So all you need to do to actually make sure that your stable
diffusion is up to date with the latest version is if you go ahead and quit it here, and then you're
going to want to make sure you're in the stable diffusion web UI directory, and just put git pull.
That's it. And then that will pull anything from GitHub as far as stable diffusion releases. It's
pretty simple. So that's it with getting stable diffusion installed on your machine. I hope this
video was helpful. If you have any questions, feel free to put them in the comments below.
Thanks so much for watching and take care.