How to Run Stable Diffusion Locally on Windows, Mac, and Linux: The Easiest Way

Stable Diffusion (SD) is one of the best AI art generators out there. Since it is an open-source model, it has been seeing rapid growth and popularity.

Stable Diffusion is free to use and can be run on the local machine as well as on the cloud.

To run Stable Diffusion on the local machine, you need the following system requirements:

  • NVIDIA GPU with at least 4 GB VRAM (6 GB VRAM will be faster)
  • A local storage space of 10 GB
  • An OS of Linux, Windows 11, 10, 8.1, 8, or Mac

However, currently, most consumers’ computer does not come with GPUs. In those cases, you can run Stable Diffusion on Google Colab for free. Google Colab is nothing but a cloud coding environment.

Alternatively, you can also use Stable Diffusion for free on DreamStudio. DreamStudio is a powerful in-browser creative tool that is offered by Stability AI, those who are behind the development of Stable Diffusion. DreamStudio is for people who do not want to install Python modules, SD WebUI, SD checkpoints, and GFPGAN v1.4 checkpoints manually to run Stable Diffusion. However, you only get 200 free credits if you signed in with your Discord account. After running out of free credits, you must buy a membership to continue generating AI images.

If you want to run Stable Diffusion locally, you need to meet the above-mentioned system requirement. On top of it, every time you need to go to the command-line tool or local web server to run the SD model.

In this article, you will learn to use Stable Diffusion on your local machine in the easiest waywithout going to the command-line tool or local web server often.

UnstableFusion for Windows, Mac, and Linux

UnstableFusion is a Stable Diffusion (SD) desktop frontend packed with essential features of inpainting, img2img, and more.

UnstableFusion is one of the in-trend front-end applications to run SD on Windows, Mac, and Linux. This tool makes it easy to run SD on the local machine by eliminating the need of going to the command-line tool or local web server often and providing an easy-to-use user interface (UI). However, it still requires you to install Python, the Stable Diffusion model, and other components.

How to Run UnstableFusion Locally

  1. Install the necessary dependencies using the pip command. The dependencies are:PyQt5, numpy, pytorch, Pillow, opencv-python, requests, flask, diffusers, transformers, and protobuf. Note: if you want to run StableDiffusion on Windows locally, use requirements-localgpu-win64.txt; Command: pip install -r requirements-localgpu-win64.txt
  2. Create a Hugging Face account and an access token. Then, request access to the StableDiffusion model at https://huggingface.co/CompVis/stable-diffusion-v1-4.
  3. Clone this repository and run python unstablefusion.py

How to Use UnstableFusion

  1. You will be given a square box to generate and edit images. The square box will be on your right-hand side and the options will be on your left-hand side.
  2. Use the “destination box” just under the “Stable Diffusion Parameters” to enter the prompt. Then, click the “Generate” button.
  3. You can undo and redo the process from your keyboard. For undo press Ctrl+Z and for redo press Ctrl+Shift+Z.
  4. Use “Increase/ Decrease” buttons to add more detail around an image.
  5. Use “Scratchpad” to import other images.

Features of UnstableFusion

  • UnstableFusion can run locally as well as in Google Colab
  • Unlike other SD colab notebooks, it has both the inpainting and img2img feature
  • It has the ability to erase the AI-generated image and add custom colors to the image
  • This tool has infinite undo and redo option
  • It allows users to import images and increase the image size 

Diffusion Bee

Diffusion Bee is another front-end that makes it easy to run Stable Diffusion on Mac M1/ M2 computers.

Unlike UnstableFusion, Diffusion Bee does not require you to install Python, the Stable Diffusion model, and other components. Rather it is plug-and-play type. Just install the Diffusion Bee application, enter the prompt, and click “Generate”.

Since the application is not available on the MAC App Store yet, you can head to the Diffusion Bee official website to download it.

System Requirement for Diffusion Bee 

Diffusion Bee uses the modified version of Stable Diffusion that leverages the Apple Silicon chips.

  • macOS 12.5.1
  • 16 GB RAM is ideal; however, the application can run on 8 GB RAM with slowness

Features of Diffusion Bee

  • Complete privacy of data
  • Intuitive UI and requires no manual download of other dependencies
  • Supports multiple image sizes
  • Optimized for M1/M2 Chips
  • Plug and play—one-click install

Conclusion

Installing and using Stable Diffusion is no more a headache with UnstableFusion and Diffusion Bee.

Both the application features easy to use UI that allows anyone can use the SD with ease.

You can check out the public demo of Stable Diffusion on Hugging Face, which is quite slow in generating images.

FAQ

1. How to fix “Could not load the Qt platform plugin “xcb”” error on Linux?

If you encounter “Could not load the Qt platform plugin “xcb”” while executing Python dependencies on Linux, execute the below command to solve the xcb compatibility issue.

Command:

pip uninstall opencv-python

pip install opencv-python-headless

Share this:

Leave a Comment