Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

build_launcher.py 838 B

You have to be logged in to leave a comment. Sign In
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
  1. import os
  2. win32_root = os.path.dirname(os.path.dirname(__file__))
  3. python_embeded_path = os.path.join(win32_root, 'python_embeded')
  4. is_win32_standalone_build = os.path.exists(python_embeded_path) and os.path.isdir(python_embeded_path)
  5. win32_cmd = '''
  6. .\python_embeded\python.exe -s Fooocus\entry_with_update.py {cmds} %*
  7. pause
  8. '''
  9. def build_launcher():
  10. if not is_win32_standalone_build:
  11. return
  12. presets = [None, 'anime', 'realistic']
  13. for preset in presets:
  14. win32_cmd_preset = win32_cmd.replace('{cmds}', '' if preset is None else f'--preset {preset}')
  15. bat_path = os.path.join(win32_root, 'run.bat' if preset is None else f'run_{preset}.bat')
  16. if not os.path.exists(bat_path):
  17. with open(bat_path, "w", encoding="utf-8") as f:
  18. f.write(win32_cmd_preset)
  19. return
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...