2
2

Stable Diffusion web UI ForgeをGoogle Colaboratoryで動かす

Posted at

Qiitaに記事あるやろ!と思ったら意外となかったので書くことにしました。
Stable Diffusion web UI Forge をGoogle Colaboratoryで動かす方法です。(AUTOMATIC1111版ではなく)

AnythingXLも一緒にダウンロードしています。civitaiからダウンロードしているのでAPIKeyが必要です。
あとcivbrowserもインストールできるようにしました。

他は従来とそんなに変わりません。

コード

# --no-download-sd-modelを入れておくといいです
cmd_args = "--share --xformers --no-download-sd-model --theme dark"

# civitai APIkey は https://civitai.com/user/account から確認できます
civitai_api_key = "apikey" #@param {type:"string"}

# civbrowserを使う?
use_sd_webui_civbrowser = False #@param {type: "boolean"}

### -------

!echo "[ StableDiffusionをインストールします... ]"
!git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git
%cd /content/stable-diffusion-webui-forge

!echo "[ AnythingXLをダウンロードします... ]"
!wget -O /content/stable-diffusion-webui-forge/models/Stable-diffusion/anything_xl.safetensors  https://civitai.com/api/download/models/384264?token={civitai_api_key}

if use_sd_webui_civbrowser:
  !echo "[civitai blowserをダウンロードします... ]"
  !git clone https://github.com/SignalFlagZ/sd-webui-civbrowser.git /content/stable-diffusion-webui-forge/extensions/sd-webui-civbrowser

!echo "[ WebUIを実行します... ]"
!python launch.py {cmd_args}

参考

safa-dayo/sd-webui-forge-google-colab-setup.sh

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2