How to Run Stable Diffusion on PC (Online/Offline Method) 2024

Are you seeking how to run stable diffusion on a PC locally or online? Then you are at the right place. Today, I will show you two methods of running stable diffusion on your PC and generating AI images quickly.

What is Stable Diffusion

Stable Diffusion is an AI tool that uses diffusion techniques to generate realistic High-Quality AI images using Text Prompt. Stable diffusion was launched in 2022 to produce GenerativeAI images, but in 2023, it was also used to create AI videos and Animations. Below, I share the complete details about using stable diffusion on your local PC.

Minimum System Hardware Requirement

  • A minimum of 7GB Space is required for installation.
  • Minimum 4GB VRAM.
  • Nvidia Graphics Card.

1. How to Run Stable Diffusion on PC Locally

To run the stable diffusion on a local PC is a vast process. Please follow the below steps carefully to avoid error-free run stable diffusion.

Step 1: Important Software for Running Stable Diffusion

Two crucial pieces of software are required to run stable diffusion. One is Python, and the other is Git.

Install Python

Stable Diffusion on PC 1 Python
  • by opening the https://www.python.org/ link on your browser.
  • Download the latest version of Python.
  • Install the Python library on your computer by using the Python installer.

Install Git

Stable Diffusion on PC 2 git
  • Open the https://git-scm.com/ official link on your browser.
  • Download the latest version of Git.
  • Install the Git software on your computer.

After successfully installing Python and Git, you can proceed to the next step; otherwise, it will not work.

Step 2: Create a GitHub and Hugging Face Account

You will need the GitHub and Hugging Face accounts to access the stable diffusion models and resources. Below, I share how you can create accounts on both these websites.

How to Create a GitHub Account

Stable Diffusion on PC 3
  1. To create an account on “Github”, you need to open the official link of “Github”.
  2. Click the signup button to fill in all the required fields.
  3. After filling it out, submit and verify your GitHub account.
  4. After successful verification, you can use a GitHub account for your coding purposes.

How to Create a Hugging Face Account

Stable Diffusion on PC 4 hugging face
  1. Go to the https://huggingface.co/ official website.
  2. Click the Signup button to complete all the required information and create a password.
  3. After successfully creating an account, you can access all the features of the Hugging Face website, including stable diffusion resources.

After completing these two essential steps, you can install the stable diffusion on your local computer.

Step 3: Cloning Stable Diffusion Web-UI

To run the stable diffusion on a local PC, you must install the Web-UI repository on your computer. The Web-UI repository has the main files and codes to run the stable diffusion locally. Follow the below process to install the Web UI on the local PC.

  • Launch the command prompt on your desktop.
  • Navigate to the desired directory to install stable diffusion Web-UI using the “cd” command. (e.g., cd desktop).
  • Once you decide on the install directory, run the https://github.com/stablediffusion/web-ui code on the command prompt.
  • According to your internet connection, downloading and installing a stable diffusion Web-UI takes a few minutes or more.

Step 4: Download Latest Stable Diffusion Model

You need to install stable diffusion models to generate realistic Artificial intelligence images. Without the model, you don’t generate images using stable diffusion. Follow the below process to download the best version of the stable diffusion model.

  • Open the official hugging face stable diffusion model https://huggingface.co/stabilityai/stable-diffusion-2 link on your Chrome browser.
  • On this website, you will get lots of stable diffusion models. Select one model according to your preference.
  • On the stable diffusion model page, you will see the download button. Click the download button to download the stable diffusion model on your local PC.
Stable Diffusion on PC 5

Note: you need sufficient local storage space to download and install stable diffusion models.

After downloading the Stable diffusion model, you are ready to configure the model with Web UI.

Step 5: Setting for stable diffusion Web-UI

You must configure the web-UI with a stable diffusion model to get a graphical user interface on stable diffusion. Follow the below method to configure the model with web-ui correctly.

  • Open a command prompt and navigate where you install the stable diffusion web-ui repository.
  • Run the “pip install -r requirements.txt” command to install the required dependencies for stable diffusion.
  • Find the “config.py” file in the web-ui repository and open it in the text editor.
  • Edit the path of your stable diffusion model in the “Config.py” file edit settings as per your requirement and save it.
  • Once you complete the configuration, run the command “python app.py” on the command prompt to start Stable Diffusion Web-UI.

Well. You successfully configured stable diffusion web-ui on your local computer. Now, you can run stable diffusion on your PC and produce generative AI images from text.

Step 6: Run Stable Diffusion on the Local PC

After completing all the above steps, you can generate AI images from stable diffusion. Follow the below step-by-step process for generating images from text.

#1: launch the command prompt or terminal on your PC.

#2: using the “cd” command, go to the directory where you installed the stable diffusion web-Ui.

#3: once in the stable diffusion web-ui directory, execute the “python stable_diffusion.py” command to run the stable diffusion.

#4: here, you will get a stable diffusion graphic user interface.

#5: enter the text prompt in “your text prompt here”. (e.g., a teenage girl going to school on a bicycle).

#6: stable diffusion process your text prompt and generate realistic AI images according to your prompt. You can experiment with text to generate better images.

Stable Diffusion on PC 6

2. How to Run Stable Diffusion Online (Google Colab)

Google Colab is the product of Google used for running arbitrary Python code on browsers. You don’t need to spend on hardware for running Python code. Below, I share the step-by-step method of efficiently running stable diffusion on your Google Chrome browser.

Note: you always need an internet connection to run stable diffusion on Google Colab. With an internet connection, these codes work.

#1: Click the “StableDiffusion InvokeAI Base Cloud version” link to open stable diffusion Installation.

#2: Click the “Step 1” Play button to install basic requirements for stable diffusion.

Stable Diffusion Online Google Colab 1

#3: Download the stable diffusion models on the “Step 2” play button.

Stable Diffusion Online Google Colab 2

#4: now click the “Run StableDiffusion InvokeAI” button to install the stable diffusion. Do not open the stable diffusion until the URL is not shown as in the below image.

Stable Diffusion Online Google Colab 3

#5: now select the first link to open stable diffusion.

Stable Diffusion on PC 7

#6: Enter the text to generate realistic AI images. (e.g. “Virat Kohli going to college”)

Stable Diffusion Online Google Colab 4

That’s it. You have successfully run stable diffusion on your computer without using any hardware. You can change your model through “Model Manager”.

FAQs

Can I use stable diffusion without installing it on a local PC?

Yes. You can use the Google Colab platform to run stable diffusion files without using your local PC system. You need a browser to execute all the files.

Can I use stable diffusion without installing Python and Git?

No. You cannot use stable diffusion without installing Python and Git because these tools are necessary to execute codes of stable diffusion.

How can I optimize the performance of stable diffusion?

You can play with stable diffusion settings to optimize the stable diffusion performance. You can change temperature scaling or top-k sampling, etc., to produce different types of outputs.

Which method of stable diffusion is easy to use online or offline?

Using stable diffusion online through Google Colab is more straightforward than installing it on a local PC. You don’t need hardware requirements to install stable diffusion. You need a browser and an internet connection. On the other hand, you need many hardware requirements (e.g., graphic card, higher RAM, and processor), which are unavailable to every computer user.

Can we need hardware requirements for using stable diffusion online?

No. It would be best to have a browser and internet connection to run the stable diffusion on the Google Colab platform.

Conclusion

Stable Diffusion is an excellent AI tool that generates Realistic images from input text. To generate unique AI images, check out this mind-blowing text-to-image AI tool.

I hope you like my article “How to Run Stable Diffusion.” Share with your family and friends if this is informational. If you have any queries, please comment below. I try to answer every single comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

AI Tools Directory
@ copyright 2024 | AiToolGeek.com