
拡張機能の入れ方を教えて!
アンインストールってどうやって出来るの?
拡張機能をインストールしたい場合は、Stable Diffusion Web UIにある「extensions」内の項目から導入することが出来ます。
アンインストールする場合は、導入した拡張機能のフォルダを削除することで可能になります。
この記事では、拡張機能のインストール・アンインストール・削除方法について解説します。
拡張機能のインストール方法

拡張機能をインストールする場合は2つの方法があります。
1つ目は、Stable Diffusion Web UI内に予め入っている拡張機能を検索してから導入する方法です。
2つ目は、拡張機能を配布しているサイトのURLを直接入力してから導入する方法になります。
2つの方法についてそれぞれ解説していきます。
1.Stable Diffusion Web UI内から検索して導入する
「Extensions」をクリックしてから「Available」をクリックしてください。
「Load from:」ボタンを押してください。

Stable Diffusion Web UI内に入っている拡張機能が一覧で表示されます。

今回の例では、棒人間を使ってポーズを作成することが出来る「openpose editor」と呼ばれる拡張機能を導入していきます。
検索内で「openpose editor」と入力してください。
「OpenPose Editor tab」の右側にある「Install」をクリックすることでインストールすることが出来ます。

「Installed」をクリックしてから「openpose-editor」が入っているか確認してください。

「Check for updates」をクリックすることで、拡張機能にアップデートがあるかチェックすることが出来ます。

「Settings」をクリックしてから「Reload UI」ボタンを押してStable Diffusion Web UIを再起動してください。

再起動後、上部に「OpenPose Editor」のタブが追加されて拡張機能を導入することが出来ています。

拡張機能は上部にタブが追加されること以外に、「Seed」の下に拡張機能のタブが追加されたり、別の場所で追加される場合があります。

2.URLを直接入力して導入する
Stable Diffusion Web UI内に無い場合は、URLを直接入力して導入することが出来ます。
「Extensions」をクリックしてから「Install from URL」を選択してください。

Githubなどから拡張機能を配布しているURLをコピーしましょう。
Githubの場合は「Code」をクリックしてから「HTTPS」を選択するとURLが表示されるので、コピーアイコンをクリックしてください。

「URL for extension’s git repository」内にコピーしたURLをペーストしてから「Install」ボタンを押してください。

「Installed」をクリックしてから拡張機能がインストールされているか確認します。

「Settings」をクリックしてから「Reload UI」ボタンを押して再起動することで導入完了です。

拡張機能のアンインストール・削除方法

インストールした拡張機能を完全に削除する場合、Google Colabを使っている方はセルの実行を停止してください。
左側にあるフォルダアイコンをクリックしてください。

「stable-diffusion-webui→extensions」をクリックすると、インストールした拡張機能のフォルダを確認することが出来ます。

以下の画像のように「+コード」をクリックして新しくコードを追加してください。
以下のコードのように、赤字部分の場所にインストールした拡張機能のフォルダ名を入力してコードをコピペしてください。
import shutil
shutil.rmtree('/content/stable-diffusion-webui/extensions/openpose-editor')
!python launch.py --share --xformers --enable-insecure-extension-access
セルの実行ボタンをクリックしてStable Diffusion Web UIを起動してください。

実行した後に、再度左側にある「フォルダ」アイコンをクリックしてから「stable-diffusion-webui→extensions」内を確認すると拡張機能が削除できています。

停止だけする方法
拡張機能を削除せずに停止だけさせておく方法は簡単です。
拡張機能の左側にあるチェックを外してから、「Apply and quit」ボタンをクリックしてStable Diffusion Web UIを一旦終了してから起動することで停止することが出来ます。
Stable Diffusion Web UI内から使用しない拡張機能のチェック外すだけなのでおすすめの方法です。

まとめ

拡張機能のインストール・アンインストール・削除方法について解説しました。
・「extension’s」タブからStable Diffusion Web UI内に元から入っている拡張機能を検索してインストールする
・「URL for extension’s git repository」項目内に拡張機能のインストールURLをペーストしてからインストールする
・Stable Diffusion Web UIを終了してから導入した拡張機能のフォルダを削除する
・「Installed」項目内から停止したい拡張機能のチェックを外してからStable Diffusion Web UIを終了して再度起動する