From 2dee638550da45f40355a90970202da6bf965816 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 28 Dec 2023 10:55:13 -0500 Subject: [PATCH 01/17] fix: Re-add memory leak fix Looks like this was lost in a merge at some point grokuku/stable-diffusion#2 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1a5b8e8..b55402a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,8 @@ RUN apt-get update -y -q=2 && \ python3-opencv \ libopencv-dev \ dotnet-sdk-7.0 \ - git && \ + git \ + libgoogle-perftools-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* From ead42adf3530b6da2e556564d811263f86e3d8a6 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 28 Dec 2023 11:04:04 -0500 Subject: [PATCH 02/17] fix(sdnext): Fix embeddings source location embeddings folder differs compared to stable-diffusion-webui -- in sd.next it is located in models/embeddings instead of top level https://github.com/vladmandic/automatic/blob/439542d3df3d2d6cefbe2360966a6566bc1de341/modules/shared.py#L385 --- 04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04.sh b/04.sh index 5ef7d4f..931347e 100755 --- a/04.sh +++ b/04.sh @@ -71,7 +71,7 @@ sl_folder ${SD04_DIR}/webui/models Stable-diffusion ${BASE_DIR}/models stable-di sl_folder ${SD04_DIR}/webui/models hypernetworks ${BASE_DIR}/models hypernetwork sl_folder ${SD04_DIR}/webui/models Lora ${BASE_DIR}/models lora sl_folder ${SD04_DIR}/webui/models VAE ${BASE_DIR}/models vae -sl_folder ${SD04_DIR}/webui embeddings ${BASE_DIR}/models embeddings +sl_folder ${SD04_DIR}/webui/models embeddings ${BASE_DIR}/models embeddings sl_folder ${SD04_DIR}/webui/models ESRGAN ${BASE_DIR}/models upscale sl_folder ${SD04_DIR}/webui/models Codeformer ${BASE_DIR}/models codeformer sl_folder ${SD04_DIR}/webui/models GFPGAN ${BASE_DIR}/models gfpgan From 829a8815b61c240b00278ecae445f5c810df7682 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 28 Dec 2023 11:13:39 -0500 Subject: [PATCH 03/17] refactor: Make folder symlinking safer --- sl_folder.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sl_folder.sh b/sl_folder.sh index aea952c..ea97f74 100644 --- a/sl_folder.sh +++ b/sl_folder.sh @@ -12,10 +12,14 @@ sl_folder() { rm -rf "${1}/${2}" fi + # always remove previous symlink + # b/c if user changed target locations current symlink will be incorrect if [ -L "${1}/${2}" ]; then - rm -rf "${1}/${2}" + rm "${1}/${2}" + fi + # create symlink + ln -s "${3}/${4}/" "${1}" + if [ ! -L "${1}/${2}" ]; then + mv "${1}/${4}" "${1}/${2}" fi - - ln -s "${3}/${4}/" "/tmp" - mv "/tmp/${4}" "${1}/${2}" } From 52ebda0a59a7e827a2bb4e3aabee46b98f7f8b33 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 28 Dec 2023 11:55:55 -0500 Subject: [PATCH 04/17] docs: Improve readme and doc examples * Move docker-compose example into its own file to make git history more readable * Move old changelog into own file * Will be covered in the future by Releases? * Add WEBUI_VERSION usage to readme * Add notes/behavior for individual projects where improvements have been added --- CHANGELOG.md | 36 +++++++++++++ README.md | 123 +++++++++++++++++++-------------------------- docker-compose.yml | 20 ++++++++ 3 files changed, 108 insertions(+), 71 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 docker-compose.yml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..99ee52d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,36 @@ +**Subsequent changelog history can be found in Releases** + +- **Version 2.0.2** : + move .cache folder to stable-diffusion/temp to avoid filling unraid's docker.img file. + (hopefully) fix all the things I broke in the last update :) + +- **Version 2.0.0** : + Utilize Conda to manage dependencies efficiently. + Prepared for Reactor in Auto1111, SD-Next, and ComfyUI. + More common folders merged in the models folder. + Split install scripts for easier maintenance. + Implemented various fixes. + +- **Version 1.5.1** : + Added a fix for Automatic1111/dreambooth + +- **Version 1.5.0** : + Added StableSwarm and VoltaML + +- **Version 1.4.0** : + Added FaceFusion + +- **Version 1.3.0** : + Added Kubin (Kubin is only for testing, not production ready) + Corrected update of ComfyUI at startup not working + +- **Version 1.2.0** : + Added Lama-cleaner and Kohya + +- **Version 1.1.0** : + Added Focus as interface 06 + Small Fixes + +- **Version 1.0.0** : + Lots of modifications on directory structure. + Before using this version it's best to do a backup, do a clean install and restore models,loras, ect from the backup. \ No newline at end of file diff --git a/README.md b/README.md index c2f3417..0369aa6 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/holaflenain/stable-diffusion)](https://hub.docker.com/r/holaflenain/stable-diffusion) -The goal of this docker container is to provide an easy way to run different WebUI and other tools related to Image Generation (mostly stable-diffusion). - +The goal of this docker container is to provide an easy way to run different WebUI/projects and other tools related to Image Generation (mostly stable-diffusion). + +# Projects + Please consult each respective website for a comprehensive description and usage guidelines. | WEBUI | Name | | | |-------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| @@ -21,9 +23,23 @@ Please consult each respective website for a comprehensive description and usage | 70 | Kohya | Kohya's GUI provides a Windows-focused Gradio GUI for Kohya's Stable Diffusion trainers | https://github.com/bmaltais/kohya_ss | -## Usage +# Usage + +Unraid template available on [superboki's Repository](https://github.com/superboki/UNRAID-FR/tree/main/stable-diffusion-advanced) (search stable-diffusion in community apps) + +## Choosing a Project -Unraid template available on superboki's Repository (search diffusion in community apps) +Use the environmental variable `WEBUI_VERSION` to choose which [project](#projects) to install and use based on the number in the **WEBUI** column. [easy diffusion](https://github.com/easydiffusion/easydiffusion) (`01`) is installed if none is specified. + +Example: To use SD.Next => `WEBUI_VERSION=04` + +``` +docker run ... -e WEBUI_VERSION=04 ... holaflenain/stable-diffusion +``` + +or modify `WEBUI_VERSION` in [docker-compose.yml](/docker-compose.yml) + +## Docker Notes ### Using PUID and PGID @@ -45,36 +61,11 @@ Then add to your docker command like so: docker run -d ... -e "PUID=1000" -e "PGID=1000" ... holaflenain/stable-diffusion ``` -or substitute them in the docker-compose examples below. - -#### Docker Compose Example +or substitute them in [docker-compose.yml](/docker-compose.yml) +### Docker Compose -Using Easy-Diffusion as an example: - -```yaml -version: '3.1' -services: - stable-diffusion-test: - image: holaflenain/stable-diffusion:latest - container_name: stable-diffusion - environment: - - WEBUI_VERSION=01 - - NVIDIA_VISIBLE_DEVICES=all - - TZ=Europe/Paris - - PUID=1000 - - PGID=1000 - ports: - - '9000:9000/tcp' - volumes: - - '/my/own/datadir:/config:rw' - # or specify individual dirs - #- '/my/own/datadir:/config:rw' # config/program dir - #- '/my/own/datadir/outputs:/config/outputs:rw' - #- '/my/own/datadir/cache:/config/cache:rw' - runtime: nvidia - -``` +Reference [docker-compose.yml](/docker-compose.yml) which uses Easy-Diffusion as an example. ## Directory Structure @@ -105,46 +96,36 @@ By default, each user interface will save data in its own directory, which is au ├── 50-lama-cleaner └── 51-facefusion +## Project Notes + +Some projects have modified install/startup changes to address performance or suggested fixes. + +General changes are listed below and **specified in notes if they apply.** Specific project modifications are listed below these. + +###### Clean Environment + +When the container starts if the installed project is outdated compared to the _upstream project_ then the latest code is pulled and dependencies for installation are wiped and re-installed. Subsequent container starts will be much faster since the project will not be re-installed. This behavior can be **forced** by setting the docker environmental variable `CLEAN_ENV=true`. -## History -- **Version 2.0.2** : -move .cache folder to stable-diffusion/temp to avoid filling unraid's docker.img file. -(hopefully) fix all the things I broke in the last update :) - -- **Version 2.0.0** : -Utilize Conda to manage dependencies efficiently. -Prepared for Reactor in Auto1111, SD-Next, and ComfyUI. -More common folders merged in the models folder. -Split install scripts for easier maintenance. -Implemented various fixes. - -- **Version 1.5.1** : -Added a fix for Automatic1111/dreambooth - -- **Version 1.5.0** : -Added StableSwarm and VoltaML - -- **Version 1.4.0** : -Added FaceFusion - -- **Version 1.3.0** : -Added Kubin (Kubin is only for testing, not production ready) -Corrected update of ComfyUI at startup not working - -- **Version 1.2.0** : -Added Lama-cleaner and Kohya - -- **Version 1.1.0** : -Added Focus as interface 06 -Small Fixes - -- **Version 1.0.0** : -Lots of modifications on directory structure. -Before using this version it's best to do a backup, do a clean install and restore models,loras, ect from the backup. -## Troubleshoot : -First thing to try when a UI refuse to launch, remove the cache and the numbered folder (ex :02-sd-webui ) then relaunch the container +#### Stable Diffusion WebUI (02) Notes + +* Uses [Clean Environment](#clean-environment) performance improvement + +#### SD.Next (04) Notes + +* Uses [Clean Environment](#clean-environment) performance improvement +* Uses an updated `malloc` library to fix a [memory leak](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6850#issuecomment-1432435503) + * This can be turned off by removing the line `export LD_PRELOAD=libtcmalloc.so` from `04-SD-Next/webui/webui-user.sh` (but do not delete the file!) + +# History + +See [**Changelog**](/CHANGELOG.md) -## Support : +# Support + Support for the container available here : https://forums.unraid.net/topic/143645-support-stable-diffusion-advanced/ -Support for the WebUIs available on their respective pages. \ No newline at end of file +Support for the WebUIs available on their respective pages. + +## Troubleshooting + +First thing to try when a UI refuse to launch, remove the cache and the numbered folder (ex :02-sd-webui ) then relaunch the container \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..339531b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3.1' +services: + stable-diffusion-test: + image: holaflenain/stable-diffusion:latest + container_name: stable-diffusion + environment: + - WEBUI_VERSION=01 + - NVIDIA_VISIBLE_DEVICES=all + - TZ=Europe/Paris + - PUID=1000 + - PGID=1000 + ports: + - '9000:9000/tcp' + volumes: + - '/my/own/datadir:/config:rw' + # or specify individual dirs + #- '/my/own/datadir:/config:rw' # config/program dir + #- '/my/own/datadir/outputs:/config/outputs:rw' + #- '/my/own/datadir/cache:/config/cache:rw' + runtime: nvidia \ No newline at end of file From ada4ee74badd1ec2be7a8f84881e34b132b7a18c Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 28 Dec 2023 12:38:28 -0500 Subject: [PATCH 05/17] fix(sdnext): Use more robust memory fix solution * Use libtcmalloc-minimal4 since its already installed (no additional dependencies * Export only if dependency is found * Export in startup script so we don't have to modify user files ie webui-user.sh --- 04.sh | 13 ++++++++----- Dockerfile | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/04.sh b/04.sh index 5ef7d4f..992488c 100755 --- a/04.sh +++ b/04.sh @@ -45,11 +45,14 @@ if [ ! -f "$SD04_DIR/parameters.txt" ]; then fi # Load updated malloc to fix memory leak # https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6850#issuecomment-1432435503 -if [ ! -f "$SD04_DIR/webui/webui-user.sh" ]; then -cat >"$SD04_DIR/webui/webui-user.sh" < Date: Thu, 28 Dec 2023 12:42:01 -0500 Subject: [PATCH 06/17] docs: Update sd.next memory leak documentation #13 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0369aa6..81a3369 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,8 @@ When the container starts if the installed project is outdated compared to the _ #### SD.Next (04) Notes * Uses [Clean Environment](#clean-environment) performance improvement -* Uses an updated `malloc` library to fix a [memory leak](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6850#issuecomment-1432435503) - * This can be turned off by removing the line `export LD_PRELOAD=libtcmalloc.so` from `04-SD-Next/webui/webui-user.sh` (but do not delete the file!) +* Uses an updated `malloc` library to fix a [memory leak](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/6722) + * This can be turned off by adding the docker environmental variable `NO_TCMALLOC=true` # History From 0ea0566d4fe6111e2afdb7f34619919ec6a61f1e Mon Sep 17 00:00:00 2001 From: Webifi Date: Thu, 28 Dec 2023 22:48:09 -0600 Subject: [PATCH 07/17] Add ComfyUI-Manager --- 05.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/05.sh b/05.sh index bd43839..03c47a0 100755 --- a/05.sh +++ b/05.sh @@ -26,6 +26,13 @@ if [ ! -d ${SD05_DIR}/ComfyUI ]; then git clone https://github.com/comfyanonymous/ComfyUI ${SD05_DIR}/ComfyUI fi +if [ ! -d ${SD05_DIR}/ComfyUI/custom_nodes/ComfyUI-Manager ]; then + git clone https://github.com/ltdrdata/ComfyUI-Manager.git ${SD05_DIR}/ComfyUI/custom_nodes/ComfyUI-Manager +fi + +cd ${SD05_DIR}/ComfyUI/custom_nodes/ComfyUI-Manager +git pull -X ours + cd ${SD05_DIR}/ComfyUI git pull -X ours @@ -34,9 +41,11 @@ sl_folder ${SD05_DIR}/ComfyUI/models checkpoints ${BASE_DIR}/models stable-diffu sl_folder ${SD05_DIR}/ComfyUI/models hypernetworks ${BASE_DIR}/models hypernetwork sl_folder ${SD05_DIR}/ComfyUI/models loras ${BASE_DIR}/models lora sl_folder ${SD05_DIR}/ComfyUI/models vae ${BASE_DIR}/models vae +sl_folder ${SD05_DIR}/ComfyUI/models vae_approx ${BASE_DIR}/models vae_approx sl_folder ${SD05_DIR}/ComfyUI/models embeddings ${BASE_DIR}/models embeddings sl_folder ${SD05_DIR}/ComfyUI/models upscale_models ${BASE_DIR}/models upscale sl_folder ${SD05_DIR}/ComfyUI/models clip_vision ${BASE_DIR}/models clip_vision +sl_folder ${SD05_DIR}/ComfyUI/models clip ${BASE_DIR}/models clip sl_folder ${SD05_DIR}/ComfyUI/models controlnet ${BASE_DIR}/models controlnet if [ -d ${SD05_DIR}/venv ]; then 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 08/17] 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 09/17] 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 10/17] 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 11/17] 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 12/17] 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 13/17] 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 14/17] 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 15/17] 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 16/17] 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 From a228c76b60ce3ba7197e0db49c9a141b2793f01e Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 8 Feb 2024 12:40:59 -0500 Subject: [PATCH 17/17] fix(sdnext): Remove invalid arg The latest version of SDNext (2024-02-07) removed `--no-download` cli arg. Remove from params to prevent SD from crashing on startup --- parameters/04.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/parameters/04.txt b/parameters/04.txt index c4969fd..7670d9d 100644 --- a/parameters/04.txt +++ b/parameters/04.txt @@ -6,4 +6,3 @@ --insecure --medvram --allow-code ---no-download