現時点でのStable Diffusion実行時のコマンド最新(自分用メモ)

2023年5月27日
知恵
Pocket

以下をGoogle Colaboratory上で実行。(ランタイムは、GPU)

!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
%cd /content/stable-diffusion-webui/extensions/
!git clone https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper /content/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper
%cd /content/stable-diffusion-webui
!python launch.py --share --enable-insecure-extension-access --disable-safe-unpickle 

Stable Diffusionが立ち上がったら、Extensionから、ControlNetをDLする。

https://github.com/Mikubill/sd-webui-controlnet
現時点でのStable Diffusion実行時のコマンド最新(自分用メモ)

Stable Diffusionを一旦、停止する。

以下をGoogle Colaboratory上で実行。

!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_openpose-fp16.safetensors -O /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_openpose-fp16.safetensors
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/blob/main/control_scribble-fp16.safetensors -O /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_scribble-fp16.safetensors

civitaiのモデルは、毎回DLを実行するのが大変なので、Google Drive上においたものをシンボリックリンクで読み込む

!cp -s /content/drive/MyDrive/stablediffusion/kisaragiMix_v211.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/kisaragiMix_v211.safetensors
# Counterfeit-V2.5をインストール
!wget https://huggingface.co/gsdf/Counterfeit-V2.5/resolve/main/Counterfeit-V2.5_pruned.safetensors -O /content/stable-diffusion-webui/models/Stable-diffusion/Counterfeit-V2.5_pruned.safetensors
!wget https://huggingface.co/gsdf/Counterfeit-V2.5/resolve/main/Counterfeit-V2.5.vae.pt -O /content/stable-diffusion-webui/models/VAE/Counterfeit-V2.5.vae.pt

# EasyNegativeをインストール
!wget https://huggingface.co/datasets/gsdf/EasyNegative/resolve/main/EasyNegative.safetensors -O /content/stable-diffusion-webui/embeddings/EasyNegative.safetensors 

Stable Diffusionを起動する。

!python launch.py --share --enable-insecure-extension-access --disable-safe-unpickle 

torchvision関連でエラーが出た場合は、以下が必要。

pip install torchvision==0.12.0

モデルが正しく認識されている場合、以下の切り替えが可能。

現時点でのStable Diffusion実行時のコマンド最新(自分用メモ)

ControlNetが正しく認識されている場合、以下の表示がされる。

現時点でのStable Diffusion実行時のコマンド最新(自分用メモ)