diff --git a/launch.py b/launch.py index 8a03274e7..b6739bf5f 100644 --- a/launch.py +++ b/launch.py @@ -33,6 +33,16 @@ def init_modules(): extensions_dir = modules.paths_internal.extensions_dir +def get_custom_args(): + custom = {} + for arg in vars(args): + default = parser.get_default(arg) + current = getattr(args, arg) + if current != default: + custom[arg] = getattr(args, arg) + installer.log.info(f'Command line args: {custom}') + + @lru_cache() def commit_hash(): # compatbility function global stored_commit_hash # pylint: disable=global-statement @@ -133,6 +143,7 @@ def start_server(immediate=True, server=None): server = importlib.util.module_from_spec(module_spec) installer.log.debug(f'Starting module: {server}') installer.log.info(f"Server arguments: {sys.argv[1:]}") + get_custom_args() module_spec.loader.exec_module(server) if args.test: installer.log.info("Test only") diff --git a/modules/devices.py b/modules/devices.py index c1d49dd3d..f722a5020 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -62,7 +62,10 @@ def torch_gc(force=False): mem = memstats.memory_stats() gpu = mem.get('gpu', {}) oom = gpu.get('oom', 0) - used = round(100 * gpu.get('used', 0) / gpu.get('total', 1)) + if backend == "directml": + used = round(100 * torch.cuda.memory_allocated() / (1 << 30) / gpu.get('total', 1)) if gpu.get('total', 1) > 1 else 0 + else: + used = round(100 * gpu.get('used', 0) / gpu.get('total', 1)) if gpu.get('total', 1) > 1 else 0 global previous_oom # pylint: disable=global-statement if oom > previous_oom: previous_oom = oom @@ -70,9 +73,6 @@ def torch_gc(force=False): if used > 95: shared.log.info(f'GPU high memory utilization: {used}% {mem}') force = True - if backend == "directml": - practical_used = round(100 * torch.cuda.memory_allocated() / (1 << 30) / gpu.get('total', 1)) - shared.log.info(f'Practical GPU memory utilization: {practical_used}%') if not force: return collected = gc.collect() diff --git a/modules/shared.py b/modules/shared.py index e684fae31..fceb7c0e1 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -518,9 +518,9 @@ options_templates.update(options_section(('ui', "User Interface"), { "keyedit_precision_extra": OptionInfo(0.05, "Ctrl+up/down precision when editing ", gr.Slider, {"minimum": 0.01, "maximum": 0.2, "step": 0.001}), "keyedit_delimiters": OptionInfo(".,\/!?%^*;:{}=`~()", "Ctrl+up/down word delimiters"), # pylint: disable=anomalous-backslash-in-string "quicksettings_list": OptionInfo(["sd_model_checkpoint"], "Quicksettings list", ui_components.DropdownMulti, lambda: {"choices": list(opts.data_labels.keys())}), - "hidden_tabs": OptionInfo([], "Hidden UI tabs", ui_components.DropdownMulti, lambda: {"choices": list(tab_names)}), + # "hidden_tabs": OptionInfo([], "Hidden UI tabs", ui_components.DropdownMulti, lambda: {"choices": list(tab_names)}), # "ui_tab_reorder": OptionInfo("From Text, From Image, Process Image", "UI tabs order"), - "ui_scripts_reorder": OptionInfo("Enable Dynamic Thresholding, ControlNet", "UI scripts order"), + "ui_scripts_reorder": OptionInfo("", "UI scripts order"), })) options_templates.update(options_section(('live-preview', "Live Previews"), { diff --git a/modules/ui.py b/modules/ui.py index 949cdf275..8a29e3487 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1112,8 +1112,8 @@ def create_ui(startup_timer = None): for interface, label, ifid in interfaces: if interface is None: continue - if label in modules.shared.opts.hidden_tabs or label == '': - continue + # if label in modules.shared.opts.hidden_tabs or label == '': + # continue with gr.TabItem(label, id=ifid, elem_id=f"tab_{ifid}"): interface.render() for interface, _label, ifid in interfaces: