Stable Diffusion : インストール2023/08/11 |
ディープラーニングの Text-to-Image モデルである [Stable Diffusion] のインストールです。 |
|
[1] | |
[2] | |
[3] | その他、必要なパッケージをインストールしておきます。 |
[root@dlp ~]# dnf -y install python3-pip git
|
[4] | 任意のユーザーで [Stable Diffusion] をインストールして起動します。 |
[cent@dlp ~]$ nvidia-smi Fri Aug 11 17:06:23 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.86.10 Driver Version: 535.86.10 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 NVIDIA GeForce GTX 1060 6GB Off | 00000000:05:00.0 Off | N/A | | 0% 53C P5 18W / 120W | 0MiB / 6144MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +---------------------------------------------------------------------------------------+[cent@dlp ~]$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Jun__8_16:49:14_PDT_2022 Cuda compilation tools, release 11.7, V11.7.99 Build cuda_11.7.r11.7/compiler.31442593_0[cent@dlp ~]$ git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui Cloning into 'stable-diffusion-webui'... remote: Enumerating objects: 25475, done. remote: Counting objects: 100% (1028/1028), done. remote: Compressing objects: 100% (518/518), done. remote: Total 25475 (delta 682), reused 787 (delta 499), pack-reused 24447 Receiving objects: 100% (25475/25475), 31.58 MiB | 11.85 MiB/s, done. Resolving deltas: 100% (17802/17802), done.
[cent@dlp ~]$
cd stable-diffusion-webui
# lowvram ⇒ グラフィックカードのメモリー容量が少ない場合はオプション付加 # xformers ⇒ 性能向上用ライブラリを使用する # listen ⇒ 0.0.0.0 をリスンする # - オプション付加しない場合は 127.0.0.1 をリスン [cent@dlp stable-diffusion-webui]$ python3 launch.py --lowvram --xformers --listen Python 3.9.17 (main, Jun 26 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] Version: v1.5.1 Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a Installing torch and torchvision Defaulting to user installation because normal site-packages is not writeable ..... ..... Calculating sha256 for /home/cent/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors: Running on local URL: http://0.0.0.0:7860 To create a public link, set `share=True` in `launch()`. Startup time: 205.3s (launcher: 66.2s, import torch: 3.4s, import gradio: 1.0s, setup paths: 1.6s, other imports: 1.0s, setup codeformer: 0.1s, list SD models: 130.6s, load scripts: 0.6s, create ui: 0.7s, gradio launch: 0.1s). 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa Loading weights [6ce0161689] from /home/cent/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors Creating model from config: /home/cent/stable-diffusion-webui/configs/v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. |
[5] | 起動時に表示されたポート 7860 番へアクセスすると [Stable Diffusion] を利用することができます。 |
[6] | 生成したい画像のテキストを入力して [Generate] ボタンをクリックすると、画像が生成されます。 下例では [sugar glider is flying] を入力 |