Install Stable Diffusion on Mac M1/M2 (AUTOMATIC1111)

Updated on:

AUTOMATIC1111’s WebGUI, the most popular Stable Diffusion UI, works just fine on the Mac M1/M2.

Installation

Here’s the official installation link:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon

And a live discussion where you can post errors if you have them:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461

1. Install Homebrew

Homebrew is a package manager that will allow you install all the required packages to run AUTOMATIC1111.

If you don’t have Homebrew yet, follow the instructions at https://brew.sh to install it. Keep the terminal window open and follow the instructions under “Next steps” to add Homebrew to your PATH.

To check if Homebrew is currently installed, open your terminal (Command + Spacebar, then search for “terminal”) and type:

brew -v

If Homebrew is already installed, you will see a message like:

Homebrew 3.6.14
Homebrew/homebrew-core (git revision 44342c8b59f; last commit 2022-12-08)
Homebrew/homebrew-cask (git revision d9d556039c; last commit 2022-12-08)

If it is not installed yet, you will see a message like:

command not found: brew

2. Install required software with Homebrew

In the terminal run:

brew install cmake protobuf rust [email protected] git wget

Wait until all packages finish downloading.

3. Clone the Web-GUI

Navigate to where you want the folder for AUTOMATIC1111 to be in the terminal.

For example, I want to place the folder on my desktop. I type:

cd desktop

If you have not used the Terminal before, “cd” means change directory.

It is a common command used to move around your file system in the Terminal.

Change the path above if you want to use a different location, for example: “cd documents“.

To see all the folders in your current directory that you can navigate to, type:

ls

To go back up a directory, type:

cd ..

When you are in the correct folder, type:

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

This will clone the code you need from Github to a new folder called “stable-diffusion-webui”.

4. Download the Stable Diffusion Model

You have the code for the WebGUI, now you need to download the actual model.

If you don’t have any models to use, Stable Diffusion models can be downloaded from Hugging Face, the most popular website to host models. To download, click on a model and then click on the “Files and versions” header. Look for files listed with the “.ckpt” extension.

Frame 181
Click on “Files and versions“, find the “.ckpt” file, and click on the little arrow to download

Here are some popular models:

For this guide I’ll be using Stable Diffusion 1.4.

After downloading the model, I move it to the folder I cloned earlier, placing it in the folder:

stable-diffusion-webui/models/Stable-diffusion

Stable Diffusion
In the correct folder, there’s a .txt file that tells you to “Put Stable Diffusion Models here”

5. Run Start Command

Back in the terminal, I’ll type:

cd stable-diffusion-webui

to move into my new stable diffusion folder, and then:

 ./webui.sh 

to run the WebUI (You will do this anytime you want to start the WebUI: navigate to the folder and then run the script above).

install
Installation started

For the first time, installing the requirements might take a while.

My stable diffusion folder, at the end of my installation (including the model file) was 6.5 GB.

Screen Shot 2022 12 17 at 5.59.10 PM
Installation has finished

When you see the line “Running on a local URL: https://127.0.0.1:7860” your installation is complete.

The IP address 127.0.0.1 refers to the computer you’re currently working on. It is also known as localhost, so you can also go to:

http://localhost:7860

Open your web browser of choice, and go to this address. You will see the Web-GUI interface.

Troubleshooting

Python errors

Python errors are some of the most common to come up during the installation. Many will be solved uninstalling and reinstalling a clean version of Python.

error: xcrun: error: invalid active developer path

If you see this error then you need to install the Xcode command line tools.
Run this command in the terminal:
xcode-select –install

We get it. There's way too much AI stuff to keep up...

Get the email that makes keeping up with AI easy and fun. Stay informed and entertained, for free.

10 thoughts on “Install Stable Diffusion on Mac M1/M2 (AUTOMATIC1111)”

    • Hey Angel, try this:

      Open webui-user.bat with Notepad.

      Edit it to add “–precision full –no-half” to the COMMANDLINE_ARGS.

      The last 2 lines of webui-user.bat should look like this:

      set COMMANDLINE_ARGS= –precision full –no-half

      Save the file.

      Relaunch and see if this fixes the problem.

      Reply
  1. If you get the error: xcrun: error: invalid active developer path
    Then you need to install the Xcode command line tools.

    Run this command in the terminal:
    xcode-select –install

    Reply
  2. The website has combined two dashes to one emdash, which is not correct. The command is

    xcode-select –install

    but if the website has formatted “–install” as one long dash followed by the word ‘install,’ replace the long dash (–) with two short dashes (-)

    Reply
  3. Thanks, this was incredibly helpful! How do I go in and add more models from CivitAI as I move forward? I’ve downloaded the ckpt files into the models folder but can’t seem to see them in Stable Diffusion Automatic1111?

    Reply

Leave a Comment