diff --git a/preload.py b/preload.py index f70b955..de16bce 100644 --- a/preload.py +++ b/preload.py @@ -3,6 +3,8 @@ from modules.shared import models_path +default_ddp_path = Path(models_path, 'deepdanbooru') + def preload(parser: ArgumentParser): # default deepdanbooru use different paths: @@ -13,5 +15,5 @@ def preload(parser: ArgumentParser): '--deepdanbooru-projects-path', type=str, help='Path to directory with DeepDanbooru project(s).', - default=Path(models_path, 'deepdanbooru') + default=default_ddp_path ) diff --git a/scripts/tagger.py b/scripts/tagger.py index c70d511..b81d0e3 100644 --- a/scripts/tagger.py +++ b/scripts/tagger.py @@ -11,6 +11,7 @@ from modules import shared, scripts, script_callbacks, ui from modules import generation_parameters_copypaste as parameters_copypaste +from preload import default_ddp_path from tagger import format from tagger.preset import Preset from tagger.interrogator import Interrogator, DeepDanbooruInterrogator, WaifuDiffusionInterrogator @@ -42,7 +43,7 @@ def refresh_interrogators() -> List[str]: # load deepdanbooru project os.makedirs( - shared.cmd_opts.deepdanbooru_projects_path, + getattr(shared.cmd_opts, 'deepdanbooru_projects_path', default_ddp_path), exist_ok=True )