Publish: 2023-02-26 | Modify: 2023-02-26
Recently, AI drawing has become very popular. I tried some online tools, but the free usage is limited, and the price for more usage is not cheap. Xiaoz found that "Stable Diffusion" can be built locally to achieve local AI drawing of "artistic images", so there is no need to pay a high price, hehe.
Stable Diffusion is developed by computer scientists and artists. It uses deep learning algorithms and stable diffusion processes to generate artistic images. Specifically, it uses an algorithm called random walk to create images, which simulates the random changes in pixel values to simulate the path wandering in the stable diffusion process. The algorithm also uses neural network technology to learn and generate different image styles.
Stable Diffusion can generate beautiful and complex works of art, and its applications include art creation, image generation, visual effects design, etc. If you are interested in this, you can search online for more information or try using the tool for artistic creation.
After searching online for the process of building "Stable Diffusion", I found that the process is very complicated, and I almost gave up. Just when I was about to give up, I found a project called "Easy Diffusion" on Github. It provides various dependencies such as one-click installation of Stable Diffusion, which greatly reduces the installation difficulty.
This article aims to share and record Xiaoz's installation process of "Easy Diffusion". Although this tool simplifies many steps, the installation still has a certain difficulty. It is recommended that friends who have a certain understanding of computers give it a try.
Download link: https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.5.15/stable-diffusion-ui-windows.zip
You can check for updates here: https://github.com/cmdr2/stable-diffusion-ui/releases
Easy Diffusion will download a large amount of content from foreign networks, such as Python environment, drawing models, etc., which are difficult or almost impossible to access on domestic networks. Therefore, we need to let the Windows command line access the Internet with scientific methods.
Open your CMD command line and enter the following command to set up the HTTP proxy:
set http_proxy=http://127.0.0.1:10809
set https_proxy=http://127.0.0.1:10809
http://127.0.0.1:10809
is your HTTP proxy address. If you don't know what it is, it is recommended to give up.
Unzip the downloaded zip file stable-diffusion-ui-windows.zip
to any directory. Then:
stable-diffusion-ui
directoryStart Stable Diffusion UI.cmd
scriptNext is a long wait, and there may be some errors. I have summarized the errors I encountered below.
If it prompts a timeout error when downloading Python packages:
HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
You can solve it by setting the pip mirror source. Easy Diffusion will install a separate Python 3.8 environment for you, and we need to set the pip mirror source. The following command sets the pip mirror source of Easy Diffusion to Aliyun mirror:
cd D:\stable-diffusion-ui\installer_files\env\Scripts
d:
pip.exe config set global.index-url https://mirrors.aliyun.com/pypi/simple/
If you encounter an error prompt for failed model download, you can directly search for the model's name on Google or Github to download it, and then put it in the specified directory of models
.
I have compiled some model download links:
When encountering errors during the installation of Easy Diffusion, pay attention to the error prompt information, and then try to solve it manually through the above method. After manually solving it, run the Start Stable Diffusion UI.cmd
script again.
During the installation process, Xiaoz encountered problems such as Python package installation timeout and model download errors, and has successfully solved them manually through the above method. Everyone's situation is different, so it is recommended to be flexible and search for solutions online.
After successful installation, the browser address http://localhost:9000/
will automatically open the WEB interface. You can now generate "artistic images" according to your preferences. Xiaoz is further researching some usage methods. Feel free to leave a comment to discuss.
After the installation is complete, we can cancel the HTTP proxy of the Windows command line:
set http_proxy=
set https_proxy=
This article refers to: https://github.com/cmdr2/stable-diffusion-ui
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.