The purpose
Usually, Stable Diffusion requires an Nvidia GPU (such as GeForce).
Here, we will introduce how to run Stable Diffusion using only the CPU on a PC that doesn’t have an Nvidia GPU.
Environment setup
Install Python
Download and install Python 3.10.6 from the following page.


When installing, please check the ‘Add Python 3.10 to PATH’ option.

Verification of Installation
Open the command prompt and execute the following command.
python3 –versionIf executed correctly, it’s a success. (In my environment, it showed ‘Python’.)
The Python version is fixed.
3.10.6 is the specific version designated at the time of article creation.
Please refer to the following page for details.
Install git
Please download and install git from the following page.
Verification of Installation
Launch the command prompt and execute the following command.
gitSuccess if done correctly. (Help will be provided).
stable-diffusion-webui-amdgpu
Clone
Obtain stable-diffusion-webui-amdgpu.
Create a folder to install stable-diffusion-webui-amdgpu.
Launch a command prompt, navigate to the created folder, and execute the following command:
git clone https://github.com/lshqqytiger/stable-diffusion-webui-directmlSuccess is indicated by the process completing and files being created in the installation folder.
Execute webui-user.bat
A webui-user.bat file will be created in the installation folder. Double-click it from File Explorer to run.
If the following error appears immediately after execution (processing will continue), run the git config command that is displayed.

I expect the process to terminate with the following error.

If an error occurs, open webui-user.bat with a text editor such as Notepad, and modify the COMMANDLINE_ARGS line as follows.
set COMMANDLINE_ARGS=--skip-torch-cuda-testSave the above changes and run webui-user.bat again from Explorer. If a message appears during execution asking you to run git config~, execute the specified command and then run webui-user.bat from Explorer again. (Repeat this process as needed.)

If the above error appears, launch a new command prompt and execute the following command
pip install gradioIt’s generally safer to open a new command prompt because using an already open one may not reflect updated environment variables
The process is complete when the GUI appears in your browser as shown below.

Handling Runtime Errors
If you encounter a “RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same” error during runtime, open the webui-user.bat file and modify the COMMANDLINE_ARGS to add --no-half.
set COMMANDLINE_ARGS=--skip-torch-cuda-test --no-halfAfter making the changes, run webui-user.bat again.
Result
We can generate an image by entering a prompt into the displayed GUI and clicking the “Generate” button.

Reference



comment