Skip to content

Instantly share code, notes, and snippets.

@safa-dayo
Last active July 29, 2023 22:20
Show Gist options
  • Save safa-dayo/a2d79b56c95ff7d044b9dd187582b2e9 to your computer and use it in GitHub Desktop.
Save safa-dayo/a2d79b56c95ff7d044b9dd187582b2e9 to your computer and use it in GitHub Desktop.
Stable Diffusion web UI v1.5系をGoogle Colabで構築するためのコマンド
### Stable Diffusion web UI v.1.5系を起動するためのコマンド ###
# ランタイムの設定: T4・ハイメモリ以上を推奨
#
# 利用モデル:
# SDXL base 1.0
# DreamShaper XL 0.9 Alpha(コメントアウトした状態になっているので、利用する際はコメントを外してください)
#
# 利用する拡張機能: After Detailer
# stable diffusion webuiのリポジトリをクローンして、クローンしたフォルダに移動
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
# ライブラリのバージョンでエラーになるため以下を実施
!pip install torch==2.0.0+cu118 torchdata==0.6.0 torchtext==0.15.1 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
# v1.5.1を利用する
!git checkout tags/v1.5.1
# モデルファイルのダウンロード(SDXL base 1.0)
!wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors --content-disposition --directory-prefix=/content/stable-diffusion-webui/models/Stable-diffusion/
# モデルファイルのダウンロード(DreamShaper XL 0.9 Alpha)
# !wget https://civitai.com/api/download/models/121931 --content-disposition --directory-prefix=/content/stable-diffusion-webui/models/Stable-diffusion/
# After Detailerの導入
!git clone https://github.com/Bing-su/adetailer.git /content/stable-diffusion-webui/extensions/adetailer
# Web UIを実行
!python launch.py --share --xformers --enable-insecure-extension-access --no-half-vae --theme dark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment