Page 1 of 1

How to make AI art on PC with Complete Guide of Stable Diffusion PC Installation

Posted: 10 Apr 2023 10:30
by anipaco2002
How to make AI art on PC
Complete Guide of Stable Diffusion PC Installation

There are two ways to create an AI art image: using a web service on the Internet and creating an image directly on a local computer. Among them, the advantage of PC is that your artwork is not disclosed. Another great advantage is that the service is free when using the Stable Diffusion PC Web-ui.

Currently, the most widely used platform for creating AI art images on PC is Stable Diffusion Web-ui. Unlike general PC software, Stable Diffusion Web-ui uses an internet browser as a user interface (UI). Therefore, the way to install Stable Diffusion Web-ui is quite tricky unlike installing normal software on a PC.

Stable Diffusion Web-ui is not commercial software. So there is no need to buy it with money. So, not like a paid software, it is not easy to use, the interface is not beautiful, and installation and usage are not end user friendly, but it is very enjoyable just by itself that you can use this awesome program for free to create what you want to draw on PC.

Now, let's install Stable Diffusion Web-ui on PC.
  1. Basic system hardware requirements
  2. Stable Diffusion Web-ui Installation Procedure
  3. Execution and basic usage

1. Basic system hardware requirements

Since AI requires a lot of hardware resources to run, it requires high-end hardware.

Windows must have at least version 10 or higher installed. 64-bit Windows, not the 32-bit version, should be installed by default.
Hardware: The faster the CPU, the better, but at least intel CPU i5 quad-core or higher should be sufficient. The important thing is the presence or absence of a graphics card. A graphics card must be installed in the PC and must have an Nvidia graphic card with at least 4GB of VRAM. But don't be discouraged by the lack of a graphics card. If you use Colab provided by Google, you can use Stable Diffusion even on a computer with low specifications. However, I will not explain here how to install and use Google Colab.
The capacity of the hard disk to install the program must be at least 10GB, and a solid state drive is recommended.


2. Stable Diffusion Web-ui Installation Procedure

1) Install Python
Stable Diffusion Web-ui is a program developed in Python language, and Python, a language tool that can run it, must be installed first.

.
python-download.jpg
.

Go to the download page https://www.python.org/downloads/windows/ on the Python homepage and download the 64-bit program for Windows.

When the download is complete, install it and don't forget to set the path to windows during installation. Make sure “Add Python 3.10 to PATH” is checked.

Click “Install Now” to start the installation.


2) Install git
The next thing you need after Python is git. Git is a free and open source distributed version control system designed to handle projects. Git is a code package that is absolutely necessary to run Stable Diffusion Web-ui, so it must be installed before installing Stable Diffusion Web-ui.

.
git-install.jpg
.

https://github.com/git-guides/install-git

Install it after downloading from the installation git page of the Git website. During installation, all options are set to default.


3) Install Stable Diffusion Web-ui
  1. Open Windows explorer, create a folder to install SD, and run Windows cmd on the folder.
  2. Instead of running cmd by typing cmd in Windows explorer, if you run it after typing cmd in Windows search, you must run cmd prompt by pressing Command prompt rather than Run as administrator.
  3. At the Cmd prompt, type the following and press Enter.
clone-sd.jpg
clone-sd.jpg (27.15 KiB) Viewed 3123 times
.


4) Download checkpoint (model)

What is Checkpoint?
To create an image in SD(Stable Diffusion), at least one checkpoint is required. This package, called Checkpoint or model, is a kind of database package that contains image information needed for SD AI to create images. For example, if a checkpoint named human contains information about images of people, AI draws an image of a person using the information of this checkpoint. However, if you want to draw a bear or a lion in SD with the human checkpoint, you cannot draw anything other than a person with the checkpoint called human, which only has information about people. Therefore, in order to create various images using SD, at least one checkpoint that has information on the shape and behavior of various objects is required. And, if necessary, you can download and use as many checkpoints as you want for various objects and actions created by many people.

First of all, you need at least one checkpoint to run SD. Let's find out how to download and install stable-diffusion-v1.5, the most basic checkpoint.

.
SD-checkpoint-download.jpg
.

https://huggingface.co/runwayml/stable-diffusion-v1-5

Go to the web page above and download one of the two checkpoint files from Download the weights in the Original GitHub Repository section. To do so, you first need to sign up on the Huggingface website, which is free.

v1-5-pruned-emaonly.ckpt - 4.27GB, ema-only weight. uses less VRAM - suitable for inference
v1-5-pruned.ckpt - 7.7GB, ema+non-ema weights. uses more VRAM - suitable for fine-tuning

After downloading one of the two, copy it to the folder called models/stable-diffusion in the main folder where the SD is installed on your PC. When copying is complete, rename the file to model.ckpt and now everything is done.


3. Execution and Basic Usage

1) Modify the webui-user.bat file
Among the files in the SD main folder, find a file called webui-user.bat and open the file with a text file editor. And insert the line with the text, git pull before call webut.bat and save.

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
git pull
call webui.bat

2) Now, when you double-click the webui-user.bat in the SD main folder from Windows file explorer, the program will be executed in the cmd window. It will take some time to install various necessary repositories and files at the first execution. If you wait for a minute or two and the following message appears, it's finally time to meet SD.

.
run-SD-cmd-window.jpg
run-SD-cmd-window.jpg (196.4 KiB) Viewed 3129 times
.

3) Run a web browser, copy and paste the address that appeared on the cmd screen in the address bar, and then hit enter to run the SD, and now the world of AI art will open. Enjoy the new world!

4) Basic Usage

If all installation and execution proceeded normally, the following page will appear on the web browser. This page is the main screen of SD.

.
SD-main.jpg
.

Prompts: The most important thing is Prompts. It is the text entry box at the top of the screen. The text you enter here is called Prompts, and if you enter words, AI creates an image related to those words. For example, typing "dog" will draw a dog, and typing "girl" will draw a girl. And words and words that are entered consecutively are entered by dividing them with a comma ",". You can input like this.

girl, portrait, red shirts, denim pants, sit on chair, background of garden, clear photography

Please refer to the page below for the rules and guidelines for SD Prompts.

https://stable-diffusion-art.com/prompt-guide/

Negative prompts: The box just below the top Prompts box is a text box where you enter negative prompts. You can enter unwanted negative words here. For example, if you write “dog” in the top prompts and “black dog” in the negative prompts below, the AI will draw a dog but not a black dog.

Width and Height: This specifies the size of the image to be drawn. However, since most checkpoints currently have image models based on the size of 512x512, if you enter a size larger than this, you can get a messed up image as a result. Therefore, it is desirable to select a size around 512x512.

For other options, selections and settings, please refer to the professional SD user manual.

The official installation method for SD installation described above and the SD installation guide video on YouTube are introduced below. Please note.

https://stable-diffusion-art.com/install-windows/

https://www.youtube.com/watch?v=onmqbI5XPH8