Project

General

Profile

StableDiffusion » History » Version 5

Anonymous, 09/18/2024 08:34 PM
updating instructions

1 1
h1. Stable Diffusion Setup
2
3
Stable Diffusion <add info here>
4
5
h2. Prerequisites
6
7
h3. Hardware
8
9
* Modern Linux computer with 20 GB disk space 
10
* NVidia GPU with >= 4 GB VRAM
11
12
h3. CUDA
13
14
Installation of NVidia Driver and CUDA is not covered here.
15
16
h3. Docker
17
18
# Ensure Docker prereqs are all installed:
19
<pre>
20
$ sudo apt update
21
$ sudo apt install ca-certificates curl gnupg lsb-release
22
</pre>
23
# Install GPG key:
24
<pre>
25
$ sudo mkdir -m 0755 -p /etc/apt/keyrings
26
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
27
</pre>
28
# Add Docker APT repository configuration:
29
<pre>
30
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
31
</pre>
32
# Install packages:
33
<pre>
34
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
35
</pre>
36
37
h3. NVidia Container Toolkit
38
39 5
# Install GPG key and setup APT repository. Note if running on Mint you will need to manually change the .list file to use the Ubuntu release codename.
40 1
<pre>
41 5
$ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
42
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
43
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
44
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
45 1
</pre>
46
# Install package:
47
<pre>
48
$ sudo apt update
49
$ sudo apt -y install nvidia-container-toolkit
50
</pre>
51
# Restart docker:
52
<pre>
53
$ sudo systemctl restart docker
54
</pre>
55 2
56
h2. Stable Diffusion Docker Container of WebUI
57
58
# Go to https://github.com/AbdBarho/stable-diffusion-webui-docker/releases, download the latest source code release (ZIP) under Assets.  Unzip it somewhere.
59
# Go to the directory where you unzipped the archive, and run
60
<pre>
61
sudo docker compose --profile download up --build
62
</pre>
63
this will download 12GB of pretrained models. Wait until it is finished, then
64
<pre>
65
docker compose --profile auto up --build
66
</pre>
67
More details are available on the project's wiki: https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup
68 1
# Wait until you see
69
<pre>
70
 Running on local URL:  http://0.0.0.0:7860
71
 To create a public link, set `share=True` in `launch()`.
72
</pre>
73
Then go to http://localhost:7860/ in any browser.
74 5
75
h3. Install Agent Scheduler Extension
76
77
Using the built-in extension list:
78
# Open the Extensions tab
79
# Open the "Install From URL" sub-tab
80
# Paste the repo url: https://github.com/ArtVentureX/sd-webui-agent-scheduler.git
81
# Click "Install"
82 2
83
h2. Naughty Stuff
84
85
# Download one of the better 'Nudifying' models,
86 3
** Go to https://civitai.com/models/2661/uber-realistic-porn-merge-urpm (account required) and under Versions, click on 'URPMv1.2-inpainting', then at the right, download
87
*** "Pruned Model SafeTensor (1.99 GB)"
88 2
** "Config"
89 3
** Save them to the @data/StableDiffusion@ folder in the Webui docker project you unzipped earlier. The model file should be called @uberRealisticPornMerge_urpmv12-inpainting.safetensors@ and the config file should be named @uberRealisticPornMerge_urpmv12-inpainting.yaml@
90
# Embeddings​
91
** Add the following files in the @data/embeddings@: https://gofile.io/d/az0mmz
92
** These allow you to add @breasts@, @small_tits@ and @Style-Unshaved@ in your prompt, and provide better quality breasts / vaginas. The first one is more generalized, the latter is well.. yes.
93
** Check the Discord link in the 'Additional Tips', ppl post additional embeddings on there.
94
# Loading Model​
95
** In the webui, at the top left, "Stable Diffusion checkpoint", hit the 'Refresh' icon.
96
** Now you should see the @uberRealisticPornMerge_urpmv12@ model in the list, select it.
97
# Model Parameters​
98
** Go to the 'img2img' tab, and then the 'Inpaint' tab.
99
** In the first textarea (positive prompt), enter
100
*** <pre>RAW photo of a nude woman, naked​</pre>
101
** In the second textarea (negative prompt), enter
102
*** <pre>((clothing), (monochrome:1.3), (deformed, distorted, disfigured:1.3), (hair), jeans, tattoo, wet, water, clothing, shadow, 3d render, cartoon, ((blurry)), duplicate, ((duplicate body parts)), (disfigured), (poorly drawn), ((missing limbs)), logo, signature, text, words, low res, boring, artifacts, bad art, gross, ugly, poor quality, low quality, poorly drawn, bad anatomy, wrong anatomy​</pre>
103
** If not otherwise mentioned, leave default,
104
*** Masked content: fill (will just fill in the area without taking in to consideration the original masked 'content', but play around with others too)​
105
*​** Inpaint area: Only masked​
106
*** Sampling method: DPM++ SDE Karras (one of the better methods that takes care of using similar skin colors for masked area, etc)​
107
​*** Sampling steps: start with 20, then increase to 50 for better quality/results when needed. But the higher, the longer it takes. I have mostly good results with 20, but it all depends on the complexity of the source image and the masked area.​
108
​*** CFG Scale: 7 - 12 (mostly 7)​
109
​*** Denoise Strength: 0.75 (default, the lower you set this, the more it will look like the original masked area)​
110 2
111 4
112
h2. Miscellaneous
113
114
* Convert PNG files to JPG en masse:
115
<pre>
116
ls -1 *.png | parallel --eta convert -quality 85 '{}' '{.}.jpg'
117
</pre>