Stable Diffusion on Mac: A Step-by-Step Guide to Local Installation

Bruce Lim
5 min readJun 20, 2023

--

If you’re into digital art, you’ve probably heard of Stable Diffusion. Stable Diffusion is like your personal AI artist that uses machine learning to whip up some seriously cool art. It’s all about mixing styles, themes, and elements to create something totally unique and, honestly, mind-blowing. Whether you’re into abstract stuff or more lifelike portraits, Stable Diffusion has got you covered.

In this guide, I’m going to show you how to get Stable Diffusion up and running on your Mac. You might be wondering, “Why should I bother installing Stable Diffusion on my Mac?” Well, it’s all about freedom and control.

When you install Stable Diffusion locally, you can create art whenever you want, no need to worry about internet connections or server issues. Plus, you can play around with it, customize it, and really make it your own. You can even use plugins like ControlNet to take your creations to the next level.

Step-by-Step Installation Guide

Alright, let’s roll up our sleeves and get to work. Don’t worry, I’ll be with you every step of the way. Let’s break this down:

  1. Installing Homebrew and other necessary tools
    First things first, we need to get Homebrew on your Mac if it’s not there already. Open up your Terminal (you can find it in your Applications folder under Utilities) and paste in the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Hit enter and let Homebrew do its thing. It might ask for your password, so be ready for that.

Next up, we’re going to use Homebrew to install other dependencies. Paste this command into your Terminal and hit enter:

brew install cmake protobuf rust python@3.10 git wget

2. Cloning the AUTOMATIC1111/stable-diffusion-webui repository

Now that we’ve got our tools, let’s get the Stable Diffusion files. We’re going to clone (that’s Git-speak for download) the repository from GitHub. Paste this command into your Terminal:

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

This will create a new folder in your current directory with all the Stable Diffusion files.

3. Running the webui.sh script to start the GUI

./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on bruce user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################
Requirement already satisfied: pip in ./venv/lib/python3.10/site-packages (23.1.2)

################################################################
Launching launch.py...
################################################################
Python 3.10.12 (main, Jun 15 2023, 07:13:07) [Clang 14.0.0 (clang-1400.0.29.202)]
Version: v1.3.2
Commit hash: baf6946e06249c5af9851c60171692c44ef633e0

...

Running on local URL: http://127.0.0.1:7860

And voila! You should now see the Stable Diffusion interface in your web browser at http://127.0.0.1:7860. Now you’re ready to start creating some awesome art!

Choosing and Installing Models

Now that we’ve got Stable Diffusion up and running, let’s talk about models. In the world of Stable Diffusion, a model is like a blueprint that the AI uses to generate art. Different models can create different styles of art, so choosing the right one can make a big difference in your creations.

There are a bunch of models to choose from, like v1.4, v1.5, F222, Anything V3, Open Journey, and GhostMix. Each one has its own unique flavor, so feel free to experiment and see which one you like best. You can even mix and match models to create something truly unique.

Installing a model is really easy. Here’s how you do it:

  1. Download the model. You can find the download links for each model on the Hugging Face website. Just click on the one you want and it’ll start downloading it in your stable-diffusion-webui/models directory.
  2. Select the model in the GUI. Now that the model is in the right place, you can select it in the Stable Diffusion GUI. Just open up the dropdown menu and you should see your new model listed there. Click on it, and you’re good to go!

Remember, there’s no right or wrong choice when it comes to models. It’s all about finding the one that fits your style and lets you create the kind of art you want to make. So go ahead, play around, and have fun with it!

Installing ControlNet Plugin

Alright, we’ve got Stable Diffusion installed, we’ve chosen our model, and now it’s time to kick things up a notch with the ControlNet plugin.

ControlNet is like the secret sauce of Stable Diffusion. It gives you even more control over the art generation process, letting you guide the AI in creating the kind of art you want. Want to tweak the colors? Adjust the style? With ControlNet, you can do all that and more. It’s like having a steering wheel for your AI artist.

Installing the ControlNet plugin is pretty straightforward. Here’s how you do it:

  1. Open up the Extensions tab. In the Stable Diffusion GUI, there’s a tab labeled “Extensions”. Click on it to open it up.
  2. Enter https://github.com/Mikubill/sd-webui-controlnet.git to "URL for extension's git repository".
  3. Hit the Install button. Once you’ve got the URL in there, just hit the “Install” button. Wait for 5 seconds, and you will see the message “Installed into stable-diffusion-webui\extensions\sd-webui-controlnet. Use Installed tab to restart”.
  4. Go to “Installed” tab, click “Check for updates”, and then click “Apply and restart UI”. (The next time you can also use these buttons to update ControlNet.)

Installing ControlNet Models

Now, let’s talk about ControlNet models. These are a bit different from the Stable Diffusion models we discussed earlier. While the Stable Diffusion models determine the overall style and look of the art, the ControlNet models give you more control over specific aspects of the generation process. Think of them as the fine-tuning knobs on your AI artist’s control panel.

As of now, all 14 models of ControlNet 1.1 are in beta testing, but they’re available for you to try out.

Download the model files. You’ll need to download the ControlNet model files that end with “.pth” from the Stable Diffusion website. Make sure to save these files directly into the models folder in your stable-diffusion-webui\extensions\sd-webui-controlnet directory.

Verifying the Installation

AUTOMATIC1111/stable-diffusion-webui
ControlNet for Stable Diffusion WebUI

--

--