![見出し画像](https://assets.st-note.com/production/uploads/images/139743098/rectangle_large_type_2_c09ad826dba68504ff27864081540b6e.png?width=1200)
SD-WEBUI-FORGEのDev2版のインストールについての話
最近、SD-WEBUI-FORGEはアップデートされないなーと思いつつ、個人的には不便なところはなかったので、そのまま使用していたのですが、Discussionの所で、Dev2版のブランチが更新されたとのアナウンスがありました。
ざっくりとした内容としては、メインで運用されているllyasvielさんがFORGEのアップデートを行えない状態で、他のFORGEをサポートしているメンバーはメインを更新出来ないため、devブランチで更新してみようかという感じの様です。ただ、現状はreadmeページも更新できない状態なので、分かるかなーみたいな感じでした。
今後、本格的に更新されていくのかは分かりませんが、Dev2版のインストールについてのコードを追加しておきます。
最近は、一時フォルダのインストールをよく使用しているのでそれを記載しておきます。
基本はbranchをインストールするので、depthfm版を入れたのと同じようにする感じです。ただ、内容はforgeのものにしてみました。
※たまたまかも知れませんが、controlnetがエラーでうまく動きませんでした。depthfmブランチだと動いているので、必要な場合はそちらで対応してください。
一時ディレクトリ版のコマンド
①dev2版のインストールコマンド
#(1) webui forge Dev2ブランチ
%cd /tmp
!git clone --branch dev2 https://github.com/lllyasviel/stable-diffusion-webui-forge.git stable-diffusion-webui
②CheckpointとVAEのインストール(好きなものを入れてください)
# ChromaXL
!cd /tmp/stable-diffusion-webui/models/Stable-diffusion && \
wget -nc https://huggingface.co/zzzAI19/ChromaXL/resolve/main/ChromaXL_v1b.safetensors?download=true -O ChromaXL_v1b.safetensors
# Emi2
!cd /tmp/stable-diffusion-webui/models/Stable-diffusion && \
wget -nc https://huggingface.co/aipicasso/emi-2/resolve/main/emi-2.safetensors?download=true -O emi-2.safetensors
# VAE
!cd /tmp/stable-diffusion-webui/models/VAE && \
wget -nc https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors?download=true -O sdxl_vae.safetensors
③Webui起動コマンド
#(2) WebUI起動 dev2
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
!apt update
!apt -y install python3.10 libpython3.10-dev build-essential
!curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
!python3.10 -m pip show pydantic fastapi
!python3.10 -m pip install --upgrade pydantic fastapi
!python3.10 -m pip install torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2+cu121 torchtext==0.16.2 torchdata==0.7.1 xformers==0.0.23.post1 --extra-index-url https://download.pytorch.org/whl/cu121 -U
!python3.10 -m pip install matplotlib ipython insightface -U
!python3.10 -m pip install setuptools==69.5.1 -U
!pip install timm==0.6.7
%cd /tmp/stable-diffusion-webui
!python3.10 launch.py --enable-insecure-extension-access --share --gradio-queue --xformers
④コントロールネットのモデル:一度webuiを立ち上げた後に実行する
# コントロールネットDEPTHfull
!cd /tmp/stable-diffusion-webui/models/ControlNet && \
wget -nc https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_depth_full.safetensors?download=true -O diffusers_xl_depth_full.safetensors
# コントロールネットip-adapter
!cd /tmp/stable-diffusion-webui/models/ControlNet && \
wget -nc https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/ip-adapter_xl.pth?download=true -O ip-adapter_xl.pth
# コントロールネットcannyfull
!cd /tmp/stable-diffusion-webui/models/ControlNet && \
wget -nc https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_canny_full.safetensors?download=true -O diffusers_xl_canny_full.safetensors
⑤zipファイル作成
# outputsディレクトリの保存
!zip -r /notebooks/outputs.zip /tmp/stable-diffusion-webui/output
# deforumのframeinterpolationを行ったファイルの保存
!zip -r /notebooks/outputs.zip /tmp/stable-diffusion-webui/outputs
⑥アップロードしたLoraファイルのコピー(Loraフォルダを作成して、その中にLoraをアップロードしたものをコピーするコマンドです)
!cp -r /notebooks/Lora* /tmp/stable-diffusion-webui/models/Lora
おすすめ(?)拡張機能URL先
①Deforum
https://github.com/deforum-art/sd-forge-deforum
②SDXLの出力エラーを修正する
https://github.com/hako-mikan/sd-webui-prevent-artifact
③Ultimate SD upscale :これは「available」から選択できます。