最近Stable Diffusion WebUIを使っていろいろテストしているので、結果をシェアします。
環境
- Ryzen 9 7950X
- RTX4070Ti
- DDR5 32GB
- Windows11
です。申し訳ないですが、今回はCUDA版となります。
ZLUDAもあるのですが、動くスクリプトを公開してある程度広まると問題になってささやかなコミュニティが壊れる可能性があるので控えています。
ZLUDAはライセンス的には黒ですから、基本はわたくしが昔、公開したセットアップを参考に自分で環境を構築してください。
HIP SDK5.7.1+ZLUDAでRX400/500、RadeonVII、RDNA1/2/3まで動作するようです。
※ 有志がビルドしたパッケージファイルを検索するとgfx1010のファイルもありますのでおそらく不遇な扱いのRDNA1も動くと思います。
ただし、テストしたわけではない単なるネットの上の情報からの受け売りですので詳細はご自分で確認してください。
大変申し訳ありませんが、悪しからずご了承ください。
では、今回テストしたソフトウェア環境の方です。
- python 3.10.11 embeddable+pip+virtualenv
- minGit2.47
- CUDA Toolkit=未インストール
- cuDNN=未インストール
開発をせずWebUIを動かすだけならCUDA ToolkitとcuDNNは必要ないようです。
cuDNNに関しては公式でビルドされているバイナリを使うと中に含まれておりvenvの中に必要なライブラリがコピーされ、そちらを使うようです。
ただし、パスが切ってあると最初にパスの内容を参照するようです。
今回の内容は実験用です。
普通のかたはStability Matrixをデフォルトで使われることをお勧めしておきます。
pytorchバージョン指定
webui-user.batの内容を追加or書き換え
該当部分が存在する場合は書き換え、そうでなければ追加
Stable Diffusion WebUI Automatic 1111 バージョン1.10.1(最新版)
下をコピペして貼り付けするだけでOKです。
ただし、初回インストール時に限ります。
仮想環境フォルダvenvを削除して次の実行時にも有効になります。
実行される場合はバックアップを取っておくことを推奨します。
デフォルト(指定の必要なし)
set TORCH_COMMAND=pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu118
pytorch 2.2
set TORCH_COMMAND=pip install torch==2.2.2 torchvision==0.17.2 --extra-index-url https://download.pytorch.org/whl/cu118
pytorch 2.3
set TORCH_COMMAND=pip install torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cu118
pytorch 2.4
set TORCH_COMMAND=pip install torch==2.4.1 torchvision==0.19.1 --extra-index-url https://download.pytorch.org/whl/cu118
pytorch 2.5
set TORCH_COMMAND=pip install torch==2.5.1 torchvision==0.20.1 --extra-index-url https://download.pytorch.org/whl/cu118
cu124
pytorch 2.5
set TORCH_COMMAND=pip install torch==2.5.1+cu124 torchvision==0.20.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124
cu124は最新のtorchだけ記述しておきます。
これをテストしようとしている方にとってはこの書き方だけがわかれば理解できるはずです。
torchの最新は2.6.0ですが、まだバグが残っている可能性があるので2.5.1までとしています。
参考にしてください。
なお、内容を反映させるためにはwebui.batではなく、webui-user.batを実行してください。
xformersについて
xformersはデフォルトのtorch2.1.2+cu118以外では動きませんでした。
torch2.2以上を指定するとインストールはされても動きません。
画像の生成もできなくなってしまいます。
検索しても原因はわからなかったので理由を御存知の方は方は良かったら教えてください。
ROCm版のxformersのリポジトリも閉鎖されているので、torchの中に該当の機能が入ったのでしょうか?
torch2.5.1+cu124を使用している際に出たエラーと解決方法
インストールしているextention一覧
git clone https://github.com/continue-revolution/sd-webui-animatediff
git clone https://github.com/Mikubill/sd-webui-controlnet.git
git clone https://github.com/hako-mikan/sd-webui-regional-prompter
git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
git clone https://github.com/blue-pen5805/sdweb-easy-prompt-selector.git
git clone https://github.com/Bing-su/adetailer.git
git clone https://github.com/alemelis/sd-webui-ar.git
git clone https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git
git clone https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git
git clone https://github.com/Physton/sd-webui-prompt-all-in-one
git clone https://github.com/arenasys/stable-diffusion-webui-model-toolkit.git
git clone https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git
git clone https://github.com/richrobber2/canvas-zoom.git
git clone https://github.com/fkunn1326/openpose-editor.git
git clone https://github.com/yankooliveira/sd-webui-photopea-embed.git
git clone https://github.com/Zyin055/Config-Presets.git
git clone https://github.com/AIrjen/OneButtonPrompt.git
git clone https://github.com/ljleb/sd-webui-freeu.git
git clone https://github.com/AI-Creators-Society/stable-diffusion-webui-localization-ja_JP.git
git clone https://github.com/hnmr293/sd-webui-cutoff
git clone https://github.com/huchenlei/sd-webui-openpose-editor
git clone https://github.com/hako-mikan/sd-webui-prevent-artifact
git clone https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git
git clone https://github.com/adieyal/sd-dynamic-prompts.git
git clone https://github.com/aka7774/sd_katanuki.git
git clone https://github.com/picobyte/stable-diffusion-webui-wd14-tagger.git
git clone https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor.git
セットアップ時にカレントディレクトリをextentionsに移動してまとめてインストールしてあるので横着してセットアップスクリプトの部分をそのままコピペしています。
基本的に一度使ったextetionはすべてインストールするようにしている全部入り版なので、かなり数は多いです。
発生したエラーと原因、解決方法
ModuleNotFoundError: No module named 'basicsr'
エラータイプ:警告(WebUIは動作します)
原因:不明(Controlnet OpenPose?)
解決方法
venv\scripts\activate.bat
pip install basicsr
venv\scripts\deactivate.bat
Stable Diffusion WebUIの仮想環境に入り、pipでbasicsrをインストール
2025-02-19 02:49:17.596259: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
エラータイプ:警告(WebUIは動作します)
原因:不明
解決方法
webui-user.batに以下を追加
set TF_ENABLE_ONEDNN_OPTS=0
D:\App\ai-app\sd-wui\venv\lib\site-packages\huggingface_hub\file_download.py:795: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
エラータイプ:警告(WebUIは動作します)
原因:\venv\lib\site-packages\huggingface_hub\file_download.py
解決方法
ありません。あるのかもしれませんが、発見できませんでした。
D:\App\ai-app\sd-wui\extensions\sdweb-easy-prompt-selector\scripts\easy_prompt_selector.py:97: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
reload_button.style(size='sm')
エラータイプ:警告(WebUIは動作します)
原因:拡張機能easy_prompt_selectorの更新が停止しているため
解決方法
ありません。将来的に動かなくなったらそれがeasy_prompt_selectorの寿命ということになると思います。easy_prompt_selectorは2年間更新されていません。
なお、解決しているものに関しては警告表示が出なくなりましたので、問題ないと思います。
私の知識不足で発生原因や解決方法が間違っている可能性がありますので、心配な方はご自分で検証してください。
不安な方は基本的にデフォルトの設定で使うのが良いと思います。
なお、未解決の問題の解決方法を知っておられる方はわたくしのx.comアカウントまで教えていただけるとありがたいです。
よろしくお願いします。