Midnight-Phantom
( Enigmatic-Entity )
- Joined
- Feb 27, 2023
- Messages
- 323
- Points
- 78
Please note that this thread is intended for Windows users equipped with an Nvidia graphics card.
If you want to utilize stable diffusion locally on your own device and create AI art, then this blog is tailored for you.
To get started, First, update your windows and your graphis drivers.
You can find the Nvidia driver tool at: https://www.nvidia.com/en-in/geforce/drivers/
After you have done that open the following websites in different tabs to streamline the process:
- Automatic 1111: https://github.com/AUTOMATIC1111/stable-diffusion-webui
- Git: https://git-scm.com/
- Python: https://www.python.org/downloads/release/python-3106/
- Python (Windows store): https://www.microsoft.com/store/productid/9PJPW5LDXLZ5?ocid=pdpshare
Download and install the latest versions of Git and Python (3.10.6) from the provided websites. During installation, make sure to select the option to "Add to PATH." This step is crucial for the proper functioning of the software.
(Note: If you choose to download Python from the Windows Store, the step for adding it to your PATH for Python is not required.)
Once the installations are complete, create a new folder where you intend to install stable diffusion. Opt for a fast drive such as an SSD or an M.2 drive for optimal performance. While using an HDD is possible, it may not provide the same reliability and speed.
Keep in mind that stable diffusion models can occupy a significant amount of space, especially as you’ll add various extensions and models in future. If you plan to expand your web UI with features like Lora, lycoris, hypernetwork, embeddings, and more, additional space and speed will be essential for smooth model loading.
After selecting a drive and creating a folder, open a command prompt (cmd), PowerShell, or terminal window. Navigate to your chosen folder.
If you don't know how to, click on the path to the folder in your tab and type “cmd” and press enter it will open the cmd window already navigated to your path.
In your browser, go to the GitHub page "AUTOMATIC1111/stable-diffusion-webui." Click on the green icon labelled "<> Code." Without making any changes, click on the copy icon next to the URL bar to copy the URL.
Return to your command prompt (cmd) window and type the following command “git clone” and paste the copied URL, it will look like this:
```
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
```
Press Enter to initiate the download of the automatic 1111 web UI. Please be patient, as this process might take some time.
During the execution of the command, you might encounter an error indicating the availability of a new version of Pip. If prompted, highlight the command text using the Ctrl key and your mouse's left button. Copy the command (Ctrl+C) and wait for the ongoing download to complete. Once the download finishes, close the command prompt window.
At this point, you should have a folder named "stable-diffusion-webui." Enter this folder.
Open a new command prompt terminal and paste (Ctrl+V) the previously copied command from the Pip update error. Press Enter to upgrade the Pip model to the latest version. Once the upgrade is complete, you can close the terminal window.
After completing the previous steps, you will have successfully set up the stable diffusion environment.
Now, locate a (.bat) file called "webui-user.bat" in the folder. You need to edit this file using any text editor. Windows default Notepad can be used, but I recommend using Notepad++ for script editing.
Download Notepad++ from the following link: https://notepad-plus-plus.org/
Once you have Notepad++ installed, follow these steps to edit the "webui-user.bat" file:
Edit "webui-user.bat" with Notepad++ or any text editor.
In the file, you will find the following lines:
```
@Echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
call webui.bat
```
You need to make changes to the "COMMANDLINE_ARGS" line. Add the following parameters to it: `--xformers --opt-sdp-no-mem-attention --no-half-vae --autolaunch`
After adding these parameters, the line should look like this:
```
set COMMANDLINE_ARGS=--xformers --opt-sdp-no-mem-attention --no-half-vae --autolaunch
```
These changes are for optimization and a smoother experience. They are particularly beneficial if you don't have the latest Nvidia RTX 4090 graphic card. Even if you have the latest graphic card, these changes can still improve your experience.
Once you've made the changes, save the script with the modifications.
By following these steps, you've made the necessary changes to the "webui-user.bat" file to optimize and improve your stable diffusion experience.
You need to download stable diffusion models now, as these models are what actually create art. Up to this point, you've been setting up the user interface to use the models.
You can access the official models from Stability AI through their Hugging Face repository
Hugging Face: https://huggingface.co/stabilityai
Alternatively, you can explore models trained by the community, available at Civitai repository
Civitai: https://civitai.com/
It's worth noting that Stability AI has made the stable diffusion models open source, allowing anyone to utilize them within certain guidelines.
If you're interested, you can review these guidelines by visiting:
Guidelines: https://github.com/Stability-AI/stablediffusion/blob/main/LICENSE
I recommend exploring community models that have been trained on original models but offer unique variations, such as fully anime models or 3D models. These models can produce images in specific styles, like anime or realistic 3D.
You'll find a variety of models that cater to different preferences and purposes. While there are additional advanced features like Lora, lycoris, hypernetwork, embeddings, and more, these are not necessary for beginners. To start, you can choose from some of the top models listed below:
Realistic Models based on SD 1.5:
- Dreamshaper: [Link](https://civitai.com/models/4384/dreamshaper)
- Epicrealism: [Link](https://civitai.com/models/25694/epicrealism)
- Majicmix Realistic: [Link](https://civitai.com/models/43331/majicmix-realistic)
- Realistic Vision v5.1: [Link](https://civitai.com/models/4201/realistic-vision-v51)
- Absolute Reality: [Link](https://civitai.com/models/81458/absolutereality)
- Cyberrealistic: [Link](https://civitai.com/models/15003/cyberrealistic)
- Dream2Reality: [Link](https://civitai.com/models/105573/dream2reality)
- Juggernaut: [Link](https://civitai.com/models/46422/juggernaut)
- Realisian: [Link](https://civitai.com/models/47130/realisian)
- XXMix9 Realistic: [Link](https://civitai.com/models/47274/xxmix9realistic)
Anime Models based on SD 1.5:
- Aniverse: [Link](https://civitai.com/models/107842/aniverse)
- AnimeSH: [Link](https://civitai.com/models/90642/animesh)
- AnyLora Checkpoint: [Link](https://civitai.com/models/23900/anylora-checkpoint)
- Meina Pastel: [Link](https://civitai.com/models/11866/meinapastel)
- Meina Unreal: [Link](https://civitai.com/models/18798/meinaunreal)
- MeinaMix: [Link](https://civitai.com/models/7240/meinamix)
- Meina Hentai: [Link](https://civitai.com/models/12606/meinahentai)
- Mistoon Anime: [Link](https://civitai.com/models/24149/mistoonanime)
- Perfect Deliberate Anime: [Link](https://civitai.com/models/111274/perfectdeliberate-anime)
- Real Cartoon 3D: [Link](https://civitai.com/models/94809/realcartoon3d)
For those interested in models based on SDXL 1.0, here are a few options to consider:
- Dreamshaper XL10: [Link](https://civitai.com/models/112902/dreamshaper-xl10)
- SDVN6 RealXL: [Link](https://civitai.com/models/118114/sdvn6-realxl)
- Copax Realistic XL SDXL10: [Link](https://civitai.com/models/118111/copax-realistic-xl-sdxl10)
- SDXL-10 ArienMixXL Asian Portrait: [Link](https://civitai.com/models/118913/sdxl-10-arienmixxl-asian-portrait)
- Cyborg Style SDXL or Goofy AI: [Link](https://civitai.com/models/119405/cyborg-style-sdxl-or-goofy-ai)
- LAH Mysterious or SDXL: [Link](https://civitai.com/models/118441/lah-mysterious-or-sdxl)
- TalmendoXL SDXL Uncensored Full Model: [Link](https://civitai.com/models/119202/talmendoxl-sdxl-uncensored-full-model)
- Ambience SDXL: [Link](https://civitai.com/models/118949/ambience-sdxl)
- Niji 3D Style SDXL: [Link](https://civitai.com/models/118567/niji3dstylesdxl)
It's worth noting that as of ( 03.08.2023 ), SDXL models are relatively new, only a few weeks old. Consequently, there might be a limited variety available at this time. However, as the community continues to develop and refine these models, more polished and diverse options are likely to emerge on Civitai. Keep an eye on the platform for upcoming releases.
Do keep in mind that SDXL models are notably larger than their 1.5 or 2.1 counterparts, also meant to be used with a default resolution of 1024 by 1024, compared to the 512 by 512 resolution of 1.5 and 2.1 models. This distinction is important to remember when using them.
After downloading the models you prefer, you need to put them in the specified folder for them. Within the folder where you downloaded the Automatic 1111 web UI, locate a subfolder named "models." Open this subfolder, and within it, you'll find several more subfolders. Look for a folder named "Stable-diffusion". This is the place where you should move the models you've downloaded.
After you've completed moving all the models, return to the main folder and open a terminal. Type the command "git pull" and remember this step, as it's necessary for updating the web UI in the future. It's recommended to do this at least once a week. If your web UI is fully updated, the command window will indicate such. Otherwise, some files will be downloaded during the process.
Once you've finished these steps, create a shortcut of the "webui-user.bat" file on your Windows homepage. You can do this by pressing Ctrl+Shift while clicking on the file. After creating the shortcut, you can close all open tabs.
To run the web UI, click on the shortcut you created. During the first launch, it might take some time to load as certain elements are downloaded. Be patient. Once the loading is complete, your browser will automatically open, and the UI will be displayed.
Now, you're all set to use stable diffusion as you wish. In the future, when you want to download new models or perform similar tasks, remember the location of the folder where you moved your models. This location will also contain folders for other components like Lora, VAE, and more. If you download additional items, you'll know where to place them.
A piece of advice: When downloading files, always choose the (.pt) and (.safetensors) format for models, Lora, VAE, embeddings and hypernetwork files. Avoid downloading (.CKPT) files, as they could potentially be malicious unless it's from an official source or you're creating them yourself.
If you want to utilize stable diffusion locally on your own device and create AI art, then this blog is tailored for you.
To get started, First, update your windows and your graphis drivers.
You can find the Nvidia driver tool at: https://www.nvidia.com/en-in/geforce/drivers/
After you have done that open the following websites in different tabs to streamline the process:
- Automatic 1111: https://github.com/AUTOMATIC1111/stable-diffusion-webui
- Git: https://git-scm.com/
- Python: https://www.python.org/downloads/release/python-3106/
- Python (Windows store): https://www.microsoft.com/store/productid/9PJPW5LDXLZ5?ocid=pdpshare
Download and install the latest versions of Git and Python (3.10.6) from the provided websites. During installation, make sure to select the option to "Add to PATH." This step is crucial for the proper functioning of the software.
(Note: If you choose to download Python from the Windows Store, the step for adding it to your PATH for Python is not required.)
Once the installations are complete, create a new folder where you intend to install stable diffusion. Opt for a fast drive such as an SSD or an M.2 drive for optimal performance. While using an HDD is possible, it may not provide the same reliability and speed.
Keep in mind that stable diffusion models can occupy a significant amount of space, especially as you’ll add various extensions and models in future. If you plan to expand your web UI with features like Lora, lycoris, hypernetwork, embeddings, and more, additional space and speed will be essential for smooth model loading.
After selecting a drive and creating a folder, open a command prompt (cmd), PowerShell, or terminal window. Navigate to your chosen folder.
If you don't know how to, click on the path to the folder in your tab and type “cmd” and press enter it will open the cmd window already navigated to your path.
In your browser, go to the GitHub page "AUTOMATIC1111/stable-diffusion-webui." Click on the green icon labelled "<> Code." Without making any changes, click on the copy icon next to the URL bar to copy the URL.
Return to your command prompt (cmd) window and type the following command “git clone” and paste the copied URL, it will look like this:
```
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
```
Press Enter to initiate the download of the automatic 1111 web UI. Please be patient, as this process might take some time.
During the execution of the command, you might encounter an error indicating the availability of a new version of Pip. If prompted, highlight the command text using the Ctrl key and your mouse's left button. Copy the command (Ctrl+C) and wait for the ongoing download to complete. Once the download finishes, close the command prompt window.
At this point, you should have a folder named "stable-diffusion-webui." Enter this folder.
Open a new command prompt terminal and paste (Ctrl+V) the previously copied command from the Pip update error. Press Enter to upgrade the Pip model to the latest version. Once the upgrade is complete, you can close the terminal window.
After completing the previous steps, you will have successfully set up the stable diffusion environment.
Now, locate a (.bat) file called "webui-user.bat" in the folder. You need to edit this file using any text editor. Windows default Notepad can be used, but I recommend using Notepad++ for script editing.
Download Notepad++ from the following link: https://notepad-plus-plus.org/
Once you have Notepad++ installed, follow these steps to edit the "webui-user.bat" file:
Edit "webui-user.bat" with Notepad++ or any text editor.
In the file, you will find the following lines:
```
@Echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
call webui.bat
```
You need to make changes to the "COMMANDLINE_ARGS" line. Add the following parameters to it: `--xformers --opt-sdp-no-mem-attention --no-half-vae --autolaunch`
After adding these parameters, the line should look like this:
```
set COMMANDLINE_ARGS=--xformers --opt-sdp-no-mem-attention --no-half-vae --autolaunch
```
These changes are for optimization and a smoother experience. They are particularly beneficial if you don't have the latest Nvidia RTX 4090 graphic card. Even if you have the latest graphic card, these changes can still improve your experience.
Once you've made the changes, save the script with the modifications.
By following these steps, you've made the necessary changes to the "webui-user.bat" file to optimize and improve your stable diffusion experience.
You need to download stable diffusion models now, as these models are what actually create art. Up to this point, you've been setting up the user interface to use the models.
You can access the official models from Stability AI through their Hugging Face repository
Hugging Face: https://huggingface.co/stabilityai
Alternatively, you can explore models trained by the community, available at Civitai repository
Civitai: https://civitai.com/
It's worth noting that Stability AI has made the stable diffusion models open source, allowing anyone to utilize them within certain guidelines.
If you're interested, you can review these guidelines by visiting:
Guidelines: https://github.com/Stability-AI/stablediffusion/blob/main/LICENSE
I recommend exploring community models that have been trained on original models but offer unique variations, such as fully anime models or 3D models. These models can produce images in specific styles, like anime or realistic 3D.
You'll find a variety of models that cater to different preferences and purposes. While there are additional advanced features like Lora, lycoris, hypernetwork, embeddings, and more, these are not necessary for beginners. To start, you can choose from some of the top models listed below:
Realistic Models based on SD 1.5:
- Dreamshaper: [Link](https://civitai.com/models/4384/dreamshaper)
- Epicrealism: [Link](https://civitai.com/models/25694/epicrealism)
- Majicmix Realistic: [Link](https://civitai.com/models/43331/majicmix-realistic)
- Realistic Vision v5.1: [Link](https://civitai.com/models/4201/realistic-vision-v51)
- Absolute Reality: [Link](https://civitai.com/models/81458/absolutereality)
- Cyberrealistic: [Link](https://civitai.com/models/15003/cyberrealistic)
- Dream2Reality: [Link](https://civitai.com/models/105573/dream2reality)
- Juggernaut: [Link](https://civitai.com/models/46422/juggernaut)
- Realisian: [Link](https://civitai.com/models/47130/realisian)
- XXMix9 Realistic: [Link](https://civitai.com/models/47274/xxmix9realistic)
Anime Models based on SD 1.5:
- Aniverse: [Link](https://civitai.com/models/107842/aniverse)
- AnimeSH: [Link](https://civitai.com/models/90642/animesh)
- AnyLora Checkpoint: [Link](https://civitai.com/models/23900/anylora-checkpoint)
- Meina Pastel: [Link](https://civitai.com/models/11866/meinapastel)
- Meina Unreal: [Link](https://civitai.com/models/18798/meinaunreal)
- MeinaMix: [Link](https://civitai.com/models/7240/meinamix)
- Meina Hentai: [Link](https://civitai.com/models/12606/meinahentai)
- Mistoon Anime: [Link](https://civitai.com/models/24149/mistoonanime)
- Perfect Deliberate Anime: [Link](https://civitai.com/models/111274/perfectdeliberate-anime)
- Real Cartoon 3D: [Link](https://civitai.com/models/94809/realcartoon3d)
For those interested in models based on SDXL 1.0, here are a few options to consider:
- Dreamshaper XL10: [Link](https://civitai.com/models/112902/dreamshaper-xl10)
- SDVN6 RealXL: [Link](https://civitai.com/models/118114/sdvn6-realxl)
- Copax Realistic XL SDXL10: [Link](https://civitai.com/models/118111/copax-realistic-xl-sdxl10)
- SDXL-10 ArienMixXL Asian Portrait: [Link](https://civitai.com/models/118913/sdxl-10-arienmixxl-asian-portrait)
- Cyborg Style SDXL or Goofy AI: [Link](https://civitai.com/models/119405/cyborg-style-sdxl-or-goofy-ai)
- LAH Mysterious or SDXL: [Link](https://civitai.com/models/118441/lah-mysterious-or-sdxl)
- TalmendoXL SDXL Uncensored Full Model: [Link](https://civitai.com/models/119202/talmendoxl-sdxl-uncensored-full-model)
- Ambience SDXL: [Link](https://civitai.com/models/118949/ambience-sdxl)
- Niji 3D Style SDXL: [Link](https://civitai.com/models/118567/niji3dstylesdxl)
It's worth noting that as of ( 03.08.2023 ), SDXL models are relatively new, only a few weeks old. Consequently, there might be a limited variety available at this time. However, as the community continues to develop and refine these models, more polished and diverse options are likely to emerge on Civitai. Keep an eye on the platform for upcoming releases.
Do keep in mind that SDXL models are notably larger than their 1.5 or 2.1 counterparts, also meant to be used with a default resolution of 1024 by 1024, compared to the 512 by 512 resolution of 1.5 and 2.1 models. This distinction is important to remember when using them.
After downloading the models you prefer, you need to put them in the specified folder for them. Within the folder where you downloaded the Automatic 1111 web UI, locate a subfolder named "models." Open this subfolder, and within it, you'll find several more subfolders. Look for a folder named "Stable-diffusion". This is the place where you should move the models you've downloaded.
After you've completed moving all the models, return to the main folder and open a terminal. Type the command "git pull" and remember this step, as it's necessary for updating the web UI in the future. It's recommended to do this at least once a week. If your web UI is fully updated, the command window will indicate such. Otherwise, some files will be downloaded during the process.
Once you've finished these steps, create a shortcut of the "webui-user.bat" file on your Windows homepage. You can do this by pressing Ctrl+Shift while clicking on the file. After creating the shortcut, you can close all open tabs.
To run the web UI, click on the shortcut you created. During the first launch, it might take some time to load as certain elements are downloaded. Be patient. Once the loading is complete, your browser will automatically open, and the UI will be displayed.
Now, you're all set to use stable diffusion as you wish. In the future, when you want to download new models or perform similar tasks, remember the location of the folder where you moved your models. This location will also contain folders for other components like Lora, VAE, and more. If you download additional items, you'll know where to place them.
A piece of advice: When downloading files, always choose the (.pt) and (.safetensors) format for models, Lora, VAE, embeddings and hypernetwork files. Avoid downloading (.CKPT) files, as they could potentially be malicious unless it's from an official source or you're creating them yourself.
Last edited: