Use configargparse to give the option to use config files
This commit is contained in:
parent
f1d6cef71c
commit
cb82e8a528
|
@ -1,3 +1,4 @@
|
||||||
|
.comfyui.rc
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
/output/
|
/output/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import argparse
|
import configargparse as argparse
|
||||||
import enum
|
import enum
|
||||||
import os
|
import os
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
@ -34,7 +34,9 @@ class EnumAction(argparse.Action):
|
||||||
setattr(namespace, self.dest, value)
|
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("--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.")
|
parser.add_argument("--port", type=int, default=8188, help="Set the listen port.")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
configargparse
|
||||||
torch
|
torch
|
||||||
torchsde
|
torchsde
|
||||||
torchvision
|
torchvision
|
||||||
|
|
Loading…
Reference in New Issue