From f195230e2a33935ec80d52e3d79c082146b3d478 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Fri, 9 Feb 2024 01:40:27 -0800 Subject: [PATCH] More tweaks to cli args --- comfy/cli_args.py | 6 ++---- comfy/cli_args_types.py | 4 ++-- comfy/cmd/main.py | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/comfy/cli_args.py b/comfy/cli_args.py index 6ece40bf9..4a829b78f 100644 --- a/comfy/cli_args.py +++ b/comfy/cli_args.py @@ -124,15 +124,13 @@ parser.add_argument("--distributed-queue-connection-uri", type=str, default=None parser.add_argument( '--distributed-queue-worker', required=False, - type=bool, - default=True, + action="store_true", help='Workers will pull requests off the AMQP URL.' ) parser.add_argument( '--distributed-queue-frontend', required=False, - type=bool, - default=True, + action="store_true", help='Frontends will start the web UI and connect to the provided AMQP URL to submit prompts.' ) parser.add_argument("--distributed-queue-name", type=str, default="comfyui", diff --git a/comfy/cli_args_types.py b/comfy/cli_args_types.py index 9be14b0a9..b67f04873 100644 --- a/comfy/cli_args_types.py +++ b/comfy/cli_args_types.py @@ -132,8 +132,8 @@ class Configuration(dict): self.write_out_config_file: bool = False self.create_directories: bool = False self.distributed_queue_connection_uri: Optional[str] = None - self.distributed_queue_worker: bool = True - self.distributed_queue_frontend: bool = True + self.distributed_queue_worker: bool = False + self.distributed_queue_frontend: bool = False self.distributed_queue_name: str = "comfyui" for key, value in kwargs.items(): self[key] = value diff --git a/comfy/cmd/main.py b/comfy/cmd/main.py index cacdc8bc1..192843e2f 100644 --- a/comfy/cmd/main.py +++ b/comfy/cmd/main.py @@ -298,8 +298,9 @@ async def main(): try: await run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start) - except KeyboardInterrupt: - await q.close() + except asyncio.CancelledError: + if distributed: + await q.close() print("\nStopped server") cleanup_temp()