How to get the Stable Diffusion AI art tool?

Amartya
How to get Stable Diffusion for your PC? (Image via @Stable Diffusion AI Art/ twitter.com)
How to get Stable Diffusion for your PC? (Image via @Stable Diffusion AI Art/ twitter.com)

Stable Diffusion is a free-to-use AI art tool used to create various artworks and is a growing trend today. It allows you to have multiple options for customizing your piece. With its wide variety of settings and tinkering, you can create near-accurate images if you know the prompt structure. This text-to-image AI takes in command prompts from the user and turns them into the desired image.

Over the past few months, they have released the tool to the public, which users can now download and use freely on their systems. PC users have to meet certain specifications to run a vast database of assets provided by the AI art tool. With periodic updates, you get to experience the currently trained version of the AI that is more capable of creating better artwork than the previous versions.


Creating artworks with the Stable Diffusion AI art tool

System specifications

Before diving into the tedious process of downloading and installing the AI, it is essential to check your PC specifications to determine how well it can run. Stable Diffusion is a heavy app that requires considerable processing power when producing high-quality images and animations. Thus, a PC suitable for video editing and rendering is highly recommended here.

Here are the minimum specs that your system will need:

1) Any newer Intel or AMD CPUs with at least 16 GB RAM (DDR4 or DDR5).

2) Any GeForce RTX GPU or AMD equivalent with at least 6 GB of VRAM.

3) The assets and files take up nearly 10 GB of storage. So, you will also need that much free space in your internal storage. NVMe SSD is the preferred storage type for fast data transfer speeds.

With further optimization of the app, the above requirements may become more feasible with changes.


Downloading Stable Diffusion files and resources for Windows

youtube-cover

Stable Diffusion is still undergoing a lot of testing and updates and will require a few download procedures to get the AI art tool up and running. It currently runs via the webui.bat file, and to set that up, you will first have to meet some download criteria:

1) Git: Git is an open-source DevOps tool to manage source codes. It is free to use and can efficiently support small to large projects. Download and install Git for your OS. You can download the Windows version or the original Git SCM and keep all the settings at default while installing.

2) Python: A programming language that has been used to develop most of the Stable Diffusion codes and is essential to run it. Download the latest version from python.org for your OS and run the installation.

One crucial factor to remember is that you will be prompted with a check box asking to "Add Python to PATH" upon initiating the installation. Make sure you enable that option to run the Stable Diffusion files without much difficulty. You can keep the rest of the defaults as is.

3) Stable Diffusion resources: You must download the resources needed to run the AI art tool from huggingface.co. Hugging Face is an open-source platform where users can share and train with resources for machine learning projects.

In the search bar, type "stable diffusion" and select "runwayml/stable-diffusion-v1-5" or a newer version if available. Download the weights from the "Original Github Repository" section. These files contain the models for Stable Diffusion to work with and create artwork.

4) GitHub: Next is downloading the user interface to interact with Stable Diffusion, and we do that from GitHub. There are different versions of interfaces, but the one from the user: AUTOMATIC1111 has become quite popular, and you can download the same.

To do this, follow these steps here:

  • Create a new folder on your PC drives and name it "Stable Diffusion" or something similar you can work with.
  • In your web browser, search for Automatic1111 and visit their GitHub page from the search results or simply visit this URL: https://github.com/AUTOMATIC1111/stable-diffusion-webui.
  • Under "code," you can find the HTTPS link that can be copied. Copy the code by clicking on the copy button.
  • Return to your 'Stable Diffusion' folder that you created earlier, and in the location bar, type "cmd" to bring up the command prompt.
  • Once you are in the command prompt, type "git clone," which is the required command, and paste the link of the code you copied from GitHub beside it by putting a space after the clone command. Press Enter, and the necessary files to the interface will be downloaded to your folder.

5) Placing the resources: Once the interface is downloaded, all that remains is to place the model in your Stable Diffusion folder. Go to your folder where the interface files have been downloaded in the previous step and open the folder named "models."

The resources (or models) you downloaded in step 3 from Hugging Face need to be copied and pasted here. Once it is copied, rename the file (usually named 'v1-5-pruned-emaonly.ckpt' or similar) to "models."

6) Updates: To keep getting the latest updates and changes automatically, you can add a Git command to the "webui-user.bat" file in your Stable Diffusion folder. Right-click on the file and click "edit" to pull up the text editor and add the command line "git pull" at the top. Ensure this command is in its line and that no other commands are changed.

Save the file and close the text editor. This command will ensure that updates from Git are downloaded every time you launch the app.

7) Launch: You can launch the AI by clicking on the "webui-user.bat" file. The first time it is launched, it will take some time for the command prompt to load up the resources before you can use it.

Once it is done loading, you will see a local URL provided in the prompt. Copy this URL and run it on your browser to run Stable Diffusion. The user interface will pull up with a text input bar and many other settings to customize and create artwork.

The images you create will be shown on the interface and can also be found in the "Output" folder inside the "Stable Diffusion" you created earlier to install the app.


Some basic features of Stable Diffusion

The user interface from Automatic1111 has some excellent features for users to play around with. Here are some of the features that this AI art tool offers:

1) Text-to-image: The "txt2img" tab provides users with the text input bar. Here, you can type in your text prompt and click on the "Generate" button to start creating images from text.

The "negative prompt" bar takes in the features you do not want in your image and thus produces a result excluding the prompts put in there. It is beneficial when the description of your image could have multiple interpretations.

2) Image-to-image: As the name suggests, this feature lets users upload an image or use an AI-generated one and edit it using creative descriptions in the text prompt. Different aspects of the image, like strength, height, width, steps, and more, can be controlled via the settings.

3) Samplers: The Stable Diffusion model, in essence, generates images by "de-noising" pixel vectors to produce dedicated images for the prompts. This requires a lot of math work that is handled by samplers.

youtube-cover

Different samplers produce different outputs depending on the sampling steps. Users are free to set several sampling steps and choose the sampler that works best for them.

4) Batch count and size: Stable Diffusion produces images in batches. The batch count determines the number of batches per generation, and the size determines the number of images produced per batch.

It is advised to keep the settings at lower values as it will put a load on your GPU. This can ultimately slow down your PC, cause heating issues, and freeze the system.

5) CFG Scale: Classifier-free Guidance Scale settings help users determine how accurately they want the AI to follow their text prompts. Lower numbers will fetch less accurate images. Usually, 7-11 is a decent setting for accurate text interpretations.

6) Seed: A seed number for the images generated here is provided. Entering the seed of the image will pull up the prompts and settings of the image. If the seed is set to -1, it will produce a random value every time.

7) Script: Various scripts are used to modify different aspects of images while image-mapping. Some come with installed models, while others can be downloaded from GitHub.

youtube-cover

Additionally, a huge collection of settings is available in the web UI that allows users to play around with text prompts and photo edits. Getting used to them can take time, but Stable Diffusion can help create detailed and high-quality artwork once you have the hang of it.

Quick Links

App download animated image Get the free App now