Mac: Easy Stable Diffusion WebUI Installation | Full Guide & Tutorial

TroubleChute
26 Jan 202309:12

TLDRThis tutorial demonstrates how to install and run the Automatic 1111 Stable Diffusion WebUI on a Mac, despite it being optimized for Linux or Windows. The guide covers installing Homebrew, necessary software, and setting up the environment. It also discusses model acquisition from sources like Hugging Face and addresses potential performance issues on M1/M2 chips, offering optimization tips for a better experience.

Takeaways

  • 😀 The video is a guide on setting up the Automatic 1111's Stable Diffusion web UI on a Mac.
  • 🔧 It's noted that the best performance for Stable Diffusion is on a desktop PC with a powerful Nvidia graphics card, not on Mac's M1 or M2 chips.
  • 💻 Homebrew is required for the installation and can be installed by running a command from the brew.sh website.
  • 🛠️ Several software packages are needed, including cmake, protobuf, rust, python 3.10, git, and wget, which can be installed via Homebrew.
  • 📚 The script guides the user to clone the Stable Diffusion web UI from its GitHub repository.
  • 🔗 The user is instructed to download Stable Diffusion models, like version 1.5, from sources like hugging face.
  • 📁 The downloaded models need to be placed in the 'stable diffusion models' folder for the software to use them.
  • 🖼️ After setup, the user can start the Stable Diffusion web UI by running a shell script, which also installs necessary Python packages.
  • 🌐 The web UI can be accessed through an HTTP link provided in the terminal once the setup is complete.
  • ⏱️ The video mentions that image generation on a Mac will be slower compared to using a dedicated graphics card.
  • 🛡️ There are potential issues with training or the CLI interrogator not working on some Mac setups, particularly those with limitations in VRAM.
  • 🔧 The script suggests optimizations like adjusting VRAM usage and using the CPU for better performance on Mac.

Q & A

  • What is the video about?

    -The video provides a step-by-step guide on how to install and run the Automatic 1111's Stable Diffusion WebUI on a Mac computer.

  • Why might the performance on an M1 or M2 chip not be optimal for running Stable Diffusion WebUI?

    -The video mentions that the best performance for Stable Diffusion WebUI is achieved on a desktop PC with a powerful Nvidia graphics card, implying that the M1 or M2 chips may not provide the highest performance due to their architecture and hardware limitations.

  • What is the first step to install Homebrew on a Mac?

    -The first step is to visit brew.sh in a browser, copy the command provided, open a terminal, paste the command, and hit enter to install Homebrew after confirming your password.

  • Which software packages are required to be installed for the Stable Diffusion WebUI to work on a Mac?

    -The required software packages include cmake, protobuf, rust, python 3.10, git, and wget, which can be installed using Homebrew.

  • How can one obtain the models needed for Stable Diffusion WebUI?

    -Models, such as stable diffusion checkpoints or safe tensor files, can be downloaded from websites like Hugging Face or other sources that offer modified and pre-tuned Stable Diffusion models.

  • What is the recommended version of Stable Diffusion to use according to the video?

    -The video recommends using Stable Diffusion 1.5, but it also mentions that version 2 and possibly 2.1 are available.

  • How does one navigate to the Stable Diffusion WebUI folder after cloning the project?

    -After cloning the project, one can navigate to the Stable Diffusion WebUI folder by using the 'cd' command followed by the path to the folder, which can be autocompleted using the tab key in the terminal.

  • What command is used to start the Stable Diffusion WebUI on a Mac?

    -The command to start the Stable Diffusion WebUI is './web_ui.sh', which can be run from within the project's directory.

  • What are some potential issues that users might face when running Stable Diffusion WebUI on a Mac?

    -Some users might face issues with training not working or the CLIP interrogator not functioning, especially when dealing with limited VRAM or attempting to generate larger images with higher batch sizes.

  • What optimizations can be made to improve the performance of Stable Diffusion WebUI on a Mac?

    -The video suggests using command line options such as '--med-vram', '--opt-attention', and '--low-vram' to improve performance. Additionally, one can skip the CUDA test and use CPU only with '--skip-torch-cuda-test' and '--no-half'.

  • What is the final outcome of running the Stable Diffusion WebUI on a Mac as shown in the video?

    -The final outcome is a working Stable Diffusion WebUI that can generate images, albeit slower than on a dedicated graphics card, demonstrating that it is functional despite the performance limitations on a Mac.

Outlines

00:00

🛠️ Setting Up Automatic 1111's Stable Diffusion Web UI on Mac

This paragraph introduces a tutorial video by Troubleshoot, focused on setting up Automatic 1111's Stable Diffusion Web UI on a Mac. The video acknowledges that while the best performance is achieved with a powerful Nvidia graphics card on a desktop PC, the guide is suitable for Mac users, including those with M1 or M2 chips or running a Hackintosh. The presenter explains that the software is primarily designed for Linux or Windows, but it can be adapted for Mac use. The setup process involves installing Homebrew, a package manager for macOS, and then installing necessary programs such as cmake, protobuf, rust, python 3.10, git, and wget. The tutorial continues with instructions on cloning the Stable Diffusion Web UI repository from GitHub and setting up the models for image generation, recommending sources like Hugging Face for downloading Stable Diffusion checkpoints.

05:00

🖼️ Optimizing Stable Diffusion Web UI Performance on Mac

The second paragraph continues the tutorial by detailing the process of running the Stable Diffusion Web UI on a Mac, including the initial setup and performance optimization. After installing the necessary packages and models, the user is guided to start the web UI using a shell script, which handles the installation of additional required packages like PyTorch and gfpgan. The video demonstrates the generation of an image using the web UI and discusses the slower performance compared to using a dedicated graphics card. To address this, the presenter suggests optimizations such as adjusting the VRAM usage and modifying the command line arguments in the web UI user.sh file to improve performance. The video also mentions potential issues with training or the clip interrogator not working for some users and provides alternative command line options to troubleshoot these problems. The tutorial concludes with advice on further customization and the presenter's sign-off.

Mindmap

Keywords

💡Stable Diffusion

Stable Diffusion is a type of machine learning model used for generating images from textual descriptions. It is a diffusion model, which is a class of deep learning algorithms that can be used for various tasks, including image generation. In the video, Stable Diffusion is the main focus, as the host demonstrates how to install and run a web UI for this model on a Mac.

💡WebUI

WebUI refers to a web-based user interface that allows users to interact with software applications through a web browser. In the context of the video, the host is installing a WebUI for Stable Diffusion, which facilitates the process of generating images using the Stable Diffusion model through a browser.

💡Homebrew

Homebrew is a package manager for macOS that simplifies the installation of software. It is used in the video to install the necessary dependencies for running the Stable Diffusion WebUI. The host instructs viewers to install Homebrew if they haven't already, using a command from the Homebrew website.

💡M1 Chip

The M1 Chip is a system on a chip (SoC) designed by Apple Inc. for use in their Mac computers. It is mentioned in the video as the type of hardware the host is using to demonstrate the installation of Stable Diffusion WebUI, noting that while it can run the software, a desktop PC with an Nvidia graphics card would provide better performance.

💡cmake

cmake is a cross-platform build system generator used to control the software compilation process. In the video, cmake is listed as one of the required programs to be installed via Homebrew for the proper functioning of the Stable Diffusion WebUI.

💡Python 3.10

Python is a widely used high-level programming language, and 3.10 is a specific version of it. The video script mentions the installation of Python 3.10 as part of the prerequisites for running the Stable Diffusion WebUI, indicating its importance in the software's operation.

💡git

git is a version control system that is used for tracking changes in source code during software development. In the video, git is used to clone the Stable Diffusion WebUI repository from GitHub, which is the first step in obtaining the software's source code.

💡Hugging Face

Hugging Face is a company that provides a platform for developers to share and collaborate on machine learning models. In the context of the video, Hugging Face is mentioned as a source for downloading Stable Diffusion models, which are essential for the image generation process.

💡Checkpoints

In machine learning, checkpoints are files containing the state of a model at a particular point in time, allowing for the resumption of training or the use of the model for inference. The video script refers to downloading checkpoints for Stable Diffusion, which are the model files needed for the WebUI to generate images.

💡Optimization

Optimization in the context of software refers to the process of improving the performance and efficiency of a program. The host in the video discusses various optimization techniques for the Stable Diffusion WebUI, such as adjusting the amount of VRAM usage or using CPU-only mode, to enhance the image generation process on a Mac.

💡CLI (Command Line Interface)

A Command Line Interface (CLI) is a text-based user interface that allows users to interact with a computer program by typing commands. In the video, the host uses the CLI to install software, navigate directories, and run the Stable Diffusion WebUI, showcasing the process of executing commands in a terminal.

Highlights

This video provides a step-by-step guide to install Automatic 1111's Stable Diffusion WebUI on a Mac.

Performance on M1 or M2 chips may not be as high as on a desktop PC with an Nvidia graphics card.

Homebrew must be installed; instructions are given for installing it via brew.sh.

Required programs for setup include cmake, protobuf, rust, python 3.10, git, and wget.

The project can be cloned from the Automatic 1111 stable diffusion web UI GitHub URL.

Models for image generation can be downloaded from sources like hugging face.

Storing models in the 'stable diffusion models' folder is crucial for the software to function.

Running the 'web ui.sh' script initiates the setup and installation of necessary packages.

The initial image generation may take longer than subsequent ones due to additional downloads.

Optimizations such as '--med-vram' can improve performance on Mac.

Issues with training or the CLI interrogator may arise for some users.

Further customization and optimization options are available through the 'web UI user.sh' file.

Using '--opt-attention' can enhance performance when running the software.

Troubleshooting steps include using '--skip-torch-cuda-test' and '--no-half' for GPU issues.

The video concludes with a reminder that performance depends on the hardware used.

The presenter encourages viewers to experiment with different settings for optimal results.