Skip to content

Commit

Permalink
Use configargparse to give the option to use config files
Browse files Browse the repository at this point in the history
  • Loading branch information
Le09 committed Aug 14, 2024
1 parent f1d6cef commit 6205142
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.comfyui.rc
__pycache__/
*.py[cod]
/output/
Expand Down
6 changes: 4 additions & 2 deletions comfy/cli_args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import argparse
import configargparse as argparse
import enum
import os
from typing import Optional
Expand Down Expand Up @@ -34,7 +34,9 @@ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, value)


parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(default_config_files=["./.comfyui.rc", "~/.comfyui.rc"])

parser.add("-c", "--config", is_config_file=True, help="config file path")

parser.add_argument("--listen", type=str, default="127.0.0.1", metavar="IP", nargs="?", const="0.0.0.0", help="Specify the IP address to listen on (default: 127.0.0.1). If --listen is provided without an argument, it defaults to 0.0.0.0. (listens on all)")
parser.add_argument("--port", type=int, default=8188, help="Set the listen port.")
Expand Down

0 comments on commit 6205142

Please sign in to comment.