From 8859c10ee1823715a8bb82f840877b102ad18010 Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 31 Dec 2023 13:39:59 +0100 Subject: [PATCH 1/9] Change config file new config file : config.yaml --- 01.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01.sh b/01.sh index 244d4a8..246f991 100755 --- a/01.sh +++ b/01.sh @@ -25,7 +25,7 @@ sl_folder ${SD01_DIR}/models gfpgan ${BASE_DIR}/models gfpgan sl_folder ${HOME} "Stable Diffusion UI" ${BASE_DIR}/outputs 01-Easy-Diffusion if [ ! -f "$SD01_DIR/scripts/config.json" ]; then - cp -v "${SD_INSTALL_DIR}/parameters/01.txt" "$SD01_DIR/scripts/config.json" + cp -v "${SD_INSTALL_DIR}/parameters/01.txt" "$SD01_DIR/config.yaml" fi if [ ! -f "$SD01_DIR/start.sh" ]; then From 7808d2f4cdafc3c1901f7aaadeb5d9aa7ae56b8d Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 31 Dec 2023 13:41:02 +0100 Subject: [PATCH 2/9] Update 01.txt update parameters.txt to the new config file --- parameters/01.txt | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/parameters/01.txt b/parameters/01.txt index c9e0d55..2839d6f 100644 --- a/parameters/01.txt +++ b/parameters/01.txt @@ -1 +1,22 @@ -{"render_devices": "auto", "update_branch": "main", "net": {"listen_port": 9000, "listen_to_network": true}} +# Change listen_port if port 9000 is already in use on your system +# Set listen_to_network to true to make Easy Diffusion accessibble on your local network +net: + listen_port: 9000 + listen_to_network: true +render_devices: auto + +# Set open_browser_on_start to false to disable opening a new browser tab on each restart +ui: + open_browser_on_start: false + +# set update_branch to main to use the stable version, or to beta to use the experimental +# beta version. +update_branch: main + +# Set force_save_path to enforce an auto save path. Clients will not be able to change or +# disable auto save when this option is set. Please adapt the path in the examples to your +# needs. +# Windows: +# force_save_path: C:\\Easy Diffusion Images\\ +# Linux: +force_save_path: /config/outputs/01-Easy-Diffusion From aefe5706db6299c103ae2829a860fb30df918cda Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sat, 20 Jan 2024 22:49:46 +0100 Subject: [PATCH 3/9] allow custom script --- entry.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entry.sh b/entry.sh index 89f1b34..5a04a14 100644 --- a/entry.sh +++ b/entry.sh @@ -37,6 +37,10 @@ case $WEBUI_VERSION in 70) . /70.sh ;; + custom) + . /config/custom.sh + ;; + *) echo error in webui selection variable ;; From 541028961a640a155e865654c0d6d10232686bff Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 11:47:35 +0100 Subject: [PATCH 4/9] test custom script --- custom-example.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 custom-example.sh diff --git a/custom-example.sh b/custom-example.sh new file mode 100644 index 0000000..5447208 --- /dev/null +++ b/custom-example.sh @@ -0,0 +1,59 @@ +#!/bin/bash +source /sl_folder.sh + +export PATH="/home/abc/miniconda3/bin:$PATH" + +# Set Variables and parameters + +# Name of the custom WebUI (will be used for the program itself and the output directory) +export CustomNAME="FooocusMRE" + +# Name of the base folder for custom WebUIs +export CustomBASE="00-custom" + +# Complete Path for the program files +export CustomPATH="/config/$CustomBASE/$CustomNAME" + +# Parameters to pass at launch +export CustomPARAMETERS="--listen 0.0.0.0 --port 9000" + + +# Folders creation (Program files and output) +mkdir -p ${CustomPATH} +mkdir -p /config/outputs/$CustomBASE/$CustomNAME + + +# Creation and Activation on the Conda Virtual Env +if [ ! -d ${CustomPATH}/env ]; then + conda create -p ${CustomPATH}/env -y +fi +source activate ${CustomPATH}/env +conda install -n base conda-libmamba-solver -y +conda install -c conda-forge git python=3.10 pip --solver=libmamba -y +conda install -c nvidia cuda-cudart --solver=libmamba -y + +# Clone/update program files +if [ ! -d ${CustomPATH}/Fooocus-MRE ]; then + cd "${CustomPATH}" && git clone https://github.com/MoonRide303/Fooocus-MRE.git +fi +cd ${CustomPATH}/Fooocus-MRE +git pull -X ours + +# Using the sl_folder to create symlinks needed to use the common models folder +sl_folder ${CustomPATH}/Fooocus-MRE/models checkpoints ${BASE_DIR}/models stable-diffusion +sl_folder ${CustomPATH}/Fooocus-MRE/models loras ${BASE_DIR}/models lora +sl_folder ${CustomPATH}/Fooocus-MRE/models vae ${BASE_DIR}/models vae +sl_folder ${CustomPATH}/Fooocus-MRE/models embeddings ${BASE_DIR}/models embeddings +sl_folder ${CustomPATH}/Fooocus-MRE/models hypernetworks ${BASE_DIR}/models hypernetwork +sl_folder ${CustomPATH}/Fooocus-MRE/models upscale_models ${BASE_DIR}/models upscale +sl_folder ${CustomPATH}/Fooocus-MRE/models clip_vision ${BASE_DIR}/models clip_vision +sl_folder ${CustomPATH}/Fooocus-MRE/models controlnet ${BASE_DIR}/models controlnet + +sl_folder ${CustomPATH}/Fooocus-MRE outputs ${BASE_DIR}/outputs/$CustomBASE $CustomNAME + +# installation of requirements +cd ${CustomPATH}/Fooocus-MRE +pip install -r requirements_versions.txt + +# Launch Fooocus-MRE +python launch.py ${CustomPARAMETERS} From da1f9f45ce46e0d6a4ef805d1afaa09817e8e7fd Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:35:55 +0100 Subject: [PATCH 5/9] custom script modifications+ fooocus fix (hopefully) --- 06.sh | 2 +- custom-example.sh => custom-sample.sh | 6 ++---- entry.sh | 9 ++++++++- parameters/06.txt | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) rename custom-example.sh => custom-sample.sh (95%) diff --git a/06.sh b/06.sh index 5206a15..efc1b8b 100755 --- a/06.sh +++ b/06.sh @@ -4,7 +4,7 @@ source /sl_folder.sh export PATH="/home/abc/miniconda3/bin:$PATH" mkdir -p ${SD06_DIR} -mkdir -p /config/outputs/06-Fooocus +mkdir -p $BASE_DIR/outputs/06-Fooocus if [ ! -d ${SD06_DIR}/env ]; then conda create -p ${SD06_DIR}/env -y diff --git a/custom-example.sh b/custom-sample.sh similarity index 95% rename from custom-example.sh rename to custom-sample.sh index 5447208..589f425 100644 --- a/custom-example.sh +++ b/custom-sample.sh @@ -17,11 +17,9 @@ export CustomPATH="/config/$CustomBASE/$CustomNAME" # Parameters to pass at launch export CustomPARAMETERS="--listen 0.0.0.0 --port 9000" - # Folders creation (Program files and output) mkdir -p ${CustomPATH} -mkdir -p /config/outputs/$CustomBASE/$CustomNAME - +mkdir -p $BASE_DIR/outputs/$CustomBASE/$CustomNAME # Creation and Activation on the Conda Virtual Env if [ ! -d ${CustomPATH}/env ]; then @@ -56,4 +54,4 @@ cd ${CustomPATH}/Fooocus-MRE pip install -r requirements_versions.txt # Launch Fooocus-MRE -python launch.py ${CustomPARAMETERS} +python launch.py ${CustomPARAMETERS} \ No newline at end of file diff --git a/entry.sh b/entry.sh index 5a04a14..d6d2107 100644 --- a/entry.sh +++ b/entry.sh @@ -1,5 +1,12 @@ #!/bin/bash +# Copy sample custom script in user folder if it doesn't exists + +if [ ! -f "$BASE_DIR/scripts/custom-sample.sh" ]; then + mkdir -p $BASE_DIR/scripts + cp -v "/custom-example.sh" "$BASE_DIR/scripts/custom-sample.sh" +fi + case $WEBUI_VERSION in 01) . /01.sh @@ -38,7 +45,7 @@ case $WEBUI_VERSION in . /70.sh ;; custom) - . /config/custom.sh + . $BASE_DIR/scripts/custom.sh ;; *) diff --git a/parameters/06.txt b/parameters/06.txt index 15b8c43..937aaac 100644 --- a/parameters/06.txt +++ b/parameters/06.txt @@ -3,6 +3,7 @@ --port 9000 # Directories +--output-path ${BASE_DIR}/outputs/06-Fooocus # Options #--help From ce85a3fb6794382317fbde50ea5afa568c5441e8 Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:46:10 +0100 Subject: [PATCH 6/9] fix sample filename --- entry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry.sh b/entry.sh index d6d2107..3d48311 100644 --- a/entry.sh +++ b/entry.sh @@ -4,7 +4,7 @@ if [ ! -f "$BASE_DIR/scripts/custom-sample.sh" ]; then mkdir -p $BASE_DIR/scripts - cp -v "/custom-example.sh" "$BASE_DIR/scripts/custom-sample.sh" + cp -v "/custom-sample.sh" "$BASE_DIR/scripts/custom-sample.sh" fi case $WEBUI_VERSION in From d77c17a58b6e368ef43f9099943dbe8e2f321679 Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:51:48 +0100 Subject: [PATCH 7/9] easier custom script selection --- entry.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/entry.sh b/entry.sh index 3d48311..7ca8c00 100644 --- a/entry.sh +++ b/entry.sh @@ -44,11 +44,8 @@ case $WEBUI_VERSION in 70) . /70.sh ;; - custom) - . $BASE_DIR/scripts/custom.sh - ;; - *) + . $BASE_DIR/scripts/$WEBUI_VERSION echo error in webui selection variable ;; esac From ae7ad5111dae33f443c0252e545fbc3cc102ec63 Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 15:34:53 +0100 Subject: [PATCH 8/9] remove fooocus output path in parameters file --- parameters/06.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/parameters/06.txt b/parameters/06.txt index 937aaac..15b8c43 100644 --- a/parameters/06.txt +++ b/parameters/06.txt @@ -3,7 +3,6 @@ --port 9000 # Directories ---output-path ${BASE_DIR}/outputs/06-Fooocus # Options #--help From 65d043cca74d3ebea869e81d48826ae72739891e Mon Sep 17 00:00:00 2001 From: Holaf <32452391+grokuku@users.noreply.github.com> Date: Sun, 21 Jan 2024 17:31:58 +0100 Subject: [PATCH 9/9] fix Easy-Diffusion settings + update install to version 3.0.2 --- 01.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01.sh b/01.sh index 246f991..32f83a6 100755 --- a/01.sh +++ b/01.sh @@ -24,12 +24,12 @@ sl_folder ${SD01_DIR}/models gfpgan ${BASE_DIR}/models gfpgan sl_folder ${HOME} "Stable Diffusion UI" ${BASE_DIR}/outputs 01-Easy-Diffusion -if [ ! -f "$SD01_DIR/scripts/config.json" ]; then +if [ ! -f "$SD01_DIR/config.yaml" ]; then cp -v "${SD_INSTALL_DIR}/parameters/01.txt" "$SD01_DIR/config.yaml" fi if [ ! -f "$SD01_DIR/start.sh" ]; then - curl -L https://github.com/easydiffusion/easydiffusion/releases/download/v2.5.41a/Easy-Diffusion-Linux.zip --output edui.zip + curl -L https://github.com/easydiffusion/easydiffusion/releases/download/v3.0.2/Easy-Diffusion-Linux.zip --output edui.zip unzip edui.zip cp -rf easy-diffusion/* . rm -rf easy-diffusion