diff --git a/pyproject.toml b/pyproject.toml index cf0cfd1..cba355f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dddetailer" -version = "23.4.0" +version = "23.4.1" description = "An object detection and auto-mask extension for Stable Diffusion web UI." authors = [ {name = "dowon", email = "ks2515@naver.com"}, diff --git a/scripts/ddetailer.py b/scripts/ddetailer.py index 24b53f7..5860f47 100644 --- a/scripts/ddetailer.py +++ b/scripts/ddetailer.py @@ -56,6 +56,12 @@ def list_models(model_path): def startup(): + from launch import is_installed, run, python + + if not is_installed("mmdet"): + run(f'"{python}" -m pip install openmim', desc="Installing openmim", errdesc="Couldn't install openmim") + run(f'"{python}" -m mim install mmcv>=2.0.0 mmdet>=3.0.0', desc="Installing mmdet", errdesc="Couldn't install mmdet") + if len(list_models(dd_models_path)) == 0: print("No detection models found, downloading...") bbox_path = os.path.join(dd_models_path, "bbox")