aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/preprocess.py
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-11-27 08:26:16 +0000
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2023-11-28 03:09:51 +0000
commit03ee297aa22296ea12b965fc1cb11aa46375d372 (patch)
tree83edb374cfb078ea535cacf2919579b274ac0012 /modules/textual_inversion/preprocess.py
parentf0f100e67b78f686dc73cf3c8cad422e45cc9b8a (diff)
downloadstable-diffusion-webui-gfx803-03ee297aa22296ea12b965fc1cb11aa46375d372.tar.gz
stable-diffusion-webui-gfx803-03ee297aa22296ea12b965fc1cb11aa46375d372.tar.bz2
stable-diffusion-webui-gfx803-03ee297aa22296ea12b965fc1cb11aa46375d372.zip
fix Auto focal point crop for opencv >= 4.8.x
autocrop.download_and_cache_models in opencv >= 4.8 the face detection model was updated download the base on opencv version returns the model path or raise exception
Diffstat (limited to 'modules/textual_inversion/preprocess.py')
-rw-r--r--modules/textual_inversion/preprocess.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/textual_inversion/preprocess.py b/modules/textual_inversion/preprocess.py
index dbd856bd..789fa083 100644
--- a/modules/textual_inversion/preprocess.py
+++ b/modules/textual_inversion/preprocess.py
@@ -3,7 +3,7 @@ from PIL import Image, ImageOps
import math
import tqdm
-from modules import paths, shared, images, deepbooru
+from modules import shared, images, deepbooru
from modules.textual_inversion import autocrop
@@ -196,7 +196,7 @@ def preprocess_work(process_src, process_dst, process_width, process_height, pre
dnn_model_path = None
try:
- dnn_model_path = autocrop.download_and_cache_models(os.path.join(paths.models_path, "opencv"))
+ dnn_model_path = autocrop.download_and_cache_models()
except Exception as e:
print("Unable to load face detection model for auto crop selection. Falling back to lower quality haar method.", e)