forked from d8ahazard/sd_dreambooth_extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
35 lines (29 loc) · 913 Bytes
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import sys
debug = False
is_auto = False
try:
from modules import shared
is_auto = True
except:
pass
if not is_auto:
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
if debug:
print(f"Base dir (sdplus) is: {base_dir} from {__file__}")
ext_dir = os.path.join(base_dir, 'core', 'modules', 'dreambooth')
else:
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
if debug:
print(f"Base dir (auto1111) is: {base_dir} from {__file__}")
ext_dir = os.path.join(base_dir, 'extensions', 'sd_dreambooth_extension')
if ext_dir not in sys.path:
if debug:
print(f"Appending (install): {ext_dir}")
sys.path.insert(0, ext_dir)
else:
if debug:
print(f"Ext dir already in path? {ext_dir}")
print(sys.path)
from postinstall import actual_install
actual_install()