From 26eeb2f6046a28e59eb872e43016a353f00ecf1e Mon Sep 17 00:00:00 2001 From: tknr Date: Mon, 9 Sep 2024 00:46:40 +0900 Subject: [PATCH 1/8] u --- .gitignore | 3 +++ install-mac.sh | 0 install.sh | 0 start-webserver.sh | 0 start-webui.sh | 0 start.sh | 0 6 files changed, 3 insertions(+) mode change 100644 => 100755 install-mac.sh mode change 100644 => 100755 install.sh mode change 100644 => 100755 start-webserver.sh mode change 100644 => 100755 start-webui.sh mode change 100644 => 100755 start.sh diff --git a/.gitignore b/.gitignore index 0542bc8..641d635 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ __pycache__ results # excluding user settings for the GUI frontend configs/settings.yaml +controlnet_models/*.safetensors +lora_models/*.safetensors + diff --git a/install-mac.sh b/install-mac.sh old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 diff --git a/start-webserver.sh b/start-webserver.sh old mode 100644 new mode 100755 diff --git a/start-webui.sh b/start-webui.sh old mode 100644 new mode 100755 diff --git a/start.sh b/start.sh old mode 100644 new mode 100755 From 63ef2352c4d119668dedd4f64bac750e7c1e5907 Mon Sep 17 00:00:00 2001 From: tknr Date: Mon, 9 Sep 2024 01:27:15 +0900 Subject: [PATCH 2/8] u --- configs/lcm-lora-models.txt | 0 configs/lcm-models.txt | 0 configs/openvino-lcm-models.txt | 0 configs/stable-diffusion-models.txt | 0 controlnet_models/Readme.txt | 0 install.sh | 5 ++++- lora_models/Readme.txt | 0 7 files changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 configs/lcm-lora-models.txt mode change 100644 => 100755 configs/lcm-models.txt mode change 100644 => 100755 configs/openvino-lcm-models.txt mode change 100644 => 100755 configs/stable-diffusion-models.txt mode change 100644 => 100755 controlnet_models/Readme.txt mode change 100644 => 100755 lora_models/Readme.txt diff --git a/configs/lcm-lora-models.txt b/configs/lcm-lora-models.txt old mode 100644 new mode 100755 diff --git a/configs/lcm-models.txt b/configs/lcm-models.txt old mode 100644 new mode 100755 diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt old mode 100644 new mode 100755 diff --git a/configs/stable-diffusion-models.txt b/configs/stable-diffusion-models.txt old mode 100644 new mode 100755 diff --git a/controlnet_models/Readme.txt b/controlnet_models/Readme.txt old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh index 718ebfb..ec18d87 100755 --- a/install.sh +++ b/install.sh @@ -34,6 +34,9 @@ else pip install -r "$BASEDIR/requirements.txt" fi +## https://github.com/jhj0517/Whisper-WebUI/issues/258#issuecomment-2333390291 +pip install -U gradio + chmod +x "start.sh" chmod +x "start-webui.sh" -read -n1 -r -p "FastSD CPU installation completed,press any key to continue..." key \ No newline at end of file +read -n1 -r -p "FastSD CPU installation completed,press any key to continue..." key diff --git a/lora_models/Readme.txt b/lora_models/Readme.txt old mode 100644 new mode 100755 From 89b19c92677bfc41a431740c62975dc657a70961 Mon Sep 17 00:00:00 2001 From: tknr Date: Thu, 12 Sep 2024 23:35:26 +0900 Subject: [PATCH 3/8] added models --- configs/lcm-lora-models.txt | 9 ++++++++- configs/openvino-lcm-models.txt | 31 ++++++++++++++++++++++------- configs/stable-diffusion-models.txt | 3 ++- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/configs/lcm-lora-models.txt b/configs/lcm-lora-models.txt index f252571..38e1a50 100755 --- a/configs/lcm-lora-models.txt +++ b/configs/lcm-lora-models.txt @@ -1,4 +1,11 @@ latent-consistency/lcm-lora-sdv1-5 latent-consistency/lcm-lora-sdxl latent-consistency/lcm-lora-ssd-1b -rupeshs/hypersd-sd1-5-1-step-lora \ No newline at end of file +rupeshs/hypersd-sd1-5-1-step-lora +Fictiverse/Stable_Diffusion_PaperCut_Model +stabilityai/stable-diffusion-xl-base-1.0 +runwayml/stable-diffusion-v1-5 +segmind/SSD-1B +stablediffusionapi/anything-v5 +wavymulder/collage-diffusion + diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt index 656096d..1e6f048 100755 --- a/configs/openvino-lcm-models.txt +++ b/configs/openvino-lcm-models.txt @@ -1,9 +1,26 @@ -rupeshs/sd-turbo-openvino -rupeshs/sdxs-512-0.9-openvino -rupeshs/hyper-sd-sdxl-1-step-openvino-int8 -rupeshs/SDXL-Lightning-2steps-openvino-int8 -rupeshs/sdxl-turbo-openvino-int8 -rupeshs/LCM-dreamshaper-v7-openvino Disty0/LCM_SoteMix +Disty0/SoteMixV3 +FFusion/FFusionXL-BASE +anokimchen/sd-turbo-openvino-8bit-GPT4vision-calibrated +anokimchen/sd-turbo-openvino-8bit-no-calibration +anokimchen/tiny-sd-openvino +helenai/Lykon-DreamShaper-ov +helenai/SimianLuo-LCM_Dreamshaper_v7-ov +helenai/eimiss-EimisAnimeDiffusion_1.0v-ov +helenai/hakurei-waifu-diffusion-ov +helenai/lambdalabs-sd-pokemon-diffusers-ov +helenai/naclbit-trinart_stable_diffusion_v2-ov +helenai/nitrosocke-Nitro-Diffusion-ov +helenai/prompthero-openjourney-ov +helenai/runwayml-stable-diffusion-v1-5-ov +helenai/wavymulder-Analog-Diffusion-ov +helenai/wavymulder-portraitplus-ov rupeshs/FLUX.1-schnell-openvino-int4 -rupeshs/sd15-lcm-square-openvino-int8 \ No newline at end of file +rupeshs/LCM-dreamshaper-v7-openvino +rupeshs/SDXL-Lightning-2steps-openvino-int8 +rupeshs/hyper-sd-sdxl-1-step-openvino-int8 +rupeshs/sd-turbo-openvino +rupeshs/sd15-lcm-square-openvino-int8 +rupeshs/sdxl-turbo-openvino-int8 +rupeshs/sdxs-512-0.9-openvino +yuyuyu09/animagine-xl-3.0-openvino diff --git a/configs/stable-diffusion-models.txt b/configs/stable-diffusion-models.txt index d5d21c9..c88fd52 100755 --- a/configs/stable-diffusion-models.txt +++ b/configs/stable-diffusion-models.txt @@ -4,4 +4,5 @@ stabilityai/stable-diffusion-xl-base-1.0 runwayml/stable-diffusion-v1-5 segmind/SSD-1B stablediffusionapi/anything-v5 -prompthero/openjourney-v4 \ No newline at end of file +prompthero/openjourney-v4 +aipicasso/commonart-beta From 1040a6f9fb9299c11f7b82f12e39e4e6ed5f400b Mon Sep 17 00:00:00 2001 From: tknr Date: Sat, 14 Sep 2024 13:18:27 +0900 Subject: [PATCH 4/8] added options treatments to start-webui.sh --- configs/openvino-lcm-models.txt | 1 + configs/stable-diffusion-models.txt | 10 ++++++---- src/app.py | 7 +++++++ src/frontend/webui/ui.py | 3 ++- start-webui.sh | 22 +++++++++++++++++++++- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt index 1e6f048..bf0e767 100755 --- a/configs/openvino-lcm-models.txt +++ b/configs/openvino-lcm-models.txt @@ -4,6 +4,7 @@ FFusion/FFusionXL-BASE anokimchen/sd-turbo-openvino-8bit-GPT4vision-calibrated anokimchen/sd-turbo-openvino-8bit-no-calibration anokimchen/tiny-sd-openvino +echarlaix/LCM_Dreamshaper_v7-openvino-8bit helenai/Lykon-DreamShaper-ov helenai/SimianLuo-LCM_Dreamshaper_v7-ov helenai/eimiss-EimisAnimeDiffusion_1.0v-ov diff --git a/configs/stable-diffusion-models.txt b/configs/stable-diffusion-models.txt index c88fd52..b860df1 100755 --- a/configs/stable-diffusion-models.txt +++ b/configs/stable-diffusion-models.txt @@ -1,8 +1,10 @@ -Lykon/dreamshaper-8 Fictiverse/Stable_Diffusion_PaperCut_Model -stabilityai/stable-diffusion-xl-base-1.0 +Lykon/dreamshaper-8 +aipicasso/commonart-beta +digiplay/counterfeitV2525d_tweak +gsdf/Counterfeit-V3.0 +prompthero/openjourney-v4 runwayml/stable-diffusion-v1-5 segmind/SSD-1B +stabilityai/stable-diffusion-xl-base-1.0 stablediffusionapi/anything-v5 -prompthero/openjourney-v4 -aipicasso/commonart-beta diff --git a/src/app.py b/src/app.py index 76f1ced..f83bd86 100644 --- a/src/app.py +++ b/src/app.py @@ -251,6 +251,12 @@ help="Web server port", default=8000, ) +parser.add_argument( + "--root_path", + type=str, + help="Web server root path", + default=None, +) args = parser.parse_args() @@ -302,6 +308,7 @@ print("Starting web UI mode") start_webui( args.share, + args.root_path, ) elif args.realtime: from frontend.webui.realtime_ui import start_realtime_text_to_image diff --git a/src/frontend/webui/ui.py b/src/frontend/webui/ui.py index fdbc133..8266ee3 100644 --- a/src/frontend/webui/ui.py +++ b/src/frontend/webui/ui.py @@ -84,7 +84,8 @@ def change_mode(mode): def start_webui( share: bool = False, + root_path: str = "/", ): webui = get_web_ui() webui.queue() - webui.launch(share=share) + webui.launch(share=share,root_path=root_path) diff --git a/start-webui.sh b/start-webui.sh index 20f4301..2804ac7 100755 --- a/start-webui.sh +++ b/start-webui.sh @@ -23,4 +23,24 @@ echo "Python version : $python_version" BASEDIR=$(pwd) # shellcheck disable=SC1091 source "$BASEDIR/env/bin/activate" -$PYTHON_COMMAND src/app.py -w + +## https://qiita.com/ko1nksm/items/7d37852b9fc581b1266e +abort() { echo "$*" >&2; exit 1; } +unknown() { abort "unrecognized option '$1'"; } +required() { [ $# -gt 1 ] || abort "option '$1' requires an argument"; } + +OPTION_SHARE='' +OPTION_ROOT_PATH='' + +while [ $# -gt 0 ]; do + case $1 in + -s | --share ) OPTION_SHARE=' --share' ;; + -r | --root_path ) required "$@" && shift; OPTION_ROOT_PATH=' --root_path='$1 ;; + -h | --help ) abort "usage : $(basename $0) [--share] [--root_path=\"/(path)\"]" ;; + -?*) unknown "$@" ;; + *) break + esac + shift +done + +$PYTHON_COMMAND src/app.py -w ${OPTION_SHARE} ${OPTION_ROOT_PATH} From 854fae9d3fd328d98bbf402999fb0b91dd492c0e Mon Sep 17 00:00:00 2001 From: Rupesh Sreeraman Date: Sat, 14 Sep 2024 18:49:44 +0530 Subject: [PATCH 5/8] Correct version --- install.sh | 1 + src/app.py | 3 +++ start-webserver.sh | 3 ++- start-webui.sh | 3 ++- start.sh | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ec18d87..6a6e604 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd $(dirname $0) echo Starting FastSD CPU env installation... set -e PYTHON_COMMAND="python3" diff --git a/src/app.py b/src/app.py index e132b8d..76f1ced 100644 --- a/src/app.py +++ b/src/app.py @@ -14,6 +14,9 @@ from state import get_context, get_settings from utils import show_system_info from backend.device import get_device_name +from transformers.utils.hub import move_cache + +move_cache() parser = ArgumentParser(description=f"FAST SD CPU {constants.APP_VERSION}") parser.add_argument( diff --git a/start-webserver.sh b/start-webserver.sh index 29b4057..aadd852 100755 --- a/start-webserver.sh +++ b/start-webserver.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd $(dirname $0) echo Starting FastSD CPU please wait... set -e PYTHON_COMMAND="python3" @@ -22,4 +23,4 @@ echo "Python version : $python_version" BASEDIR=$(pwd) # shellcheck disable=SC1091 source "$BASEDIR/env/bin/activate" -$PYTHON_COMMAND src/app.py --api \ No newline at end of file +$PYTHON_COMMAND src/app.py --api diff --git a/start-webui.sh b/start-webui.sh index 758cdfd..20f4301 100755 --- a/start-webui.sh +++ b/start-webui.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd $(dirname $0) echo Starting FastSD CPU please wait... set -e PYTHON_COMMAND="python3" @@ -22,4 +23,4 @@ echo "Python version : $python_version" BASEDIR=$(pwd) # shellcheck disable=SC1091 source "$BASEDIR/env/bin/activate" -$PYTHON_COMMAND src/app.py -w \ No newline at end of file +$PYTHON_COMMAND src/app.py -w diff --git a/start.sh b/start.sh index d35cbc7..6faf3cb 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd $(dirname $0) echo Starting FastSD CPU please wait... set -e PYTHON_COMMAND="python3" @@ -22,4 +23,4 @@ echo "Python version : $python_version" BASEDIR=$(pwd) # shellcheck disable=SC1091 source "$BASEDIR/env/bin/activate" -$PYTHON_COMMAND src/app.py --gui \ No newline at end of file +$PYTHON_COMMAND src/app.py --gui From b36e37e0d5607f4e782726913d58132c7ec395b6 Mon Sep 17 00:00:00 2001 From: tknr Date: Sat, 14 Sep 2024 13:18:27 +0900 Subject: [PATCH 6/8] added options treatments to start-webui.sh --- Readme.md | 6 ++++++ configs/lcm-lora-models.txt | 9 +-------- configs/openvino-lcm-models.txt | 31 +++++++---------------------- configs/stable-diffusion-models.txt | 3 +-- src/app.py | 7 +++++++ src/frontend/webui/ui.py | 3 ++- start-webui.sh | 22 +++++++++++++++++++- 7 files changed, 45 insertions(+), 36 deletions(-) diff --git a/Readme.md b/Readme.md index e30c15e..ba6420e 100644 --- a/Readme.md +++ b/Readme.md @@ -448,6 +448,12 @@ To install FastSD CPU on Windows run the following steps : `./start-webui.sh` +##### webui options + + - to use share option : `./start-webui.sh --share` + - to change root url : example. `./start-webui.sh --root_url "/fastsdcpu"` + - show help : `./start-webui.sh --help` + ### FastSD CPU on Mac ![FastSD CPU running on Mac](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu-mac-gui.jpg) diff --git a/configs/lcm-lora-models.txt b/configs/lcm-lora-models.txt index 38e1a50..f252571 100755 --- a/configs/lcm-lora-models.txt +++ b/configs/lcm-lora-models.txt @@ -1,11 +1,4 @@ latent-consistency/lcm-lora-sdv1-5 latent-consistency/lcm-lora-sdxl latent-consistency/lcm-lora-ssd-1b -rupeshs/hypersd-sd1-5-1-step-lora -Fictiverse/Stable_Diffusion_PaperCut_Model -stabilityai/stable-diffusion-xl-base-1.0 -runwayml/stable-diffusion-v1-5 -segmind/SSD-1B -stablediffusionapi/anything-v5 -wavymulder/collage-diffusion - +rupeshs/hypersd-sd1-5-1-step-lora \ No newline at end of file diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt index 1e6f048..656096d 100755 --- a/configs/openvino-lcm-models.txt +++ b/configs/openvino-lcm-models.txt @@ -1,26 +1,9 @@ -Disty0/LCM_SoteMix -Disty0/SoteMixV3 -FFusion/FFusionXL-BASE -anokimchen/sd-turbo-openvino-8bit-GPT4vision-calibrated -anokimchen/sd-turbo-openvino-8bit-no-calibration -anokimchen/tiny-sd-openvino -helenai/Lykon-DreamShaper-ov -helenai/SimianLuo-LCM_Dreamshaper_v7-ov -helenai/eimiss-EimisAnimeDiffusion_1.0v-ov -helenai/hakurei-waifu-diffusion-ov -helenai/lambdalabs-sd-pokemon-diffusers-ov -helenai/naclbit-trinart_stable_diffusion_v2-ov -helenai/nitrosocke-Nitro-Diffusion-ov -helenai/prompthero-openjourney-ov -helenai/runwayml-stable-diffusion-v1-5-ov -helenai/wavymulder-Analog-Diffusion-ov -helenai/wavymulder-portraitplus-ov -rupeshs/FLUX.1-schnell-openvino-int4 -rupeshs/LCM-dreamshaper-v7-openvino -rupeshs/SDXL-Lightning-2steps-openvino-int8 -rupeshs/hyper-sd-sdxl-1-step-openvino-int8 rupeshs/sd-turbo-openvino -rupeshs/sd15-lcm-square-openvino-int8 -rupeshs/sdxl-turbo-openvino-int8 rupeshs/sdxs-512-0.9-openvino -yuyuyu09/animagine-xl-3.0-openvino +rupeshs/hyper-sd-sdxl-1-step-openvino-int8 +rupeshs/SDXL-Lightning-2steps-openvino-int8 +rupeshs/sdxl-turbo-openvino-int8 +rupeshs/LCM-dreamshaper-v7-openvino +Disty0/LCM_SoteMix +rupeshs/FLUX.1-schnell-openvino-int4 +rupeshs/sd15-lcm-square-openvino-int8 \ No newline at end of file diff --git a/configs/stable-diffusion-models.txt b/configs/stable-diffusion-models.txt index c88fd52..d5d21c9 100755 --- a/configs/stable-diffusion-models.txt +++ b/configs/stable-diffusion-models.txt @@ -4,5 +4,4 @@ stabilityai/stable-diffusion-xl-base-1.0 runwayml/stable-diffusion-v1-5 segmind/SSD-1B stablediffusionapi/anything-v5 -prompthero/openjourney-v4 -aipicasso/commonart-beta +prompthero/openjourney-v4 \ No newline at end of file diff --git a/src/app.py b/src/app.py index 76f1ced..f83bd86 100644 --- a/src/app.py +++ b/src/app.py @@ -251,6 +251,12 @@ help="Web server port", default=8000, ) +parser.add_argument( + "--root_path", + type=str, + help="Web server root path", + default=None, +) args = parser.parse_args() @@ -302,6 +308,7 @@ print("Starting web UI mode") start_webui( args.share, + args.root_path, ) elif args.realtime: from frontend.webui.realtime_ui import start_realtime_text_to_image diff --git a/src/frontend/webui/ui.py b/src/frontend/webui/ui.py index fdbc133..8266ee3 100644 --- a/src/frontend/webui/ui.py +++ b/src/frontend/webui/ui.py @@ -84,7 +84,8 @@ def change_mode(mode): def start_webui( share: bool = False, + root_path: str = "/", ): webui = get_web_ui() webui.queue() - webui.launch(share=share) + webui.launch(share=share,root_path=root_path) diff --git a/start-webui.sh b/start-webui.sh index 20f4301..2804ac7 100755 --- a/start-webui.sh +++ b/start-webui.sh @@ -23,4 +23,24 @@ echo "Python version : $python_version" BASEDIR=$(pwd) # shellcheck disable=SC1091 source "$BASEDIR/env/bin/activate" -$PYTHON_COMMAND src/app.py -w + +## https://qiita.com/ko1nksm/items/7d37852b9fc581b1266e +abort() { echo "$*" >&2; exit 1; } +unknown() { abort "unrecognized option '$1'"; } +required() { [ $# -gt 1 ] || abort "option '$1' requires an argument"; } + +OPTION_SHARE='' +OPTION_ROOT_PATH='' + +while [ $# -gt 0 ]; do + case $1 in + -s | --share ) OPTION_SHARE=' --share' ;; + -r | --root_path ) required "$@" && shift; OPTION_ROOT_PATH=' --root_path='$1 ;; + -h | --help ) abort "usage : $(basename $0) [--share] [--root_path=\"/(path)\"]" ;; + -?*) unknown "$@" ;; + *) break + esac + shift +done + +$PYTHON_COMMAND src/app.py -w ${OPTION_SHARE} ${OPTION_ROOT_PATH} From 007f637be557bfb3c136445911d054479523dd81 Mon Sep 17 00:00:00 2001 From: tknr Date: Sun, 15 Sep 2024 19:44:46 +0900 Subject: [PATCH 7/8] added options treatments to start-webui.sh --- configs/lcm-lora-models.txt | 0 configs/lcm-models.txt | 0 configs/openvino-lcm-models.txt | 2 +- configs/stable-diffusion-models.txt | 2 +- controlnet_models/Readme.txt | 0 lora_models/Readme.txt | 0 6 files changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 configs/lcm-lora-models.txt mode change 100755 => 100644 configs/lcm-models.txt mode change 100755 => 100644 configs/openvino-lcm-models.txt mode change 100755 => 100644 configs/stable-diffusion-models.txt mode change 100755 => 100644 controlnet_models/Readme.txt mode change 100755 => 100644 lora_models/Readme.txt diff --git a/configs/lcm-lora-models.txt b/configs/lcm-lora-models.txt old mode 100755 new mode 100644 diff --git a/configs/lcm-models.txt b/configs/lcm-models.txt old mode 100755 new mode 100644 diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt old mode 100755 new mode 100644 index b43450a..656096d --- a/configs/openvino-lcm-models.txt +++ b/configs/openvino-lcm-models.txt @@ -6,4 +6,4 @@ rupeshs/sdxl-turbo-openvino-int8 rupeshs/LCM-dreamshaper-v7-openvino Disty0/LCM_SoteMix rupeshs/FLUX.1-schnell-openvino-int4 -rupeshs/sd15-lcm-square-openvino-int8 +rupeshs/sd15-lcm-square-openvino-int8 \ No newline at end of file diff --git a/configs/stable-diffusion-models.txt b/configs/stable-diffusion-models.txt old mode 100755 new mode 100644 index 5cba142..d5d21c9 --- a/configs/stable-diffusion-models.txt +++ b/configs/stable-diffusion-models.txt @@ -4,4 +4,4 @@ stabilityai/stable-diffusion-xl-base-1.0 runwayml/stable-diffusion-v1-5 segmind/SSD-1B stablediffusionapi/anything-v5 -prompthero/openjourney-v4 +prompthero/openjourney-v4 \ No newline at end of file diff --git a/controlnet_models/Readme.txt b/controlnet_models/Readme.txt old mode 100755 new mode 100644 diff --git a/lora_models/Readme.txt b/lora_models/Readme.txt old mode 100755 new mode 100644 From 091b7d35d1bbd5dd5a515a37143fc4e339fbaed4 Mon Sep 17 00:00:00 2001 From: tknr Date: Wed, 18 Sep 2024 23:38:18 +0900 Subject: [PATCH 8/8] cli shell --- Readme.md | 4 +--- configs/openvino-lcm-models.txt | 3 ++- fastsdcpu_cli.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100755 fastsdcpu_cli.sh diff --git a/Readme.md b/Readme.md index ba6420e..434a88d 100644 --- a/Readme.md +++ b/Readme.md @@ -509,9 +509,7 @@ Due to the limitation of using CPU/OpenVINO inside colab, we are using GPU with ##### Linux users - `source env/bin/activate` - -Start CLI `src/app.py -h` +Start CLI `bash fastsdcpu_cli.sh -h` diff --git a/configs/openvino-lcm-models.txt b/configs/openvino-lcm-models.txt index 656096d..023335f 100644 --- a/configs/openvino-lcm-models.txt +++ b/configs/openvino-lcm-models.txt @@ -6,4 +6,5 @@ rupeshs/sdxl-turbo-openvino-int8 rupeshs/LCM-dreamshaper-v7-openvino Disty0/LCM_SoteMix rupeshs/FLUX.1-schnell-openvino-int4 -rupeshs/sd15-lcm-square-openvino-int8 \ No newline at end of file +rupeshs/sd15-lcm-square-openvino-int8 + diff --git a/fastsdcpu_cli.sh b/fastsdcpu_cli.sh new file mode 100755 index 0000000..1f1f5a8 --- /dev/null +++ b/fastsdcpu_cli.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +cd $(dirname $0) +echo Starting FastSD CPU please wait... +set -e +PYTHON_COMMAND="python3" + +if ! command -v python3 &>/dev/null; then + if ! command -v python &>/dev/null; then + echo "Error: Python not found, please install python 3.8 or higher and try again" + exit 1 + fi +fi + +if command -v python &>/dev/null; then + PYTHON_COMMAND="python" +fi + +echo "Found $PYTHON_COMMAND command" + +python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}') +echo "Python version : $python_version" + +BASEDIR=$(pwd) +# shellcheck disable=SC1091 +source "$BASEDIR/env/bin/activate" +$PYTHON_COMMAND src/app.py $@