はじめに

StableDiffusionを使ったことがなかったため使ってみる。

環境

1
Docker Desktop 4.33.1 (161083)

構築

Gitクローン

1
git clone https://github.com/AbdBarho/stable-diffusion-webui-docker.git
1
2
3
4
5
6
7
8
kbushi@kbushi:~/workspace/ai$ git clone https://github.com/AbdBarho/stable-diffusion-webui-docker.git
Cloning into 'stable-diffusion-webui-docker'...
remote: Enumerating objects: 1632, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 1632 (delta 0), reused 4 (delta 0), pack-reused 1624
Receiving objects: 100% (1632/1632), 330.25 KiB | 19.43 MiB/s, done.
Resolving deltas: 100% (851/851), done.

イメージからビルドする

wikiを参考に構築する。
https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup

1
2
3
cd stable-diffusion-webui-docker

docker compose --profile download up --build
ログ
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
download-1  | Status Legend:
download-1  | (OK):download completed.
download-1  | Checking SHAs...
download-1  | /data/models/LDSR/project.yaml: OK
download-1  | /data/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth: OK
download-1  | /data/models/RealESRGAN/RealESRGAN_x4plus.pth: OK
download-1  | /data/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt: OK
download-1  | /data/models/GFPGAN/GFPGANv1.4.pth: OK
download-1  | /data/models/LDSR/model.ckpt: OK
download-1  | /data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt: OK
download-1  | /data/models/Stable-diffusion/sd-v1-5-inpainting.ckpt: OK
download-1  | By using this software, you agree to the following licenses:
download-1  | https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/LICENSE
download-1  | https://github.com/CompVis/stable-diffusion/blob/main/LICENSE
download-1  | https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/LICENSE.txt
download-1  | https://github.com/invoke-ai/InvokeAI/blob/main/LICENSE
download-1  | And licenses of all UIs, third party libraries, and extensions.
download-1 exited with code 0

ダウンロードが完了したら下記を実行する。

1
docker compose --profile auto up --build

※実行するUIはとりあえず autoにした。

これで完了

試す

http://localhost:7860/ で アプリを起動する。

startup-01

プロンプト

適当に下記で作成をしてみる。

1
sunny, cloud

できた画像↓
output

参考

おわりに

試しにローカルで動かしてみた。
デスクトップの背景画像に使えそうなものを生成してみようかな。