Spaces:
Runtime error
Runtime error
Delete args_manager.py
Browse files- args_manager.py +0 -55
args_manager.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
| 1 |
-
import ldm_patched.modules.args_parser as args_parser
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
from tempfile import gettempdir
|
| 5 |
-
|
| 6 |
-
args_parser.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
|
| 7 |
-
args_parser.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
|
| 8 |
-
|
| 9 |
-
args_parser.parser.add_argument("--language", type=str, default='default',
|
| 10 |
-
help="Translate UI using json files in [language] folder. "
|
| 11 |
-
"For example, [--language example] will use [language/example.json] for translation.")
|
| 12 |
-
|
| 13 |
-
# For example, https://github.com/lllyasviel/Fooocus/issues/849
|
| 14 |
-
args_parser.parser.add_argument("--disable-offload-from-vram", action="store_true",
|
| 15 |
-
help="Force loading models to vram when the unload can be avoided. "
|
| 16 |
-
"Some Mac users may need this.")
|
| 17 |
-
|
| 18 |
-
args_parser.parser.add_argument("--theme", type=str, help="launches the UI with light or dark theme", default=None)
|
| 19 |
-
args_parser.parser.add_argument("--disable-image-log", action='store_true',
|
| 20 |
-
help="Prevent writing images and logs to hard drive.")
|
| 21 |
-
|
| 22 |
-
args_parser.parser.add_argument("--disable-analytics", action='store_true',
|
| 23 |
-
help="Disables analytics for Gradio.")
|
| 24 |
-
|
| 25 |
-
args_parser.parser.add_argument("--disable-metadata", action='store_true',
|
| 26 |
-
help="Disables saving metadata to images.")
|
| 27 |
-
|
| 28 |
-
args_parser.parser.add_argument("--disable-preset-download", action='store_true',
|
| 29 |
-
help="Disables downloading models for presets", default=False)
|
| 30 |
-
|
| 31 |
-
args_parser.parser.add_argument("--always-download-new-model", action='store_true',
|
| 32 |
-
help="Always download newer models ", default=False)
|
| 33 |
-
|
| 34 |
-
args_parser.parser.set_defaults(
|
| 35 |
-
disable_cuda_malloc=True,
|
| 36 |
-
in_browser=True,
|
| 37 |
-
port=None
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
args_parser.args = args_parser.parser.parse_args()
|
| 41 |
-
|
| 42 |
-
# (Disable by default because of issues like https://github.com/lllyasviel/Fooocus/issues/724)
|
| 43 |
-
args_parser.args.always_offload_from_vram = not args_parser.args.disable_offload_from_vram
|
| 44 |
-
|
| 45 |
-
if args_parser.args.disable_analytics:
|
| 46 |
-
import os
|
| 47 |
-
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
|
| 48 |
-
|
| 49 |
-
if args_parser.args.disable_in_browser:
|
| 50 |
-
args_parser.args.in_browser = False
|
| 51 |
-
|
| 52 |
-
if args_parser.args.temp_path is None:
|
| 53 |
-
args_parser.args.temp_path = os.path.join(gettempdir(), 'Fooocus')
|
| 54 |
-
|
| 55 |
-
args = args_parser.args
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|