aboutsummaryrefslogtreecommitdiff
path: root/modules/paths.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-12 23:52:43 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-12 23:52:43 +0300
commitda464a3fb39ecc6ea7b22fe87271194480d8501c (patch)
treefd67d92762d0490d9d4784aaae3f2a3c2f31c6ca /modules/paths.py
parentaf081211ee93622473ee575de30fed2fd8263c09 (diff)
SDXL support
Diffstat (limited to 'modules/paths.py')
-rw-r--r--modules/paths.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/paths.py b/modules/paths.py
index f509a85f..1100a8dc 100644
--- a/modules/paths.py
+++ b/modules/paths.py
@@ -20,7 +20,7 @@ assert sd_path is not None, f"Couldn't find Stable Diffusion in any of: {possibl
path_dirs = [
(sd_path, 'ldm', 'Stable Diffusion', []),
- (os.path.join(sd_path, '../generative-models'), 'sgm', 'Stable Diffusion XL', []),
+ (os.path.join(sd_path, '../generative-models'), 'sgm', 'Stable Diffusion XL', ["sgm"]),
(os.path.join(sd_path, '../CodeFormer'), 'inference_codeformer.py', 'CodeFormer', []),
(os.path.join(sd_path, '../BLIP'), 'models/blip.py', 'BLIP', []),
(os.path.join(sd_path, '../k-diffusion'), 'k_diffusion/sampling.py', 'k_diffusion', ["atstart"]),
@@ -36,6 +36,13 @@ for d, must_exist, what, options in path_dirs:
d = os.path.abspath(d)
if "atstart" in options:
sys.path.insert(0, d)
+ elif "sgm" in options:
+ # Stable Diffusion XL repo has scripts dir with __init__.py in it which ruins every extension's scripts dir, so we
+ # import sgm and remove it from sys.path so that when a script imports scripts.something, it doesbn't use sgm's scripts dir.
+
+ sys.path.insert(0, d)
+ import sgm
+ sys.path.pop(0)
else:
sys.path.append(d)
paths[what] = d