Update launch.py
Browse files
launch.py
CHANGED
@@ -26,21 +26,19 @@ prepare_environment = launch_utils.prepare_environment
|
|
26 |
configure_for_tests = launch_utils.configure_for_tests
|
27 |
start = launch_utils.start
|
28 |
|
|
|
|
|
29 |
|
30 |
def main():
|
31 |
if not args.skip_prepare_environment:
|
32 |
-
prepare_environment()
|
33 |
-
|
34 |
-
|
35 |
-
subprocess.run(['sed', '-i', '-e', 's/stable/dict()))/dict())).cuda()/g', '/bushu/ui/repositories/diffusion-stability-stable/ldm/util.py'], stdout=devnull, stderr=devnull)
|
36 |
|
37 |
if args.test_server:
|
38 |
-
configure_for_tests()
|
39 |
|
40 |
-
start()
|
41 |
|
42 |
-
__name__ == "__main__"
|
43 |
-
|
44 |
-
Start = True
|
45 |
-
if Start:
|
46 |
main()
|
|
|
26 |
configure_for_tests = launch_utils.configure_for_tests
|
27 |
start = launch_utils.start
|
28 |
|
29 |
+
def run_command(command):
|
30 |
+
subprocess.run(command, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
31 |
|
32 |
def main():
|
33 |
if not args.skip_prepare_environment:
|
34 |
+
launch_utils.prepare_environment()
|
35 |
+
run_command(f"""sed -i -e ''"s/dict()))/dict())).cuda()/g"'' /bushu/ui/repositories/stable-diffusion-stability-ai/ldm/util.py""")
|
36 |
+
run_command(f"""sed -i -e ''"s/stable/dict()))/dict())).cuda()/g"'' /bushu/ui/repositories/diffusion-stability-stable/ldm/util.py""")
|
|
|
37 |
|
38 |
if args.test_server:
|
39 |
+
launch_utils.configure_for_tests()
|
40 |
|
41 |
+
launch_utils.start()
|
42 |
|
43 |
+
if __name__ == "__main__":
|
|
|
|
|
|
|
44 |
main()
|