Skip to content

Commit

Permalink
feat: Allow support for custom wildcard directory in sd-dynamic-prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
azmodii committed Sep 2, 2023
1 parent 3e57842 commit 53f46c9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/shared_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@
except AttributeError:
LYCO_PATH = None


def find_ext_wildcard_paths():
"""Returns the path to the extension wildcards folder"""
found = list(EXT_PATH.glob("*/wildcards/"))
# Try to find the wildcard path from the shared opts
try:
from modules.shared import opts
except ImportError: # likely not in an a1111 context
opts = None

wildcard_dir = getattr(opts, "wildcard_dir", None)
if wildcard_dir is not None:
wildcard_dir = Path(wildcard_dir)
if wildcard_dir.exists():
found.append(wildcard_dir)
return found


Expand Down

0 comments on commit 53f46c9

Please sign in to comment.