Browse Source

Only parse command line args when main.py is called.

pull/1508/head
comfyanonymous 1 year ago
parent
commit
3039b08eb1
  1. 5
      comfy/cli_args.py
  2. 6
      comfy/options.py
  3. 3
      main.py

5
comfy/cli_args.py

@ -1,6 +1,6 @@
import argparse import argparse
import enum import enum
import comfy.options
class EnumAction(argparse.Action): class EnumAction(argparse.Action):
""" """
@ -94,7 +94,10 @@ parser.add_argument("--windows-standalone-build", action="store_true", help="Win
parser.add_argument("--disable-metadata", action="store_true", help="Disable saving prompt metadata in files.") parser.add_argument("--disable-metadata", action="store_true", help="Disable saving prompt metadata in files.")
if comfy.options.args_parsing:
args = parser.parse_args() args = parser.parse_args()
else:
args = parser.parse_args([])
if args.windows_standalone_build: if args.windows_standalone_build:
args.auto_launch = True args.auto_launch = True

6
comfy/options.py

@ -0,0 +1,6 @@
args_parsing = False
def enable_args_parsing(enable=True):
global args_parsing
args_parsing = enable

3
main.py

@ -1,3 +1,6 @@
import comfy.options
comfy.options.enable_args_parsing()
import os import os
import importlib.util import importlib.util
import folder_paths import folder_paths

Loading…
Cancel
Save