forked from metercai/SimpleSDXL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_launcher.py
28 lines (21 loc) · 976 Bytes
/
build_launcher.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
import os
win32_root = os.path.dirname(os.path.dirname(__file__))
python_embeded_path = os.path.join(win32_root, 'python_embeded')
is_win32_standalone_build = os.path.exists(python_embeded_path) and os.path.isdir(python_embeded_path)
win32_cmd = '''
@echo off
.\python_embeded\python.exe -s FooocusPlus\{cmds} %*
echo All done.
pause
'''
def build_launcher():
if not is_win32_standalone_build:
return
branches = {"FooocusPlus": "entry_with_update.py", "FooocusPlus_dev": "entry_with_update.py --dev", "FooocusPlus_without_update": "launch.py", "FooocusPlus_commit": "launch_with_commit.py 56e5200"}
for (name, cmd) in branches.items():
win32_cmd_preset = win32_cmd.replace('{cmds}', f'{cmd}')
bat_path = os.path.join(win32_root, f'run_{name}.bat')
if not os.path.exists(bat_path) or name=='FooocusPlus_commit':
with open(bat_path, "w", encoding="utf-8") as f:
f.write(win32_cmd_preset)
return