From 2eac054623f8ec0b47f01f9a7be2a2014b2cf529 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Mon, 19 Aug 2024 18:34:52 +0200 Subject: [PATCH] add stablediffusion-forge --- stablediffusion-forge-rocm/.gitignore | 4 +++ stablediffusion-forge-rocm/install.sh | 40 +++++++++++++++++++++++++++ stablediffusion-forge-rocm/run.sh | 18 ++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 stablediffusion-forge-rocm/.gitignore create mode 100755 stablediffusion-forge-rocm/install.sh create mode 100755 stablediffusion-forge-rocm/run.sh diff --git a/stablediffusion-forge-rocm/.gitignore b/stablediffusion-forge-rocm/.gitignore new file mode 100644 index 0000000..4c452cd --- /dev/null +++ b/stablediffusion-forge-rocm/.gitignore @@ -0,0 +1,4 @@ +venv/ +webui/ +models/ +outputs/ \ No newline at end of file diff --git a/stablediffusion-forge-rocm/install.sh b/stablediffusion-forge-rocm/install.sh new file mode 100755 index 0000000..bd764b9 --- /dev/null +++ b/stablediffusion-forge-rocm/install.sh @@ -0,0 +1,40 @@ +#!/bin/bash +source ../utils.sh +python_exec=venv/bin/python3.10 + +# Function to install/update StableDiffusion +install_stablediffusionforge() { + if [ -d "webui" ]; then + echo "StableDiffusionForge repository already exists." + yes_or_no "Do you want to update StableDiffusionForge WebUI ?" && { + cd webui + git pull + echo "StableDiffusionForge WebUI successfully updated." + } + else + echo "Cloning StableDiffusionForge repository..." + git clone https://github.com/lllyasviel/stable-diffusion-webui-forge webui + + echo "Running StableDiffusionForge setup..." + $python_exec webui/launch.py --skip-torch-cuda-test --exit + + ln -s webui/models models + ln -s webui/outputs outputs + fi + +} + +# Main function +main() { + prepare_env + + # Install StableDiffusionForge + install_stablediffusionforge + + clean + + echo "StableDiffusion installation/update complete. Use ./run.sh to start" +} + +# Run main function +main diff --git a/stablediffusion-forge-rocm/run.sh b/stablediffusion-forge-rocm/run.sh new file mode 100755 index 0000000..95fbe39 --- /dev/null +++ b/stablediffusion-forge-rocm/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source ../utils.sh +python_exec=venv/bin/python3.10 + +# Main function +main() { + # Create virtual environment + use_venv + + # Prints ROCM info with available GPUs + rocm-smi + + # Start SD + TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec webui/launch.py --listen --enable-insecure-extension-access # --opt-split-attention + +} + +main