From 32c7749a5f3b41918e20c41a249f6c5cfee27f2d Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Sun, 26 Mar 2023 16:32:20 +0200 Subject: [PATCH] Fallback for extensions dir Fixes #145 --- scripts/tag_autocomplete_helper.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index 9daf125..93c1e04 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -4,14 +4,20 @@ import gradio as gr from pathlib import Path from modules import scripts, script_callbacks, shared, sd_hijack -from modules.paths import script_path, extensions_dir import yaml -# Webui root path -FILE_DIR = Path(script_path) +try: + from modules.paths import script_path, extensions_dir + # Webui root path + FILE_DIR = Path(script_path) -# The extension base path -EXT_PATH = Path(extensions_dir) + # The extension base path + EXT_PATH = Path(extensions_dir) +except ImportError: + # Webui root path + FILE_DIR = Path().absolute() + # The extension base path + EXT_PATH = FILE_DIR.joinpath('extensions') # Tags base path TAGS_PATH = Path(scripts.basedir()).joinpath('tags')