diff --git a/01.sh b/01.sh index 244d4a8..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 - cp -v "${SD_INSTALL_DIR}/parameters/01.txt" "$SD01_DIR/scripts/config.json" +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 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-sample.sh b/custom-sample.sh new file mode 100644 index 0000000..589f425 --- /dev/null +++ b/custom-sample.sh @@ -0,0 +1,57 @@ +#!/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 $BASE_DIR/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} \ No newline at end of file diff --git a/entry.sh b/entry.sh index 89f1b34..7ca8c00 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-sample.sh" "$BASE_DIR/scripts/custom-sample.sh" +fi + case $WEBUI_VERSION in 01) . /01.sh @@ -38,6 +45,7 @@ case $WEBUI_VERSION in . /70.sh ;; *) + . $BASE_DIR/scripts/$WEBUI_VERSION echo error in webui selection variable ;; esac 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