Ubuntu 22.04
Sponsored Link

Stable Diffusion : Install2023/08/11

 

Install [Stable Diffusion] that is the Text-to-Image model of deep learning.

[1]

Install NVIDIA Graphic Driver for your Graphic Card, refer to here.

[2]

Install CUDA, refer to here.

[3] Install other required packages.
root@dlp:~#
apt -y install python3-pip python3-venv python3-packaging git
[4] Install and run [Stable Diffusion] with any user.
ubuntu@dlp:~$
nvidia-smi

Fri Aug 11 02:12:24 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.03              Driver Version: 535.54.03    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%   49C    P5               8W / 120W |      0MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

ubuntu@dlp:~$
nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

ubuntu@dlp:~$
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

Cloning into 'stable-diffusion-webui'...
remote: Enumerating objects: 25448, done.
remote: Counting objects: 100% (1001/1001), done.
remote: Compressing objects: 100% (504/504), done.
remote: Total 25448 (delta 666), reused 763 (delta 488), pack-reused 24447
Receiving objects: 100% (25448/25448), 31.60 MiB | 16.45 MiB/s, done.
Resolving deltas: 100% (17786/17786), done.

ubuntu@dlp:~$
cd stable-diffusion-webui
# lowvram ⇒ add it if your Graphic Card has few amount of memory
# xformers ⇒ use library for performance improvement
# listen ⇒ listen on 0.0.0.0
# - if not specify the option, listen on 127.0.0.1

ubuntu@dlp:~/stable-diffusion-webui$
python3 launch.py --lowvram --xformers --listen

Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Installing xformers

.....
.....

Calculating sha256 for /home/ubuntu/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: 12.1s (launcher: 3.0s, import torch: 3.3s, import gradio: 1.0s, setup paths: 1.7s, other imports: 1.2s, load scripts: 0.5s, create ui: 1.1s, gradio launch: 0.2s).
DiffusionWrapper has 859.52 M params.
Applying attention optimization: xformers... done.
Model loaded in 5.1s (load weights from disk: 0.6s, create model: 1.2s, apply weights to model: 2.6s, apply half(): 0.4s, calculate empty prompt: 0.2s).
[5] Access to the port 7860 that was shown on your command line, then you can use [Stable Diffusion].
[6] Input any text and click [Generate] button, then image will be generated.
The example below is [cat wearing a hat].
Matched Content