Created
June 7, 2024 14:23
-
-
Save regiellis/44989e4446aebea39e724c6204904e74 to your computer and use it in GitHub Desktop.
Invoke Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
# Ensure we're in the correct folder in case user's CWD is somewhere else | |
scriptdir=$(dirname "$0") | |
cd "$scriptdir" | |
. .venv/bin/activate | |
export INVOKEAI_ROOT="$scriptdir" | |
# Stash the CLI args - when we prompt for user input, `$@` is overwritten | |
PARAMS=$@ | |
# This setting allows torch to fall back to CPU for operations that are not supported by MPS on macOS. | |
if [ "$(uname -s)" == "Darwin" ]; then | |
export PYTORCH_ENABLE_MPS_FALLBACK=1 | |
fi | |
invokeai-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Invoke script | |
After=network.target | |
[Service] | |
User=playlogic | |
ExecStart=/mnt/Hub/AI/INVOKEAI/invoke-web.sh # make sure to update this with your path | |
Restart=on-success | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment