An open API service indexing awesome lists of open source software.

https://github.com/bradsec/sdnotes

Stable Diffusion notes and guides for running in a Linux environment
https://github.com/bradsec/sdnotes

automatic1111 comfyui debian linux stable-diffusion stable-diffusion-webui

Last synced: about 1 year ago
JSON representation

Stable Diffusion notes and guides for running in a Linux environment

Awesome Lists containing this project

README

          

# Stable Diffusion Notes

***These instructions contain Linux shell scripts, (not suitable for Windows)***

## Running Automatic1111 and ComfyUI together sharing Python environment and models

### How to use Automatic1111 Python virtual environment (venv) and requirements with ComfyUI.

Create a shell script in the ComfyUI root directory to activate Automatic1111 venv

Example of `/ComfyUI/start.sh` script
```terminal
#!/bin/sh

# Modify paths as required.
PYTHON_ENV=/home/username/stable-diffusion-webui/venv/bin
COMFYUI_PATH=/home/username/ComfyUI

cd $COMFYUI_PATH
# Update ComfyUI to latest source release
git pull

# Activate venv#!/bin/sh

PYTHON_ENV=/home/username/stable-diffusion-webui/venv/bin
COMFYUI_PATH=/home/username/ComfyUI

cd $COMFYUI_PATH
git pull

. $PYTHON_ENV/activate
python3 $COMFYUI_PATH/main.py --listen

. $PYTHON_ENV/activate

# Lauch comfyui --listen makes network accessable
python3 $COMFYUI_PATH/main.py --listen
```

### How to use existing Automatic1111 models in ComfyUI

Edit `extra_model_paths.yaml` located in the ComfyUI root folder.

Example of extra_model_paths.yaml contents:
```terminal
a111:
base_path: /home/username/stable-diffusion-webui/

checkpoints: models/Stable-diffusion
configs: models/Stable-diffusion
vae: models/VAE
loras: |
models/Lora
models/LyCORIS
upscale_models: |
models/ESRGAN
models/RealESRGAN
models/SwinIR
embeddings: embeddings
hypernetworks: models/hypernetworks
controlnet: models/ControlNet
```

### How to run Automatic1111 and ComfyUI as a linux systemd service

Below is a shell script to create services for both Automatic1111 and ComfyUI.

**Make sure to make changes to `username` and also paths to application locations in the Service One and Service Two section**

```terminal
#!/bin/sh

############################################
# Debian Linux configure as service script #
############################################

# Function for creating new systemd service
write_service_config() {
# Check if the service already exists
echo "Checking for existing ${service_name} service..."
if systemctl --quiet is-enabled ${service_name} 2>/dev/null
then
echo "Service ${service_name} already exists. Skipping..."
return
fi
echo "Creating service for ${service_name}..."
sudo touch "/var/log/${service_name}.log"
sudo tee "/etc/systemd/system/${service_name}.service" 1>/dev/null <