forked from lllyasviel/Fooocus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargs_manager.py
31 lines (23 loc) · 1.25 KB
/
args_manager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from fcbh.options import enable_args_parsing
enable_args_parsing(False)
import fcbh.cli_args as fcbh_cli
fcbh_cli.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
fcbh_cli.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
fcbh_cli.parser.add_argument("--language", type=str, default='default',
help="Translate UI using json files in [language] folder. "
"For example, [--language example] will use [language/example.json] for translation.")
# For example, https://github.com/lllyasviel/Fooocus/issues/849
fcbh_cli.parser.add_argument("--enable-smart-memory", action="store_true",
help="Force loading models to vram when the unload can be avoided. "
"Some Mac users may need this.")
fcbh_cli.parser.set_defaults(
disable_cuda_malloc=True,
auto_launch=True,
port=None
)
fcbh_cli.args = fcbh_cli.parser.parse_args()
# (beta, enabled by default. )
# (Probably disable by default because of issues like https://github.com/lllyasviel/Fooocus/issues/724)
if fcbh_cli.args.enable_smart_memory:
fcbh_cli.args.disable_smart_memory = False
args = fcbh_cli.args