StableDiffusion » History » Revision 4
Revision 3 (Anonymous, 02/26/2023 10:06 AM) → Revision 4/5 (Anonymous, 02/26/2023 05:53 PM)
h1. Stable Diffusion Setup Stable Diffusion <add info here> h2. Prerequisites h3. Hardware * Modern Linux computer with 20 GB disk space * NVidia GPU with >= 4 GB VRAM h3. CUDA Installation of NVidia Driver and CUDA is not covered here. h3. Docker # Ensure Docker prereqs are all installed: <pre> $ sudo apt update $ sudo apt install ca-certificates curl gnupg lsb-release </pre> # Install GPG key: <pre> $ sudo mkdir -m 0755 -p /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg </pre> # Add Docker APT repository configuration: <pre> 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 </pre> # Install packages: <pre> $ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin </pre> h3. NVidia Container Toolkit # Install GPG key: <pre> $ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add - </pre> # Setup APT repo: <pre> $ sudo bash -c "curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu22.04/nvidia-docker.list > /etc/apt/sources.list.d/nvidia-docker.list" </pre> # Install package: <pre> $ sudo apt update $ sudo apt -y install nvidia-container-toolkit </pre> # Restart docker: <pre> $ sudo systemctl restart docker </pre> h2. Stable Diffusion Docker Container of WebUI # Go to https://github.com/AbdBarho/stable-diffusion-webui-docker/releases, download the latest source code release (ZIP) under Assets. Unzip it somewhere. # Go to the directory where you unzipped the archive, and run <pre> sudo docker compose --profile download up --build </pre> this will download 12GB of pretrained models. Wait until it is finished, then <pre> docker compose --profile auto up --build </pre> More details are available on the project's wiki: https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup # Wait until you see <pre> Running on local URL: http://0.0.0.0:7860 To create a public link, set `share=True` in `launch()`. </pre> Then go to http://localhost:7860/ in any browser. h2. Naughty Stuff # Download one of the better 'Nudifying' models, ** 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 *** "Pruned Model SafeTensor (1.99 GB)" ** "Config" ** 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@ # Embeddings ** Add the following files in the @data/embeddings@: https://gofile.io/d/az0mmz ** 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. ** Check the Discord link in the 'Additional Tips', ppl post additional embeddings on there. # Loading Model ** In the webui, at the top left, "Stable Diffusion checkpoint", hit the 'Refresh' icon. ** Now you should see the @uberRealisticPornMerge_urpmv12@ model in the list, select it. # Model Parameters ** Go to the 'img2img' tab, and then the 'Inpaint' tab. ** In the first textarea (positive prompt), enter *** <pre>RAW photo of a nude woman, naked</pre> ** In the second textarea (negative prompt), enter *** <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> ** If not otherwise mentioned, leave default, *** Masked content: fill (will just fill in the area without taking in to consideration the original masked 'content', but play around with others too) *** Inpaint area: Only masked *** Sampling method: DPM++ SDE Karras (one of the better methods that takes care of using similar skin colors for masked area, etc) *** 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. *** CFG Scale: 7 - 12 (mostly 7) *** Denoise Strength: 0.75 (default, the lower you set this, the more it will look like the original masked area) h2. Miscellaneous * Convert PNG files to JPG en masse: <pre> ls -1 *.png | parallel --eta convert -quality 85 '{}' '{.}.jpg' </pre>