Skip to Content

Install Stable Diffusion on Mac – Detailed Guide

Installing Stable Diffusion on a Mac, particularly those with Apple Silicon M1/M2 chips, offers several user-friendly options.

Ways to Install Stable Diffusion on Apple Mac 

  • Using AUTOMATIC1111: This is a more technical route that involves cloning the web UI repository, placing Stable Diffusion models in the specified directory, and running commands in the terminal to start the AUTOMATIC1111 GUI for Stable Diffusion. This method allows for significant customization and use of various features but might be challenging for those not comfortable with command-line interfaces.
  • Diffusion Bee: For a more straightforward experience, Diffusion Bee offers an easy-to-use application that can be found on the App Store. This app simplifies the process by handling model downloads, configurations, and optimizations automatically. It’s designed for users who prefer a hassle-free setup without delving into technical details. However, it currently does not support SDXL models, limiting its flexibility for advanced users.
  • Draw Things: Another option for Mac users is the Draw Things app, which is slightly more advanced and offers a balance between ease of use and flexibility. It’s compatible with CoreML, optimizing performance on Macs, and supports a variety of custom models including SDXL. The interface may be less intuitive than Diffusion Bee but provides more options for those looking to explore different aspects of Stable Diffusion.

 

Each of these methods has its pros and cons, ranging from ease of use and interface design to compatibility with advanced models and customization options. Depending on your technical comfort level and specific needs, you can choose the one that best suits you.

Install Stable Diffusion on Apple Mac using Automatic1111

Using the Automatic1111 Web UI is a more technical approach that offers access to a wide range of Stable Diffusion models.

Get Your Free Linux training!

Join our free Linux training and discover the power of open-source technology. Enhance your skills and boost your career! Learn Linux for Free!

Here’s an expanded guide on how to set up and use Automatic1111 on your Mac:

Prerequisites

  • Install Homebrew: Homebrew is a versatile package manager for macOS that simplifies the installation of software. To install Homebrew, open Terminal and execute:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  • Install Required Packages: Homebrew allows you to install various packages that Automatic1111 depends on. Run these commands in Terminal:
    brew install cmake protobuf rust git wget [email protected]
    

Installation Steps

  1. Clone Automatic1111 Stable Diffusion Web UI Repository:
    • Use Git to clone the repository to your local machine:
      git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
      
  2. Install Dependencies:
    • Navigate to the cloned directory and install the Python dependencies listed in requirements.txt:
      cd stable-diffusion-webui
      pip install -r requirements.txt
      

Model Download and Setup

  • Choose and Download Models: Explore platforms like Hugging Face to find the Stable Diffusion model that suits your needs. Download the .ckpt file and place it in the stable-diffusion-webui/models/stable-diffusion directory. This step is crucial as the performance and output quality of the AI depend on the model used.

Running Automatic1111

  • Start the Web UI:
    • Initiate the Web UI using the shell script provided in the repository:
      ./webui.sh
      
    • This command starts the local server and the interface for Stable Diffusion.
  • Accessing the Web UI:
    • Open a web browser and navigate to http://localhost:7860 to access the Automatic1111 GUI. This interface allows you to interact with Stable Diffusion, input your prompts, and generate images.

Additional Tips

  • Updating Automatic1111: To ensure you have the latest features and bug fixes, periodically pull the latest changes from the GitHub repository using git pull within the stable-diffusion-webui directory.
  • Troubleshooting: Common issues might include errors related to dependency installations or model compatibility. Check the repository’s Issues section for solutions or post your query there.

Customization and Advanced Usage

  • The Automatic1111 Web UI allows for significant customization through advanced settings and options. Users can tweak parameters like sampling methods, number of iterations, and more to influence the generated images’ style and fidelity.
  • Explore the community around Automatic1111 for custom scripts, additional models, and tips to enhance your experience with Stable Diffusion on your Mac.

This setup provides a robust framework for experimenting with AI-generated art and images on macOS, leveraging the power of Stable Diffusion with the flexibility of Automatic1111.

Error Fix

OSError: [Errno 66] Directory not empty: '/private/var/folders/tk/cdqhk9856t7db9k6bpj59gd00000gn/T/pip-install-vr2ikjk4/basicsr_5c02ed58881d440a829d11405671bd9a/.eggs/Cython-3.0.8-py3.10-macosx-10.9-universal2.egg/Cython-3.0.8.dist-info' -> '/private/var/folders/tk/cdqhk9856t7db9k6bpj59gd00000gn/T/pip-install-vr2ikjk4/basicsr_5c02ed58881d440a829d11405671bd9a/.eggs/Cython-3.0.8-py3.10-macosx-10.9-universal2.egg/EGG-INFO'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> basicsr

Fix:
source venv/bin/activate
PIP_USE_PEP517=1 pip install basicsr==1.4.2

For more detailed instructions, refer to the Automatic1111 GitHub repository and community forums for troubleshooting and advanced tips.