以下を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実行時のコマンド最新(自分用メモ)](https://res.cloudinary.com/dz7ruywxa/images/f_auto,q_auto/v1685193441/f69b2a96299eb23537829674059b8853/f69b2a96299eb23537829674059b8853.png?_i=AA 1804w, https://res.cloudinary.com/dz7ruywxa/images/w_300,h_118,c_scale/f_auto,q_auto/v1685193441/f69b2a96299eb23537829674059b8853/f69b2a96299eb23537829674059b8853.png?_i=AA 300w, https://res.cloudinary.com/dz7ruywxa/images/w_1024,h_404,c_scale/f_auto,q_auto/v1685193441/f69b2a96299eb23537829674059b8853/f69b2a96299eb23537829674059b8853.png?_i=AA 1024w, https://res.cloudinary.com/dz7ruywxa/images/w_768,h_303,c_scale/f_auto,q_auto/v1685193441/f69b2a96299eb23537829674059b8853/f69b2a96299eb23537829674059b8853.png?_i=AA 768w, https://res.cloudinary.com/dz7ruywxa/images/w_1536,h_606,c_scale/f_auto,q_auto/v1685193441/f69b2a96299eb23537829674059b8853/f69b2a96299eb23537829674059b8853.png?_i=AA 1536w)
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実行時のコマンド最新(自分用メモ)](https://res.cloudinary.com/dz7ruywxa/images/f_auto,q_auto/v1685194281/4a7e1cb384ee7b60eb27075f5ca5cd37/4a7e1cb384ee7b60eb27075f5ca5cd37.png?_i=AA 842w, https://res.cloudinary.com/dz7ruywxa/images/w_300,h_55,c_scale/f_auto,q_auto/v1685194281/4a7e1cb384ee7b60eb27075f5ca5cd37/4a7e1cb384ee7b60eb27075f5ca5cd37.png?_i=AA 300w, https://res.cloudinary.com/dz7ruywxa/images/w_768,h_140,c_scale/f_auto,q_auto/v1685194281/4a7e1cb384ee7b60eb27075f5ca5cd37/4a7e1cb384ee7b60eb27075f5ca5cd37.png?_i=AA 768w)
ControlNetが正しく認識されている場合、以下の表示がされる。
![現時点でのStable Diffusion実行時のコマンド最新(自分用メモ)](https://res.cloudinary.com/dz7ruywxa/images/f_auto,q_auto/v1685194223/138d5509a95d8c55c63cdfca2f17e131/138d5509a95d8c55c63cdfca2f17e131.png?_i=AA 1366w, https://res.cloudinary.com/dz7ruywxa/images/w_300,h_297,c_scale/f_auto,q_auto/v1685194223/138d5509a95d8c55c63cdfca2f17e131/138d5509a95d8c55c63cdfca2f17e131.png?_i=AA 300w, https://res.cloudinary.com/dz7ruywxa/images/w_1024,h_1014,c_scale/f_auto,q_auto/v1685194223/138d5509a95d8c55c63cdfca2f17e131/138d5509a95d8c55c63cdfca2f17e131.png?_i=AA 1024w, https://res.cloudinary.com/dz7ruywxa/images/w_150,h_150,c_fill,g_auto/f_auto,q_auto/v1685194223/138d5509a95d8c55c63cdfca2f17e131/138d5509a95d8c55c63cdfca2f17e131.png?_i=AA 150w, https://res.cloudinary.com/dz7ruywxa/images/w_768,h_760,c_scale/f_auto,q_auto/v1685194223/138d5509a95d8c55c63cdfca2f17e131/138d5509a95d8c55c63cdfca2f17e131.png?_i=AA 768w)