Stable Diffusion Image Generation AI Model Windows Mac Deployment Guide

Stable Diffusion is a deep learning text-to-image generation model released in 2022. It is mainly used to generate detailed images based on textual descriptions, but it can also be applied to other tasks such as internal rendering, external rendering, and translation of images under the guidance of prompt words (English).

DreamStudio has now launched the Stable Diffusion XL Preview version. You can experience it first in the official drawing: DreamStudio official drawing board

Stable Diffusion's code and model weights are publicly released and can run on most computer hardware with a modest GPU. Previous proprietary Vincent graph models, such as DALL-E and Midjourney, were only accessible through cloud computing services.

If you want to deploy Stable Diffusion on your own device, you can get help according to the deployment platform: Windows Mac

The Stable Diffusion model supports the generation of new images through the use of cue words describing elements to be included or omitted, as well as the redrawing of existing images containing the new elements described in the cue words (a process often referred to as "guided imaging" "guided image synthesis" by using the diffusion-denoising mechanism of the model. In addition, the model also allows partial changes in existing images through inline complementation and external complementation rendering through prompt words. When used with user interfaces that support this functionality, there are many different open source software out there.

Windows version installation guide:

Hardware requirements

The minimum hardware requirement is an Nvidia 1000 series graphics card with more than 8GB of video memory, preferably an RTX series graphics card, which will be much faster. AMD and Intel graphics cards are not available. Students who can't reach it can use Google Colab's computing resources for free (video memory 16GB+).

Installation process

Network disk download link: Baidu network disk please enter the extraction code extraction code: 17ai

2. Unzip the novelai-webui-aki-v2 compressed package

3. Unzip the webui launcher compressed package

 

4. Place the files in the webui launcher into the novelai-webui-aki-v2 folder

5. Run the installation launcher to run dependencies-dotnet-6.0.11

 

6. Run the launcher

7. Wait for installation (it takes 10 to 20 minutes)

8. After the installation is completed, enter the interface

 9. Enter "Variational Autoencoder (VAE) Model" in model management and download the SD template

 10. Enter the Stable Diffusion model to download and install the model file (you can import the model in the compressed package into it)

 11. You can download the version you want in the version management, and you can upgrade to the latest version with one click.

Edit

 12. You can now start SD (please turn off the agent when starting)

 13. Wait for the installation and loading to complete, and the SDweb interface will be generated in the default browser.

 14. Enter the settings and select the SD template 

15. Select the model you want to use and enter keywords to generate images.

 16. Now you can use SD to generate the pictures you want . To view more models, go to civitai

MAC System Installation Guide

 

Software and hardware requirements

  • A Mac computer, the system is M1 or M2, and the memory is 8G or more (the bigger, the better, the bigger, the faster).
  • The available hard disk space should be at least 10G and above, and preferably above 30G.
  • You need to be able to access the internal and external networks smoothly.

Installation process

1. Install homebrew, open the terminal (command + space bar, enter terminal, press Enter to open), and install homebrew. (If already installed, skip to the next step)

2. Copy and execute the following code in the terminal (official version):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If there is no response or an error is reported due to network problems, you can use the domestic mirror version:

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

Check whether homebrew is installed successfully

brew -v

If the homebrew version information is displayed, the installation is successful.

If it shows

zsh: command not found: brew

You need to add Homebrew to the environment variable PATH, and the corresponding steps are given. Users need to configure environment variables according to the suggestions given in order to use Homebrew normally in the terminal. Execute immediately in the current terminal/shell

eval "$(/opt/homebrew/bin/brew shellenv)"

3. Install python, open a new terminal window and run:

brew install cmake protobuf rust [email protected] git wget

4. Install stable-diffusion-webui. If git is not installed, install git first. Run in Terminal:

brew install git

Then use git to clone all the github open source programs of stable diffusion webui to your Mac computer locally, and execute in the terminal:

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

5. Download the ai drawing basic model. Here we take the Stable Diffusion 2.0 training model as an example. Find and download 768-v-ema.ckpt in the "file" tag of the stabilityai/stable-diffusion-2 · Hugging Face page. After downloading, place the downloaded ckpt file in the "Your Username">Stable-diffusion-webui>Models>Stable-diffusion folder. 6. Run stable-diffusion-webui and use terminal to enter the folder of stable-diffusion-webui. run

cd stable-diffusion-webui

Open stable-diffusion-webui, run

./webui.sh

This step may take a long time as several SD required applications will be downloaded. If there is no progress for a long time and various errors are reported, use Finder to open the stable-diffusion-webui folder, find files such as launch.py, and open them with the text editing software that comes with the system. They should be around 200-300 lines long. , find similar

“gfpgan_package = os.environ.get('GFPGAN_PACKAGE', "git+ https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379")”

paragraph. And at the front of " https://github.com/xxx ", add: " https://ghproxy.com/ ". In this way, the system download related applications will be modified to download at the domestic mirror station, which will be more stable and faster. . After adding it, it will become something like:

“gfpgan_package = os.environ.get('GFPGAN_PACKAGE', "git+ https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379")”

paragraph. Add the lines before and after gfpgan and the paragraph with the github URL. Similar to the picture below:

Save and close the launch.py ​​file. Re-run ./webui.sh. It will probably be fine after a few minutes. until terminal displays

“Running on local URL: http://127.0.0.1:7860To create a public link, set share=True in launch(). ”

7. Open the stable-diffusion-webui web version. Be careful not to close the terminal window. Open the browser (Safari or Chrome) and enter http://127.0.0.1:7860 to access the local web version of stable diffusion webui.

 Next, you can enter the prompt word in the prompt box and click Generate to generate the AI ​​drawing.

Guess you like

Origin blog.csdn.net/m0_48707860/article/details/131549395