From 9632dded9e15f2ee498fc610a564cf7e5ee47800 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 7 Aug 2024 12:20:02 -0700 Subject: [PATCH] Move server set up to right before run call. --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 32e93b08..b878b3e0 100644 --- a/main.py +++ b/main.py @@ -214,7 +214,6 @@ if __name__ == "__main__": loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) server = server.PromptServer(loop) - loop.run_until_complete(server.setup()) q = execution.PromptQueue(server) extra_model_paths_config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "extra_model_paths.yaml") @@ -262,6 +261,7 @@ if __name__ == "__main__": call_on_start = startup_server try: + loop.run_until_complete(server.setup()) loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start)) except KeyboardInterrupt: logging.info("\nStopped server")