From 21383489a7933ad912d7fb0ecef961ee314dbc85 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 11 Sep 2024 17:13:41 +0900 Subject: [PATCH] Add validation. --- comfy/cli_args.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/cli_args.py b/comfy/cli_args.py index 75b19c0096c..d0f7064320e 100644 --- a/comfy/cli_args.py +++ b/comfy/cli_args.py @@ -47,7 +47,6 @@ def __call__(self, parser, namespace, values, option_string=None): parser.add_argument("--output-directory", type=str, default=None, help="Set the ComfyUI output directory.") parser.add_argument("--temp-directory", type=str, default=None, help="Set the ComfyUI temp directory (default is in the ComfyUI directory).") parser.add_argument("--input-directory", type=str, default=None, help="Set the ComfyUI input directory.") -parser.add_argument("--user-directory", type=str, default=None, help="Set the ComfyUI user directory.") parser.add_argument("--auto-launch", action="store_true", help="Automatically launch ComfyUI in the default browser.") parser.add_argument("--disable-auto-launch", action="store_true", help="Disable auto launching the browser.") parser.add_argument("--cuda-device", type=int, default=None, metavar="DEVICE_ID", help="Set the id of the cuda device this instance will use.") @@ -172,6 +171,8 @@ def is_valid_directory(path: Optional[str]) -> Optional[str]: help="The local filesystem path to the directory where the frontend is located. Overrides --front-end-version.", ) +parser.add_argument("--user-directory", type=is_valid_directory, default=None, help="Set the ComfyUI user directory with an absolute path.") + if comfy.options.args_parsing: args = parser.parse_args() else: