How to run Stable Diffusion? 5 ways to run it online and locally

Stable Diffusion released in 2022 by Stability AI and researchers from the University of Munich and Runway, is a text-to-image generation model capable of Vincentian image generation, graph-generated images, modified images, and filling in low-resolution images. Due to its high-quality image generation and open source nature, it has gained significant popularity among creators. This article outlines various methods for running Stable Diffusion online and locally.
How to run Stable Diffusion online
DreamStudio
DreamStudio is Stability AI’s official website application for Stable Diffusion image generation. Users can enter natural language prompts and adjust parameter controls to create customized images. It also supports API access. After registering and logging in, users receive 25 free credits, allowing approximately 30 standard image generations. Additional credits can be purchased as needed.
Official website: https://beta.dreamstudio.ai/generate

Clipdrop
Clipdrop offers AI image processing tools from Stability AI, including image erasure, enlargement, lighting adjustments, background removal/replacement, and zoom filling. It also supports the latest Stable Diffusion XL model. Users can generate 400 free images daily with a watermark or upgrade for premium, unlimited usage and watermark removal.
Official website: https://clipdrop.co/stable-diffusion

Hugging Face
The well-known open source AI model hosting platform Hugging Face provides Stable Diffusion. Users can directly enter prompts and generate images, though speed may be slower than other options due to high traffic.
Official website: https://huggingface.co/spaces/stabilityai/stable-diffusion

Replicate
Replicate helps users quickly deploy machine learning models like Stable Diffusion via a few lines of code. It hosts an online Stable Diffusion environment that generates images faster than Hugging Face.
Official website: https://replicate.com/stability-ai/stable-diffusion

How to run Stable Diffusion locally
For users interested in customizing the Stable Diffusion model with their own inputs or for privacy reasons, running the model locally is a viable option. The following steps outline the process to set up Stable Diffusion on a local machine:
Step 1: Install Python and Git
To install Python 3.10.6 version, you can download and install it from the official website of Python . After the installation is complete, you can open the command line terminal and enter python-version
to check the Python version. The next step is to install the code management tool Git. You can download the installation package from Git’s official website .
Step 2: Sign up for GitHub and Hugging Face accounts
GitHub is used to host software code, while Hugging Face is an open source AI model community. Registering accounts on these two platforms can facilitate the synchronization management of your subsequent code and download the Stable Diffusion model.
Step 3: Clone Stable Diffusion Web-UI to your local computer
Stable Diffusion Web-UI is an open source Stable Diffusion web interface project developed based on Gradio , which can help developers quickly create Stable Diffusion user interfaces. First create a folder, such as sd-project, and then use the cd command to locate the folder, cd sd-project
. Then run the git clone command to download the project, git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
Step 4: Download the Stable Diffusion model from Hugging Face
Visit the Hugging Face official website, log in to your registered account, and download Stable Diffusion version 1.5 . After the model is downloaded, navigate to the “models” folder in the stable-diffusion-webui folder, and then put the model here.
Step 5: Set up Stable Diffusion Web-UI
Open a command line terminal and use the cd command to navigate to the stable-diffusion-webui folder, such as cd xx/sd-project/stable-diffusion-webui
, then enter webui-user.bat
Install dependencies.
Step 6: Run Stable Diffusion
After the dependencies are successfully installed, a URL will appear in the command prompt: http://127.0.0.1:7860 . Copy and paste this into your browser address bar to run stable-diffusion-web-ui.
