How to Run Stable Diffusion Locally

Let's get you started

Last Updated on

Attention all AI newbies – here’s how to run Stable Diffusion locally.

Stable Diffusion is a text-to-image model, powered by AI, that uses deep learning to generate high-quality images from text. If you want to run Stable Diffusion locally, you can follow these simple steps. This will let you run the model from your PC.

Running Stable Diffusion Locally

Stable Diffusion is a powerful tool with many potential applications, such as art, design, and entertainment. With Stable Diffusion, you can generate realistic and detailed images with high fidelity to the text input.

Essential AI Tools

Editor's pick
EXCLUSIVE DEAL 10,000 free bonus credits

Jasper AI

On-brand AI content wherever you create. 100,000+ customers creating real content with Jasper. One AI tool, all the best models.
Editor's pick
Only $0.01 per 100 words

Originality AI detector

Originality.AI Is The Most Accurate AI Detection.Across a testing data set of 1200 data samples it achieved an accuracy of 96% while its closest competitor achieved only 35%. Useful Chrome extension. Detects across emails, Google Docs, and websites.
Editor's pick

Experience the full power of an AI content generator that delivers premium results in seconds. 8 million users enjoy writing blogs 10x faster, effortlessly creating higher converting social media posts or writing more engaging emails. Sign up for a free trial.


10x Your Content Output With AI. Key features - No duplicate content, full control, in built AI content checker. Free trial available.
*Prices are subject to change. PC Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn more

By running Stable Diffusion locally, you can experiment with different text inputs and generate images that are customized to your specific needs. You can fine-tune and train the model on your data, leading to even better results.

Running Stable Diffusion locally is a simple process that requires only a few steps. By following these steps, you can generate high-quality images from text using deep learning.



Install the Required Software

You must install Python 3.8 or later on your computer to run Stable Diffusion. You need to install PyTorch, a popular deep-learning framework. Install PyTorch using pip, the package installer for Python. For PyTorch, you can use the following command: “pip install torch torchvision torchaudio.”



Download the Stable Diffusion Repository

Next, you need to download the Stable Diffusion repository from GitHub. You can do this by navigating to the Stable Diffusion GitHub page and clicking the “Clone or download” button. You can then download the repository as a ZIP file and extract it to a folder on your computer.



Install the required Python Packages

Once you have downloaded the Stable Diffusion repository, you must install the required Python packages. You can do this by running the command “pip install -r requirements.txt” in the Stable Diffusion folder.



Prepare the Text Input

You need to provide text input to generate an image using Stable Diffusion. The text input should describe the image you want to generate.

For example, if you want to generate an image of a cat, you could provide the text input “A brown cat with green eyes is sitting on a blue sofa.” You can save the text input in a plain text file.



Run Stable Diffusion

To run Stable Diffusion, open a command prompt or terminal window and navigate to the Stable Diffusion folder.

You can then run the following command:

python –text_file /path/to/text_input.txt –output_dir /path/to/output_folder

Replace /path/to/text_input.txt with the path to your text input file and /path/to/output_folder with the path to the folder where you want to save the generated image.



View the generated image

After running Stable Diffusion, you can view the generated image in the specified output folder. You can open the image using any image viewer. You can adjust the image quality and resolution by modifying the command line arguments in the “” file.


Stable Diffusion is an exciting development in text-to-image generation, and running it locally is a great way to explore its capabilities. You can generate stunning images that impress you with a few simple steps. 

Give it a try today and see what you can create! For more inspiration, check out our guide to Stable Diffusion here.