How to run Stable Diffusion AUTOMATIC1111 locally on your PC without a GPU.

This article can be read in about 6 minutes.
PR

The purpose

While the previous post showed how to run Stable Diffusion Forge on a CPU, I couldn’t resist also getting AUTOMATIC1111 up and running to compare them.

In this article, I’ll show you how to run AUTOMATIC1111 using your CPU. (Generally speaking, I’d recommend using Forge instead.)

PR

Environment setup

Install Python

Please download and install Python 3.10.6 from the page below.

Python Release Python 3.10.6
The official home of the Python Programming Language

During installation, make sure to check the ‘Add Python 3.10 to PATH’ box.

Confirming the installation

Open a Command Prompt and run the following command:

python3 –version

If it executes correctly, you’re all set. (In my case, it displayed ‘Python’.)

Install git

You can download and install Git from the page below.

Git - Downloading Package

Confirming the installation

Open a Command Prompt and run the following command.

git

If you see the help message, it means the execution was successful.

PR

Install Stable Diffusion AUTOMATIC1111

You can download the source code for the version you want from the page below.

(You could clone the repository, but this is a simpler method.)

Releases · AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.

Unzip the downloaded files into any folder you’d like.

modify webui-user.bat

Open the webui-user.bat file in the folder you just unzipped and make the following changes.

Before:

set COMMANDLINE_ARGS=

After:

set COMMANDLINE_ARGS= --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --precision full --no-half

Execute webui-user.bat

After making the changes, run webui-user.bat.

ModuleNotFoundError: No module named ‘pytorch_lightning’

The process may terminate with the following error.

ModuleNotFoundError: No module named 'pytorch_lightning'

Open a Command Prompt, navigate to your project’s root directory, and run venv\Scripts\activate.bat.

After that, execute the following command.

pip install pytorch_lightning

After the process is finished, run webui-user.bat once more

git config –global –add safe.directory

You might see an error like "Call: git config --global --add safe.directory XXXXXX" which stops the process. (XXXXXX will be a folder name.)

Open a command prompt and run the command git config --global --add safe.directory XXXXXX.

After it finishes, run webui-user.bat again.

This error might show up more than once (for a different folder, presumably). Keep running the command that appears in the error message until the error stops.

PR

Result

I was able to successfully start it up.

PR

Troubleshooting

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

If image generation fails and you see the following error, there’s a chance the COMMANDLINE_ARGS value in your webui-user.bat file is wrong.

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

Please confirm that it looks like the example below. (Pay special attention to --use-cpu interrogate)

set COMMANDLINE_ARGS= --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --precision full --no-half

comment

Copied title and URL