1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Google Colaboratory Stable Diffusion WebUI インストールメモ

1
Posted at

Google Colaboratory Stable Diffusion WebUI インストールメモ

検索してもインストールできないことが多いので、2023/07中旬の時点で整理。

ライブラリのアップデート

!pip uninstall torch torchvision -y
!pip install torch torchvision
!pip uninstall xformers
!echo y | pip install xformers==0.0.16

ランタイムの再起動

上記インストールが終わった段階で メニュー内の「ランタイム」 → 「ランタイムを再起動」
そのあとで 「ランタイム」 → 「ランタイムのタイプを変更」 を選択後、「ハードウェア アクセラレータ」 のドロップダウンメニューから 「GPU」 を選択。

AI画像生成用のライブラリのインストール

%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 
torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 
--extra-index-url https://download.pytorch.org/whl/cu117

Stable Diffusion WebUI のインストールと起動

!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui

!wget https://civitai.com/api/download/models/11745 -O /content/stable-diffusion-webui/models/Stable-diffusion/Chilloutmix-Ni-pruned-fp32-fix.safetensors

!python launch.py --share --xformers --enable-insecure-extension-access

起動に成功するとこんなログが出る。

Use --skip-version-check commandline argument to disable this check.
=================================================================================
Calculating sha256 for /content/stable-diffusion-webui/models/Stable-diffusion/Chilloutmix-Ni-pruned-fp32-fix.safetensors: preload_extensions_git_metadata for 7 extensions took 0.00s
Running on local URL:  http://127.0.0.1:7860
Running on public URL: https://cd7f518c5243751f45.gradio.live

public URL にアクセスして動作確認

スクリーンショット 2023-07-17 19.32.56.png

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?