diff --git a/02.forge.sh b/02.forge.sh index 9f1f323..d2b49b6 100644 --- a/02.forge.sh +++ b/02.forge.sh @@ -31,19 +31,26 @@ fi source activate ${SD02_DIR}/conda-env conda install -n base conda-libmamba-solver -y conda install -c conda-forge python=3.11 pip gcc gxx libcurand --solver=libmamba -y +#conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidia --solver=libmamba -y if [ ! -f "$SD02_DIR/parameters.forge.txt" ]; then cp -v "/opt/sd-install/parameters/02.forge.txt" "$SD02_DIR/parameters.forge.txt" fi -#install dependencies +#install custom requirements pip install --upgrade pip -pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy -pip install packaging -pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ -pip install insightface -pip install basicsr -pip install xformers --index-url https://download.pytorch.org/whl/cu121 + +if [ -f ${SD02_DIR}/requirements.txt ]; then + pip install -r ${SD02_DIR}/requirements.txt +fi + + +#pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy +#pip install packaging +#pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ +#pip install insightface +#pip install basicsr +#pip install xformers --index-url https://download.pytorch.org/whl/cu121 # Merge Models, vae, lora, and hypernetworks, and outputs # Ignore move errors if they occur diff --git a/02.sh b/02.sh index b49c8fc..2c07420 100755 --- a/02.sh +++ b/02.sh @@ -32,22 +32,28 @@ fi source activate ${SD02_DIR}/conda-env conda install -n base conda-libmamba-solver -y conda install -c conda-forge python=3.11 pip gcc gxx libcurand --solver=libmamba -y +#conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidia --solver=libmamba -y #copy default parameters if absent if [ ! -f "$SD02_DIR/parameters.txt" ]; then cp -v "/opt/sd-install/parameters/02.txt" "$SD02_DIR/parameters.txt" fi -# install dependencies +# install custom requirements pip install --upgrade pip -pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy -pip install packaging -pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ -pip install insightface -pip install basicsr -pip install xformers --index-url https://download.pytorch.org/whl/cu121 -pip install albumentations==1.4.3 -pip install pydantic==1.10.15 + +if [ -f ${SD02_DIR}/requirements.txt ]; then + pip install -r ${SD02_DIR}/requirements.txt +fi + +#pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy +#pip install packaging +#pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ +#pip install insightface +#pip install basicsr +#pip install xformers --index-url https://download.pytorch.org/whl/cu121 +#pip install albumentations==1.4.3 +#pip install pydantic==1.10.15 # Merge Models, vae, lora, and hypernetworks, and outputs diff --git a/03.sh b/03.sh index 75fe69f..ab73140 100755 --- a/03.sh +++ b/03.sh @@ -46,6 +46,13 @@ fi pip install --use-pep517 --upgrade InvokeAI #invokeai-configure --yes --root ${SD03_DIR}/invokeai --skip-sd-weights +# install custom requirements +pip install --upgrade pip + +if [ -f ${SD03_DIR}/requirements.txt ]; then + pip install -r ${SD03_DIR}/requirements.txt +fi + # launch WebUI invokeai-web --config ${SD03_DIR}/config.yaml wait 99999 \ No newline at end of file diff --git a/04.sh b/04.sh index e0fdbb1..4db2710 100755 --- a/04.sh +++ b/04.sh @@ -40,15 +40,20 @@ if [ ! -d ${SD04_DIR}/webui/venv ]; then python -m venv venv fi -# install dependencies +# install custom requirements cd ${SD04_DIR}/webui source venv/bin/activate pip install --upgrade pip - pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy - pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ - pip install insightface - pip install basicsr - pip install sqlalchemy + + if [ -f ${SD04_DIR}/requirements.txt ]; then + pip install -r ${SD04_DIR}/requirements.txt + fi + +# pip install coloredlogs flatbuffers numpy packaging protobuf==3.20.3 sympy +# pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ +# pip install insightface +# pip install basicsr +# pip install sqlalchemy deactivate #copy default parameters if absent diff --git a/05.sh b/05.sh index 1cc7cc0..c4b05ae 100755 --- a/05.sh +++ b/05.sh @@ -43,10 +43,17 @@ source activate ${SD05_DIR}/env conda install -n base conda-libmamba-solver -y conda install -c conda-forge git python=3.11 pip gxx libcurand --solver=libmamba -y conda install -c nvidia cuda-cudart --solver=libmamba -y -pip install onnxruntime-gpu -pip install insightface torch torchvision - -install_requirements ${SD05_DIR}/ComfyUI/custom_nodes +#pip install onnxruntime-gpu +#pip install insightface torch>=2.2.2 torchvision opencv-python-headless>=4.9.0.80 huggingface-hub>=0.20.2 numpy>=1.24.4 + +#Install custom nodes dependencies if a clean Venv has been done +if [ "$active_clean" = "1" ]; then + echo "-------------------------------------" + echo "Install Custom Nodes Dependencies" + install_requirements ${SD05_DIR}/ComfyUI/custom_nodes + echo "Done!" + echo -e "-------------------------------------\n" +fi #clean old venv if it still exists if [ -d ${SD05_DIR}/venv ]; then @@ -69,8 +76,14 @@ sl_folder ${SD05_DIR}/ComfyUI/models controlnet ${BASE_DIR}/models controlnet #install requirements cd ${SD05_DIR}/ComfyUI +pip install --upgrade pip pip install -r requirements.txt +if [ -f ${SD05_DIR}/requirements.txt ]; then + pip install -r ${SD05_DIR}/requirements.txt +fi + + #run webui CMD="python3 main.py" while IFS= read -r param; do diff --git a/06.sh b/06.sh index 78d92f5..5487058 100755 --- a/06.sh +++ b/06.sh @@ -54,6 +54,9 @@ sl_folder ${SD06_DIR}/Fooocus outputs ${BASE_DIR}/outputs 06-Fooocus #install requirements cd ${SD06_DIR}/Fooocus pip install -r requirements_versions.txt +if [ -f ${SD06_DIR}/requirements.txt ]; then + pip install -r ${SD06_DIR}/requirements.txt +fi #Launch webUI CMD="python launch.py" diff --git a/07.sh b/07.sh index 1e49c0d..6ed4dbe 100755 --- a/07.sh +++ b/07.sh @@ -2,10 +2,10 @@ source /functions.sh export PATH="/home/abc/miniconda3/bin:$PATH" -export SD07_DIR=${BASE_DIR}/07-StableSwarm +export SD07_DIR=${BASE_DIR}/07-SwarmUI mkdir -p ${SD07_DIR} -mkdir -p /config/outputs/07-StableSwarm +mkdir -p /config/outputs/07-SwarmUI #remove old venv if still exists if [ -d ${SD07_DIR}/venv ]; then @@ -18,12 +18,12 @@ if [ ! -f "$SD07_DIR/parameters.txt" ]; then fi #clone repository if new install -if [ ! -d ${SD07_DIR}/StableSwarmUI ]; then - cd "${SD07_DIR}" && git clone https://github.com/Stability-AI/StableSwarmUI.git +if [ ! -d ${SD07_DIR}/SwarmUI ]; then + cd "${SD07_DIR}" && git clone https://github.com/mcmonkeyprojects/SwarmUI.git fi # check if remote is ahead of local -cd ${SD07_DIR}/StableSwarmUI +cd ${SD07_DIR}/SwarmUI check_remote #clean conda env if needed @@ -40,19 +40,26 @@ conda install -n base conda-libmamba-solver -y conda install -c conda-forge git python=3.11 pip --solver=libmamba -y #move models to common folder and create symlinks -mkdir -p ${SD07_DIR}/StableSwarmUI/Models +mkdir -p ${SD07_DIR}/SwarmUI/Models -sl_folder ${SD07_DIR}/StableSwarmUI/Models Stable-Diffusion ${BASE_DIR}/models stable-diffusion -sl_folder ${SD07_DIR}/StableSwarmUI/Models Lora ${BASE_DIR}/models lora -sl_folder ${SD07_DIR}/StableSwarmUI/Models VAE ${BASE_DIR}/models vae -sl_folder ${SD07_DIR}/StableSwarmUI/Models Embeddings ${BASE_DIR}/models embeddings -sl_folder ${SD07_DIR}/StableSwarmUI/Models clip_vision ${BASE_DIR}/models clip_vision -sl_folder ${SD07_DIR}/StableSwarmUI/Models controlnet ${BASE_DIR}/models controlnet +sl_folder ${SD07_DIR}/SwarmUI/Models Stable-Diffusion ${BASE_DIR}/models stable-diffusion +sl_folder ${SD07_DIR}/SwarmUI/Models Lora ${BASE_DIR}/models lora +sl_folder ${SD07_DIR}/SwarmUI/Models VAE ${BASE_DIR}/models vae +sl_folder ${SD07_DIR}/SwarmUI/Models Embeddings ${BASE_DIR}/models embeddings +sl_folder ${SD07_DIR}/SwarmUI/Models clip_vision ${BASE_DIR}/models clip_vision +sl_folder ${SD07_DIR}/SwarmUI/Models controlnet ${BASE_DIR}/models controlnet -sl_folder ${SD07_DIR}/StableSwarmUI Output ${BASE_DIR}/outputs 07-StableSwarm +sl_folder ${SD07_DIR}/SwarmUI Output ${BASE_DIR}/outputs 07-Swarm -#launch Stable Swarm -cd ${SD07_DIR}/StableSwarmUI +# install dependencies +pip install --upgrade pip + +if [ -f ${SD07_DIR}/requirements.txt ]; then + pip install -r ${SD07_DIR}/requirements.txt +fi + +#launch SwarmUI +cd ${SD07_DIR}/SwarmUI CMD="./launch-linux.sh" while IFS= read -r param; do if [[ $param != \#* ]]; then diff --git a/50.sh b/50.sh index 4edd25f..9eb2de9 100755 --- a/50.sh +++ b/50.sh @@ -20,9 +20,15 @@ if [ ! -f "$SD50_DIR/parameters.txt" ]; then fi cd ${SD50_DIR}/IOPaint -#pip install -r requirements.txt -pip3 install iopaint +pip3 install --upgrade iopaint + +# install custom requirements +pip install --upgrade pip + +if [ -f ${SD50_DIR}/requirements.txt ]; then + pip install -r ${SD50_DIR}/requirements.txt +fi CMD="iopaint start" while IFS= read -r param; do diff --git a/51.sh b/51.sh index 8a53ceb..4eafa07 100755 --- a/51.sh +++ b/51.sh @@ -32,6 +32,15 @@ conda install -c conda-forge git python=3.11 pip gxx ffmpeg --solver=libmamba -y cd ${SD51_DIR}/facefusion pip install -r requirements.txt + + # install custom requirements + pip install --upgrade pip + + if [ -f ${SD51_DIR}/requirements.txt ]; then + pip install -r ${SD51_DIR}/requirements.txt + fi + + export GRADIO_SERVER_NAME=0.0.0.0 export GRADIO_SERVER_PORT=9000 CMD="python3 run.py"; while IFS= read -r param; do if [[ $param != \#* ]]; then CMD+=" ${param}"; fi; done < "${SD51_DIR}/parameters.txt"; eval $CMD diff --git a/70.sh b/70.sh index 90dde6f..c029367 100755 --- a/70.sh +++ b/70.sh @@ -37,6 +37,11 @@ cd ${SD70_DIR}/kohya_ss python ./setup/setup_linux.py cd ${SD70_DIR}/kohya_ss +# install custom requirements +if [ -f ${SD70_DIR}/requirements.txt ]; then + pip install -r ${SD70_DIR}/requirements.txt +fi + #launch Kohya echo LAUNCHING KOHYA_SS ! CMD="python kohya_gui.py"; while IFS= read -r param; do if [[ $param != \#* ]]; then CMD+=" ${param}"; fi; done < "${SD70_DIR}/parameters.txt"; eval $CMD diff --git a/README.md b/README.md index f3a7bca..9047b05 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Please consult each respective website for a comprehensive description and usage | 04 | SD.Next | This project started as a fork from Automatic1111 WebUI and it grew significantly | https://github.com/vladmandic/automatic | | 05 | ComfyUI | A powerful and modular stable diffusion GUI and backend | https://github.com/comfyanonymous/ComfyUI | | 06 | Fooocus | Fooocus is a rethinking of Stable Diffusion and Midjourney’s designs | https://github.com/lllyasviel/Fooocus | -| 07 | StableSwarm | A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility. | https://github.com/Stability-AI/StableSwarmUI | +| 07 | SwarmUI | A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility. | https://github.com/mcmonkeyprojects/SwarmUI | | 50 | Lama Cleaner | A free and open-source inpainting tool powered by SOTA AI model. | https://github.com/Sanster/lama-cleaner | | 51 | FaceFusion | Next generation face swapper and enhancer | https://github.com/facefusion/facefusion | | 70 | Kohya | Kohya's GUI provides a Windows-focused Gradio GUI for Kohya's Stable Diffusion trainers | https://github.com/bmaltais/kohya_ss | @@ -36,7 +36,7 @@ docker compose --profile invoke-ai up # http://:9003 docker compose --profile sd-next up # http://:9004 docker compose --profile comfy-ui up # http://:9005 docker compose --profile fooocus up # http://:9006 -docker compose --profile stable-swarm up # http://:9007 +docker compose --profile swarmui up # http://:9007 docker compose --profile lama-cleaner up # http://:9050 docker compose --profile face-fusion up # http://:9051 docker compose --profile kohya up # http://:9070 @@ -72,7 +72,7 @@ make start invoke-ai # http://:9003 make start sd-next # http://:9004 make start comfy-ui # http://:9005 make start fooocus # http://:9006 -make start stable-swarm # http://:9007 +make start swarmui # http://:9007 make start lama-cleaner # http://:9050 make start face-fusion # http://:9051 make start kohya # http://:9070 diff --git a/docker-compose.yml b/docker-compose.yml index 2a2680d..d977aeb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,15 +81,15 @@ services: ports: - ${FOOOCUS_PORT:-9006}:9000/tcp - stable-diffusion-stable-swarm: + stable-diffusion-swarmui: <<: *default-service - profiles: [stable-swarm] - container_name: stable-diffusion-stable-swarm + profiles: [swarmui] + container_name: stable-diffusion-swarmui environment: <<: *default-environment WEBUI_VERSION: '07' ports: - - ${STABLE_SWARM_PORT:-9007}:9000/tcp + - ${SWARMUI_PORT:-9007}:9000/tcp stable-diffusion-lama-cleaner: <<: *default-service diff --git a/functions.sh b/functions.sh index 2fa2362..3e6aef5 100644 --- a/functions.sh +++ b/functions.sh @@ -55,6 +55,23 @@ fi } # Fonction récursive pour installer les requirements.txt +#install_requirements() { +# local directory="$1" +# local requirements_file="$directory/requirements.txt" + +# if [ -f "$requirements_file" ]; then +# echo "Installation des dépendances dans $directory ..." +# pip install -r "$requirements_file" +# echo "Dépendances installées avec succès dans $directory." +# fi + +# # Parcours récursif des sous-dossiers +# for subdir in "$directory"/*; do +# if [ -d "$subdir" ]; then +# install_requirements "$subdir" +# fi +# done +#} install_requirements() { local directory="$1" local requirements_file="$directory/requirements.txt" @@ -65,10 +82,15 @@ install_requirements() { echo "Dépendances installées avec succès dans $directory." fi - # Parcours récursif des sous-dossiers + # Parcours des sous-dossiers du premier niveau uniquement for subdir in "$directory"/*; do if [ -d "$subdir" ]; then - install_requirements "$subdir" + local subdir_requirements_file="$subdir/requirements.txt" + if [ -f "$subdir_requirements_file" ]; then + echo "Installation des dépendances dans $subdir ..." + pip install -r "$subdir_requirements_file" + echo "Dépendances installées avec succès dans $subdir." + fi fi done -} \ No newline at end of file +}