Different versions of StableDiffusion

there are various sub git repositories for StableDiffusion, for example WebUi, ComfyUi, ...
you will find them here

Installation: Stable Diffusion Web UI by Automatic1111 (+ Deforum Extension)

WebUI: Installation

1. Open a terminal

image.png

2. Run the following commands in terminal in this order:

Download the stable-diffusion-webui repository

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

Change directory and navigate to the Stable Diffusion folder

cd stable-diffusion-webui/models/Stable-diffusion
3. Download a Stable Diffusion Model from KISD Model Zoo

Downloading ONE version is enough to get you started.

Stable Diffusion v-2-1 512x512 (base)

wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/Kpgz0TueJYcjY4t/download -O v2-1_512-ema-pruned.ckpt

Stable Diffusion v-2-1 768x768

wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/m3PhfQtlmYOlEUI/download -O v2-1_768-ema-pruned.ckpt
4. Change access rights of file webui.sh

Return back to home directory 

cd

Change directory and navigate to the stable-diffusion-webui folder

cd stable-diffusion-webui

Run this command to assign execution rights

chmod +x webui.sh

Optional: Install Deforum Extension

5. Run webui.sh
./webui.sh --share
6. In the terminal code, search for the public URL (Running on public URL: https:// xxxxxxx-xxxx-xxxx-.gradio.live) and copy it to your browser
7. If you receive the following error message after trying to generate your first image, in the WebUI go to Settings > Stable Diffusion > & check the box for "Upcast cross attention layer to float" > Apply settings & Reload UI

NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

fehlermeldung-webui.png
8. At end of use: Within the interface, go to File > Hub Control Panel > Stop My Server


Deforum Extention (Animation for SD): Installation

1. Open a terminal & navigate to the stable-diffusion-webui folder
cd stable-diffusion-webui
2. Download the Deforum repository
git clone https://github.com/deforum-art/deforum-for-automatic1111-webui/ extensions/deforum

Tutorial recommendation: Deforum Settings Explained - Part 1 Stable Diffusion Automatic 1111

Tutorial recommendation: Deforum for AUTOMATIC1111 - Stable Diffusion Tutorial - AI Animation Part 2

After Installation: Running Stable Diffusion WebUI

1. Open a terminal & navigate to the stable-diffusion-webui folder
cd stable-diffusion-webui
2. Run webui.sh 
./webui.sh --share
3. In the terminal code, search for the public URL (Running on public URL: https:// xxxxxxx-xxxx-xxxx-.gradio.live) and copy it to your browser
4. At end of use: Within the interface, go to File > Hub Control Panel > Stop My Server

Tutorial recommendation: Stable diffusion tutorial. ULTIMATE guide - everything you need to know!



Please Note: The original version of this book was created by Laura Wagner. This is merely an update of her work!

Installation: ComfyUI

ComfyUI: Installation

1. Open a terminal

image.png

2. Run the following commands in terminal in this order

2.1. Download the ComfyUI repository
git clone https://github.com/comfyanonymous/ComfyUI
2.2. Navigate to the "custom_nodes" folder and download the ComfyUI Manager 
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager

3. Navigate to the ComfyUI with Manager notebook and open it:

Path: ComfyUI/custom_nodes/ComfyUI-Manager/notebooks/comfyui_colab_with_manager.ipynb

4. Make following changes to the notebook:

comfyui-installation-before.jpg

4.1. Disable Google Drive Connection (Set USE_GOOGLE_DRIVE = "False")

Delete:

USE_GOOGLE_DRIVE = True  #@param {type:"boolean"}

Paste: 

USE_GOOGLE_DRIVE = False  #@param {type:"boolean"}

4.2. Change Workspace Location (Set WORKSPACE = '~/ComfyUI')

Delete: 

current_dir = !pwd 
WORKSPACE = f"{current_dir[0]}/ComfyUI"

Paste:

WORKSPACE = '~/ComfyUI'

5. Make sure the code looks like this, save the notebook changes & run the cell

comfyui-installation-after.jpg

6. Uncomment the models you want to install (delete the "#" in front of the lines) & run the cell

comfyui-model-selection.png

7. Run the last cell "ComfyUI with cloudflared" and open ComfyUI in the browser

7.1. In the terminal code, search for the URL to access ComfyUI (https://xxxx-xxxxx-xxxx.trycloudflare.com) and copy it to your browser.

8. At end of use: stop your server (important)!

File > Hub Control Panel > Stop My ServerDeforum Extention (Animation for SD): Installation


Tutorial recommendation: Olivio Sarikas - Learn ComfyUI Playlist (1 - 8)

Installation: Deforum Stable Diffusion

Installation


Installing DSD locally  on a Linux Device

1. clone this repository:

git clone https://github.com/HelixNGC7293/DeforumStableDiffusionLocal.git
Creating the environment

2. in case the environment should be available permanently (yes)

conda config --add envs_dirs /home/jovyan/.conda_envs

3. create environment with conda

conda create --name dsd python=3.8.5 -y

4. initialize bash shell

conda init bash

5. restart shell

source ~/.bashrc

6. activate environment:

conda activate dsd

Downloading models

cd into models folder

cd models

Download model files

wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/QJJm0HoP5JqMYza/download -O sd-v1-4.ckpt
wget --no-check-certificate https://th-koeln.sciebo.de/s/e9GlUImXPvTtJRP/download -O dpt_large-midas-2f21e586.pt
cd ..
cd pretrained

download adaBins

wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/yYEhjskz9yuKotX/download -O AdaBins_nyu.pt
cd ..

 

Making the installations

cd DeforumStableDiffusionLocal
python setup.py


Prompting the Model (Latest Stable Diffusion Weights)

These steps need to be executed in order to activate the environment we installed before

initialize bash shell

conda init bash

restart shell

source ~/.bashrc

then:

conda activate dsd

generate still images:

python run.py --settings "./examples/runSettings_StillImages.txt"

animation:

python run.py --enable_animation_mode --settings "./examples/runSettings_Animation.txt"



installation script

git clone https://github.com/HelixNGC7293/DeforumStableDiffusionLocal.git
conda config --add envs_dirs /home/jovyan/.conda_envs
conda create --name dsd python=3.8.5 -y
cd DeforumStableDiffusionLocal
cd models
wget ##############insert adabins
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/QJJm0HoP5JqMYza/download -O sd-v1-4.ckpt
wget --no-check-certificate https://th-koeln.sciebo.de/s/e9GlUImXPvTtJRP/download -O dpt_large-midas-2f21e586.pt
cd ..
conda init bash
source ~/.bashrc
conda activate dsd
python setup.py

Downloading entire folders

if you want to download an entire folder you need to zip it first:

zip -r example.zip original_folder

Upscaling

For upscaling please refer to the ESRGAN Book

https://github.com/xinntao/Real-ESRGAN

-i INPUTPATH

-o OUTPUTPATH

-n MODEL