add update function to stablediff
This commit is contained in:
parent
2471c3de53
commit
5b8cd23b85
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.idea/
|
2
stablediffusion-rocm/.gitignore
vendored
2
stablediffusion-rocm/.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
venv/
|
||||
webui/
|
||||
models/
|
||||
outputs/
|
@ -2,16 +2,26 @@
|
||||
source ../utils.sh
|
||||
python_exec=venv/bin/python3.10
|
||||
|
||||
# Function to install StableDiffusion
|
||||
# Function to install/update StableDiffusion
|
||||
install_stablediffusion() {
|
||||
if [ -d "webui" ]; then
|
||||
echo "StableDiffusion repository already exists. Skipping clone."
|
||||
echo "StableDiffusion repository already exists."
|
||||
yes_or_no "Do you want to update StableDiffusion WebUI (dev branch) ?" && {
|
||||
cd webui
|
||||
git pull
|
||||
echo "StableDiffusion WebUI successfully updated."
|
||||
}
|
||||
else
|
||||
echo "Cloning StableDiffusion repository..."
|
||||
git clone -b dev https://github.com/AUTOMATIC1111/stable-diffusion-webui webui
|
||||
|
||||
echo "Running StableDiffusion setup..."
|
||||
$python_exec webui/launch.py --skip-torch-cuda-test --exit
|
||||
|
||||
ln -s webui/models models
|
||||
ln -s webui/outputs outputs
|
||||
fi
|
||||
echo "Running StableDiffusion setup..."
|
||||
$python_exec webui/launch.py --skip-torch-cuda-test --exit
|
||||
|
||||
}
|
||||
|
||||
# Main function
|
||||
@ -23,7 +33,7 @@ main() {
|
||||
|
||||
clean
|
||||
|
||||
echo "StableDiffusion installation complete."
|
||||
echo "StableDiffusion installation/update complete. Use ./run.sh to start"
|
||||
}
|
||||
|
||||
# Run main function
|
||||
|
21
utils.sh
21
utils.sh
@ -27,17 +27,20 @@ use_venv() {
|
||||
# Function to install build-essential or equivalent
|
||||
install_build_essentials() {
|
||||
echo "Checking for build essentials..."
|
||||
|
||||
if [ -f /etc/debian_version ]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential python3.10-dev
|
||||
|
||||
elif [ -f /etc/fedora-release ]; then
|
||||
if dnf list installed @development-tools &>/dev/null; then
|
||||
echo "Development Tools are already installed."
|
||||
if rpm -q gcc &>/dev/null && rpm -q python3.10-devel &>/dev/null; then
|
||||
echo "Development Tools and Python 3.10 development files are already installed."
|
||||
else
|
||||
echo "Installing Development Tools..."
|
||||
echo "Installing Development Tools and Python 3.10 development files..."
|
||||
sudo dnf groupinstall -y "Development Tools"
|
||||
sudo dnf install python3.10-devel
|
||||
sudo dnf install -y python3.10-devel
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Unsupported operating system. Please install build-essential or equivalent manually."
|
||||
exit 1
|
||||
@ -68,4 +71,14 @@ prepare_env(){
|
||||
|
||||
clean() {
|
||||
python3.10 -m pip cache purge
|
||||
}
|
||||
|
||||
yes_or_no() {
|
||||
while true; do
|
||||
read -p "$* [y/n]: " yn
|
||||
case $yn in
|
||||
[Yy]*) return 0 ;;
|
||||
[Nn]*) echo "Aborted" ; return 1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
Loading…
Reference in New Issue
Block a user