Stable Diffusionをローカル構築

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

v1.0.0-pre > sd.webui.zip ダウンロード。

解凍して、C:\sd.webui に展開

公式学習モデルをダウンロードする

https://huggingface.co/stabilityai/stable-diffusion-2-1/ にアクセス

v2-1_768-ema-pruned.safetensors のLFSボタンをクリックしてダウンロード

C:\sd.webui\models\Stable-diffusion に置く

追加の学習モデルをダウンロード

https://huggingface.co/stabilityai/sd-vae-ft-mse-original/tree/main にアクセス

vae-ft-mse-840000-ema-pruned.ckpt をダウンロード

ファイル名をv2-1_768-ema-pruned.vae.pt に変更

C:\sd.webui\webui\model\Stable-diffusion に置く

sd.webui\webui フォルダの v2-inference-v.yaml を C:\sd.webui\webui\models\Stable-diffusion にコピーして置く

ファイル名をv2-1_768-ema-pruned.yaml に変更

実行ファイルの編集

C:\sd.webui\webuiにあるwebui-user.batを編集

set COMMANDLINE_ARGS=–xformers –autolaunch

太文字を追記して保存

インストール

C:\sd.webui にある update.batをダブルクリックして実行

続行するには何かキーを教えてください。。。が出たら適当なキーを教えて閉じる

run.batをダブルクリックして実行

To create a public link, set ‘share=True’ in ‘launch()’ が表示されてStable Diffusionのブラウザが起動したらOK

ここで下記エラーが出たら。。。

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Traceback (most recent call last):
File “C:\sd.webui\webui\launch.py”, line 352, in
prepare_environment()
File “C:\sd.webui\webui\launch.py”, line 257, in prepare_environment
run_python(“import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'”)
File “C:\sd.webui\webui\launch.py”, line 120, in run_python
return run(f'”{python}” -c “{code}”‘, desc, errdesc)
File “C:\sd.webui\webui\launch.py”, line 96, in run
raise RuntimeError(message)
RuntimeError: Error running command.
Command: “C:\sd.webui\system\python\python.exe” -c “import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'”
Error code: 1
stdout: Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe

stderr: Traceback (most recent call last):
File “”, line 1, in
File “C:\sd.webui\system\python\lib\site-packages\torch__init__.py”, line 133, in
raise err
OSError: [WinError 126] w肳ꂽW[‚܂B Error loading “C:\sd.webui\system\python\lib\site-packages\torch\lib\c10.dll” or one of its dependencies.

続行するには何かキーを押してください . . .

stdout: Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe

https://aka.ms/vs/16/release/vc_redist.x64.exe にアクセスしてダウンロードしたらインストール

もう一度、run.batを実行

今回は、モジュールをインストールしたら解決できました。

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