Local InstallationStable Diffusion

Install AUTOMATIC1111's Stable Diffusion WebUI on Mac M1/M2 (Apple Silicon)

by

Yubin

updated

18 Comments

Currently most functionality in AUTOMATIC1111's Stable Diffusion WebUI works fine on Mac M1/M2 (Apple Silicon chips).

We'll go through all the steps below, and give you prompts to test your installation with:

Step 1: Install Homebrew

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

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

brew -v

If Homebrew is installed you will see the version number:

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

command not found: brew

If you don't have Homebrew, go to https://brew.sh to install it, by copying the command under "Install Homebrew" and pasting it into the Terminal:

Enter your computer password if prompted "Checking for `sudo` access (which may request your password)..."

Then, press Enter when prompted:

Keep the Terminal open and follow the instructions under "Next steps" to add Homebrew to your PATH.

Step 2: Install Requirements

After you've installed brew, in the terminal run:

brew install cmake protobuf rust [email protected] git wget

Wait until all packages finish downloading.

Step 3: Clone the WebUI

Navigate to where you want the folder for the WebUI to be using the Terminal.

For example, if you want to place the folder on my desktop, you would type:

cd desktop

If you haven't used the Terminal before, “cd” means change directory.

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

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 create a new folder "stable-diffusion-webui" that contains the WebUI.

Step 4: Start the WebUI

Back in the Terminal, move into your new WebUI folder using:

cd stable-diffusion-webui

Then to run the WebUI (You will use this command anytime you want to start the WebUI).

 ./webui.sh

The first time you run it, installing all the requirements might take a while.

install
Installation started

This step will also download the Stable Diffusion v1.5 model.

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: http://127.0.0.1:7860" your installation is complete.

Go to this address in your web browser:

http://127.0.0.1:7860

Here's what your interface will look like:

You’ll notice at the top there’s a toggle called “Stable Diffusion Checkpoint”.

You can use this to switch to any of the models you have placed in the stable-diffusion-webui/models/Stable-diffusion folder.

Step 5: Your First Prompt

For our example, we'll use Stable Diffusion v1.5 since it comes downloaded with your installation.

The filename is v1-5-pruned-emaonly.safetensors [6ce0161689].

Enter the prompt:

portrait of beautiful girl, brown hair, freckles, tshirt, professional lighting, indoor, artistic photography

Now enter the negative prompt:

lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts,signature, watermark, username, blurry, artist name

Set the height slider to 768 and keep the width at 512 to create a portrait aspect ratio suitable for people.

Set the Seed to 3463 to make sure you get the same result.

Then click Generate and wait for the magic to happen! Here’s what I got:

I am using the default sampler Euler a. You can play with these samplers to get an idea of what they do.

Check the official wiki for all the features that have been implemented in AUTOMATIC1111.

You can check out these basic prompts for where to get next:

Models

There's a bunch of models you can try out.

Keep in mind: there are foundational (base) models and there are custom models (fine-tunes). People call both of these "Stable Diffusion models".

After downloading models, remember to move them into the folder: stable-diffusion-webui/models/Stable-diffusion

Foundational Models

Out of the foundational models, Stable Diffusion v1.5 is the most popular.

Stable Diffusion 2.0 and 2.1 require both a model and a configuration file, and image width & height will need to be set to 768 or higher when generating images:

SDXL v1.0 has just been released. It's a massive quality improvement over previous models, however runs quite slowly on Macs. Here's the guide on running SDXL v1.0 with AUTOMATIC1111.

Custom Models

You can also a custom models. These are models that are created by training the foundational models on additional data:

Next Steps

From here, the sky is the limit!

I recommend going through the rest of the Stable Diffusion for Beginners series:

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

Awesome free stuff? Why yes, we do have that...

FREE
Midjourney V5 Prompt Book: Fantasy & Worldbuilding

94-pages, 200+ prompts and techniques for creating the heroes and lost worlds of your imagination.

18 thoughts on “Install AUTOMATIC1111's Stable Diffusion WebUI on Mac M1/M2 (Apple Silicon)”

  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
  4. Thank you for these straightforward instructions – really useful!

    I also am getting the following:
    RuntimeError: “LayerNormKernelImpl” not implemented for ‘Half’

    I’ve edited webui-user.bat to contain the following:
    set COMMANDLINE_ARGS= –precision full –no-half

    but am still getting the same error. Do you have any ideas how to solve this:

    Reply

Leave a Comment