From 3742d3b18a6beb4f8babf4195b9d04bc642e070b Mon Sep 17 00:00:00 2001 From: Tensa Date: Sat, 28 Jan 2023 03:38:34 +0900 Subject: [PATCH] Add listening port options for listening mode. --- server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index e70738e3..d7f41804 100644 --- a/server.py +++ b/server.py @@ -36,6 +36,7 @@ parser.add_argument('--no-stream', action='store_true', help='Don\'t stream the parser.add_argument('--settings', type=str, help='Load the default interface settings from this json file. See settings-template.json for an example.') parser.add_argument('--extensions', type=str, help='The list of extensions to load. If you want to load more than one extension, write the names separated by commas and between quotation marks, "like,this".') parser.add_argument('--listen', action='store_true', help='Make the web UI reachable from your local network.') +parser.add_argument('--listen-port', type=int, choices=range(0, 65535), help='The listening port the server will use.') parser.add_argument('--share', action='store_true', help='Create a public URL. This is useful for running the web UI on Google Colab or similar.') parser.add_argument('--verbose', action='store_true', help='Print the prompts to the terminal.') args = parser.parse_args() @@ -647,6 +648,6 @@ else: interface.queue() if args.listen: - interface.launch(share=args.share, server_name="0.0.0.0") + interface.launch(share=args.share, server_name="0.0.0.0", server_port=args.listen_port) else: interface.launch(share=args.share)