Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
fix: add fallback path to deepdanbooru models #36
Browse files Browse the repository at this point in the history
  • Loading branch information
toriato committed Jan 3, 2023
1 parent ce43eb7 commit d5ea1aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion preload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
)
3 changes: 2 additions & 1 deletion scripts/tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit d5ea1aa

Please sign in to comment.