0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Stable Diffusion web UI(AUTOMATIC1111)を試してみた

Last updated at Posted at 2025-09-01

1. はじめに

画像生成が可能なAIであるStable Diffusionをブラウザから利用する際には、Automatic1111、WebUI Forge、ComfyUIなどの選択肢が存在する。今回はStable Diffusion Web UI(AUTOMATIC1111)をIBM Cloud上のVSI for VPC環境で試してみた。

なお、GPUはIBM Cloud: RHEL9 + NVIDIA A100環境にNVIDIA Driverをインストールするを使って構成済みである。
※今回は色々な検証のついでに触ったのでA100を流用しているが、Stable Diffusion web UIを動かすだけならもっとVRAMサイズが小さいGPUで良い。

2. インストール

[vpcuser@syasuda-ollama ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow)
githubに記述されているコンポーネント
[root@syasuda-ollama ~]# dnf install -y wget git python3 gperftools-libs libglvnd-glx
実行には影響なかったけど、途中で"webui.sh: line 258: bc: command not found"のエラーが表示されたので追記したもの。実行する度に表示されるのでインストールしておく
[root@syasuda-ollama ~]# dnf install -y bc
[root@syasuda-ollama ~]# wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh

3. webui.shの実行(デフォルト)

rootユーザーだと実行に失敗する。
[root@syasuda-ollama ~]# bash webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
ERROR: This script must not be launched as root, aborting...
################################################################

一般ユーザーにスイッチしてからwebui.shを起動。初回実行時はモジュールのダウンロードが行われるので時間がかかる。--listenを付けないと"127.0.0.1:7860"でlistenするようになるので、別途SSH Port forwardingなどを使ってアクセスする必要がある。
[root@syasuda-ollama ~]# su - vpcuser
[vpcuser@syasuda-ollama ~]$ bash webui.sh --listen
--listenオプションを付けたため、0.0.0.0:7860でlistenしている。
[vpcuser@syasuda-ollama ~]$ ss -anpt |grep -e State -e 7860
State      Recv-Q Send-Q Local Address:Port   Peer Address:Port Process
LISTEN     0      2048         0.0.0.0:7860        0.0.0.0:*     users:(("python",pid=12376,fd=56))
ユーザー配下に10GB近くモジュールがインストールされている。
[vpcuser@syasuda-ollama ~]$ ls -l
total 16
drwx------. 22 vpcuser vpcuser  4096 Aug 28 04:41 stable-diffusion-webui
-rw-------.  1 vpcuser vpcuser 11221 Aug 28 04:20 webui.sh
[vpcuser@syasuda-ollama ~]$ du -sh stable-diffusion-webui
9.3G	stable-diffusion-webui

4. Stable Diffusion web UIで画像生成した結果

プロンプトにメッセージを入れてGenerateを押せば画面が生成される。色々なパラメーターを変更したり、バッチサイズ(同時に生成する画像の数)を大きくするなどのカスタマイズが可能。
image.png

とはいえ、モデルによって得意・苦手はあるので、プロンプトチューニングだけでは限界があり、実際はアニメ系や実写系など得意なジャンルに応じたモデルをダウンロードして利用すると、より品質の高い画像が生成される。全く同じ指示(Beautiful green-haired girl elf living in the forest, anime style.)で異なるモデルを利用した際の例は以下の通り。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?