Project

General

Profile

Actions

Stable Diffusion Setup

Stable Diffusion <add info here>

Prerequisites

Hardware

  • Modern Linux computer with 20 GB disk space
  • NVidia GPU with >= 4 GB VRAM

CUDA

Installation of NVidia Driver and CUDA is not covered here.

Docker

  1. Ensure Docker prereqs are all installed:
    $ sudo apt update
    $ sudo apt install ca-certificates curl gnupg lsb-release
    
  2. Install GPG key:
    $ 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
    
  3. Add Docker APT repository configuration:
    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
    
  4. Install packages:
    $ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    

NVidia Container Toolkit

  1. 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.
    $ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
        sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
        sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    
  2. Install package:
    $ sudo apt update
    $ sudo apt -y install nvidia-container-toolkit
    
  3. Restart docker:
    $ sudo systemctl restart docker
    

Stable Diffusion Docker Container of WebUI

  1. Go to https://github.com/AbdBarho/stable-diffusion-webui-docker/releases, download the latest source code release (ZIP) under Assets. Unzip it somewhere.
  2. Go to the directory where you unzipped the archive, and run
    sudo docker compose --profile download up --build
    

    this will download 12GB of pretrained models. Wait until it is finished, then
    docker compose --profile auto up --build
    

    More details are available on the project's wiki: https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup
  3. Wait until you see
     Running on local URL:  http://0.0.0.0:7860
     To create a public link, set `share=True` in `launch()`.
    

    Then go to http://localhost:7860/ in any browser.

Install Agent Scheduler Extension

Using the built-in extension list:
  1. Open the Extensions tab
  2. Open the "Install From URL" sub-tab
  3. Paste the repo url: https://github.com/ArtVentureX/sd-webui-agent-scheduler.git
  4. Click "Install"

Naughty Stuff

  1. 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
  2. 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.
  3. 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.
  4. Model Parameters​
    • Go to the 'img2img' tab, and then the 'Inpaint' tab.
    • In the first textarea (positive prompt), enter
      • RAW photo of a nude woman, naked​
    • In the second textarea (negative prompt), enter
      • ((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​
    • 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)​

Miscellaneous

  • Convert PNG files to JPG en masse:
    ls -1 *.png | parallel --eta convert -quality 85 '{}' '{.}.jpg'
    

Updated by almost 2 years ago · 5 revisions