Skip to content

Instantly share code, notes, and snippets.

@nikneroz
Created August 31, 2023 11:16
Show Gist options
  • Save nikneroz/b49731543c8c79423bd4421ede4215cf to your computer and use it in GitHub Desktop.
Save nikneroz/b49731543c8c79423bd4421ede4215cf to your computer and use it in GitHub Desktop.
Stable Diffusion launchctl
nvim ~/Library/LaunchAgents/com.stable_diffusion_webui.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.stable_diffusion_webui</string>
    <key>EnvironmentVariables</key>
    <dict>
      <key>SCRIPT_DIR</key>
      <string>/Users/rozenkin/Projects/stable-diffusion-webui</string>
    </dict>
    <key>WorkingDirectory</key>
    <string>/Users/rozenkin/Projects/stable-diffusion-webui</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>/Users/rozenkin/Projects/stable-diffusion-webui/webui.sh</string>
        <string>--listen</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/Users/rozenkin/Projects/stable-diffusion-webui/logs/out.log</string>
    <key>StandardErrorPath</key>
    <string>/Users/rozenkin/Projects/stable-diffusion-webui/logs/error.log</string>
</dict>
</plist>
launchctl start ~/Library/LaunchAgents/com.stable_diffusion_webui.plist
launchctl load ~/Library/LaunchAgents/com.stable_diffusion_webui.plist
launchctl unload ~/Library/LaunchAgents/com.stable_diffusion_webui.plist
tail -f /Users/rozenkin/Projects/stable-diffusion-webui/logs/error.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment