Skip to content

Instantly share code, notes, and snippets.

@adde88
Last active January 12, 2024 18:58
Show Gist options
  • Save adde88/0fb1622943af4f53c506691f558410dd to your computer and use it in GitHub Desktop.
Save adde88/0fb1622943af4f53c506691f558410dd to your computer and use it in GitHub Desktop.
Stable Diffusion: Systemd service-file (Debian Linux), to automatically start at boot
# Script to run Stable Diffusion at launch using systemd
# Modify script, like directories and username as needed
# File should then be located here: /usr/lib/systemd/system/stable-diffusion.service
# Then run "sudo systemctl enable stable-diffusion"
# "sudo systemctl start stable-diffusion"
#
# Written by Andreas Nilsen - <adde88@gmail.com>
#
#
[Unit]
Description=Stable Diffusion AUTOMATIC1111 Web UI Service
After=network.target auditd.service
StartLimitIntervalSec=30
StartLimitBurst=2
[Service]
Type=simple
Restart=always
RestartSec=2
User=andreas
Group=andreas
ExecStart=/bin/bash /home/andreas/stable-diffusion/webui.sh
WorkingDirectory=/home/andreas/stable-diffusion
StandardOutput=append:/var/log/stable-diffusion/sdwebui.log
StandardError=append:/var/log/stable-diffusion/sdwebui.log
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment