Google Colaboratory Stable Diffusion WebUI インストールメモ
検索してもインストールできないことが多いので、2023/07中旬の時点で整理。
ライブラリのアップデート
!pip uninstall torch torchvision -y
!pip install torch torchvision
!pip uninstall xformers
!echo y | pip install xformers==0.0.16
ランタイムの再起動
上記インストールが終わった段階で メニュー内の「ランタイム」 → 「ランタイムを再起動」
そのあとで 「ランタイム」 → 「ランタイムのタイプを変更」 を選択後、「ハードウェア アクセラレータ」 のドロップダウンメニューから 「GPU」 を選択。
AI画像生成用のライブラリのインストール
%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117
torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1
--extra-index-url https://download.pytorch.org/whl/cu117
Stable Diffusion WebUI のインストールと起動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
!wget https://civitai.com/api/download/models/11745 -O /content/stable-diffusion-webui/models/Stable-diffusion/Chilloutmix-Ni-pruned-fp32-fix.safetensors
!python launch.py --share --xformers --enable-insecure-extension-access
起動に成功するとこんなログが出る。
Use --skip-version-check commandline argument to disable this check.
=================================================================================
Calculating sha256 for /content/stable-diffusion-webui/models/Stable-diffusion/Chilloutmix-Ni-pruned-fp32-fix.safetensors: preload_extensions_git_metadata for 7 extensions took 0.00s
Running on local URL: http://127.0.0.1:7860
Running on public URL: https://cd7f518c5243751f45.gradio.live
public URL にアクセスして動作確認
