Run Stable Diffusion locally on your PC without using a GPU.

この記事は約7分で読めます。
スポンサーリンク

Notice

This article describes how to use Stable Diffusion Direct ML without a GPU, but we recommend using Stable Diffusion Forge, as described in the article below.

スポンサーリンク

Things I want to do

Stable Diffusion typically requires an Nvidia GPU (such as GeForce).

This guide explains how to run Stable Diffusion using only the CPU on a PC without an NVidia GPU.

スポンサーリンク

Environment setup

Installing Python

Download and install Python 3.10.6 from the following page.

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

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

Installation Verification

Open Command Prompt and execute the following command.

python3 –version

If it runs correctly, it’s a success. (In my environment, it displayed ‘Python.’)

Installing Git

Download and install Git from the following page.

Redirecting…

Installation Verification

Open Command Prompt and execute the following command.

git

If executed correctly, it will be successful. (Help will be displayed.)

スポンサーリンク

stable-diffusion-webui-directml

Clone

Get stable-diffusion-webui-directml.

Create a folder to install stable-diffusion-webui-directml.

Open the command prompt, create the folder, and execute the following command.

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

If the process is complete and the files have been created in the installation folder, it was successful.

Execute webui-user.bat

A file named webui-user.bat will be created in the installation folder; run it by double-clicking it in File Explorer.

If the following error appears immediately after execution (processing will continue), execute the git config~ command that is displayed.

The process will likely terminate with the following error.

If an error is displayed, open webui-user.bat with a text editor such as Notepad and change the COMMANDLINE_ARGS line as follows:

set COMMANDLINE_ARGS=--skip-torch-cuda-test

Save the above changes and run webui-user.bat again from Explorer.

If prompted to run `git config~` at runtime, execute the specified command, then run `webui-user.bat` again from Explorer. (Repeat this several times.)

If you see the above error, open a new command prompt and run the following command.

pip install gradio

Using an already open command prompt may result in environment variables not being updated, so it’s safer to open a new one.

The process is complete when the GUI is displayed in your browser as shown below.

スポンサーリンク

Handling runtime errors

If you encounter the error ‘RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same’ during execution, open the webui-user.bat file and modify COMMANDLINE_ARGS as follows: (Add –no-half)

set COMMANDLINE_ARGS=--skip-torch-cuda-test --no-half

After making the corrections, run webui-user.bat again.

スポンサーリンク

Result

I was able to create the image by entering the prompts in the displayed GUI and clicking Generate.

スポンサーリンク

Websites I used as references

GitHub - lshqqytiger/stable-diffusion-webui-amdgpu: Stable Diffusion web UI
Stable Diffusion web UI. Contribute to lshqqytiger/stable-diffusion-webui-amdgpu development by creating an account on GitHub.
Mini PC HX80G(AMD製GPU RX6600M)でStable Diffusionを使ってみる - Qiita
はじめに 久しぶりにStable DiffusionをAMD製GPUのWindows PCで使おうとしたのですが、環境構築方法をすっかり忘れていてたので、CPUのみを使う場合とGPUを使う場合の両方の手順をメモしておきます。 環境 実行環境はミニPCなので性能は高くない...
[Bug]: Input type (float) and bias type (struct c10::Half) should be the same · Issue #9496 · AUTOMATIC1111/stable-diffusion-webui
Is there an existing issue for this? I have searched the existing issues and checked the recent builds/commits What happened? I chose Upscalers with 'ESRGAN‘ in...

コメント

タイトルとURLをコピーしました