23 September 2023

How Stable Diffusion Works (AI Image Generation) | Gonkee 48,922 views Jun 26, 2023

 


___________________________________________________________________________________

How to install Stable Diffusion on any Windows PC

Published: Sep 21, 2023, 05:20
  ❘   Updated: Sep 21, 2023, 05:39
Blue abstract image of a neural networkSTABLE DIFFUSION

Want to test the waters with generative AI? Here’s how to install Stable Diffusion on any Windows PC and give your creativity an AI superpower.

Diving into the world of AI-driven content generation? Stable Diffusion stands out as a powerful tool in this rapidly evolving space. Think of it as ChatGPT‘s counterpart, but instead of writing paragraphs, it weaves images from textual cues.

For those unaware, Stable Diffusion operates in a domain similar to Adobe’s Firefly, harnessing text to create visual imagery.

Though Stable Diffusion is compatible with most PCs, a word of caution: it’s very power-hungry. Pairing it with a high-end graphics card, like Nvidia’s RTX 40-series, is advisable to optimize performance.

Tech-savvy individuals with a know-how of the command prompt might find the installation straightforward. For everyone else, we’ve laid out a simple, step-by-step guide to navigate the setup seamlessly.

1. Install Python on your PC

The first step to getting Stable Diffusion up and running is to install Python on your PC.

  • Download Python 3.10.6 here or on the Microsoft Store.
  • Run the installer and check “Add Python to PATH”. This will allow Python from the command prompt.
  • Go through the setup process to get the software fully installed with any customizations you require.
  • Once the installation is finished, you will see a screen with the message “Setup was successful”.

2. Install Git

Git is a piece of software used to manage repositories on your PC, and is widely used for software development. Getting Git installed will assist in the Stable Diffusion installation process.

  • Download Git on Windows here.
  • Follow the instructions on the installer once it is downloaded.

3. Clone Web-UI

Now, this is where it can get complicated, what we’re going to do is get the basics of the Stable Diffusion installation on your PC.

  • Run “command prompt” on your PC
  • Navigate to “C:\Users\X> – “X” denotes your user name.
    To get there, you can also type “cd %X%” and press enter. This will get you to the right file directory.
  • Paste the following command into the window without quote marks.
    git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
  • After running this command, open your file explorer and navigate to your user folder. If successful, you should have a new folder named “stable-diffusion-webui

4. Download a Stable Diffusion model file

Next, you will need to get a Stable Diffusion model file, this is usually several gigabytes, and that’s totally normal, it just might take a while to install.

  • Download a Stable Diffusion model file from HuggingFace here.
  • Navigate to the “stable-diffusion-webui” folder we created in the previous step.
  • Locate the “models” folder, and inside that, open “stable-diffusion”. Inside, there will be a text file.
  • Move the previously-downloaded Stable Diffusion model file to this folder.

5. Set up Web-UI

Finally, you’ll need to set up Web-UI in order to finally run Stable Diffusion. Luckily, this is a relatively simple process.

  • Open the “stable-diffusion-wbui” folder we created in Step 3.
  • Run “webui-user.bat”
  • This will open a command prompt window which will then install all of the necessary tools to run Stable Diffusion, this process can take 5-10 minutes.
  • You will know when the process is completed when you see the URL “http://127.0.0.1:7860” in the command prompt window.

6. Run Stable Diffusion

With all of that installed, all you now need to do is open your web browser and paste “http://127.0.0.1:7860” into the address bar. This will then run Stable Diffusion in your browser.

How to use Stable Diffusion

Blue background with vague numerical charactersSTABLE DIFFUSION

In order to use Stable Diffusion, input a prompt on the WebUI window, which will then generate an image based on that prompt. You’ll need a powerful Nvidia or AMD graphics card in order to create the image. On the UI, you can also adjust things like the size of the image, and how many images you want the software to generate, too.

What is Stable Diffusion?

Stable Diffusion is a piece of software with a trained dataset that can turn text prompts into AI-generated images. The generated images can be of almost anything that you can imagine, though it does require some fine prompt tuning in order to get the output that you want.

No comments: