diff --git a/extensions-builtin/Lora/ui_extra_networks_lora.py b/extensions-builtin/Lora/ui_extra_networks_lora.py index 68b113323..2e84f9b5f 100644 --- a/extensions-builtin/Lora/ui_extra_networks_lora.py +++ b/extensions-builtin/Lora/ui_extra_networks_lora.py @@ -28,4 +28,3 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage): def allowed_directories_for_previews(self): return [shared.cmd_opts.lora_dir] - diff --git a/extensions-builtin/sd-extension-system-info b/extensions-builtin/sd-extension-system-info index be495d02e..32e205d07 160000 --- a/extensions-builtin/sd-extension-system-info +++ b/extensions-builtin/sd-extension-system-info @@ -1 +1 @@ -Subproject commit be495d02ef8eac8c16542080426ba74c3a42839e +Subproject commit 32e205d07442f866d46a7d5c767d19fa486726ef diff --git a/modules/cmd_args.py b/modules/cmd_args.py index e2e15d361..e7365afd9 100644 --- a/modules/cmd_args.py +++ b/modules/cmd_args.py @@ -21,18 +21,6 @@ parser.add_argument("--lowram", action='store_true', help="Load checkpoint weigh parser.add_argument("--ckpt", type=str, default=sd_model_file, help="Path to checkpoint of stable diffusion model to load immediately",) parser.add_argument('--vae', type=str, help='Path to checkpoint of stable diffusion VAE model to load immediately', default=None) parser.add_argument("--data-dir", type=str, default=os.path.dirname(os.path.dirname(os.path.realpath(__file__))), help="Base path where all user data is stored") -# parser.add_argument("--ckpt-dir", type=str, default=None, help="Path to directory with stable diffusion checkpoints") -# parser.add_argument("--vae-dir", type=str, default=None, help="Path to directory with VAE files") -# parser.add_argument("--gfpgan-model", type=str, help="GFPGAN model file name", default=None) -# parser.add_argument("--embeddings-dir", type=str, default=os.path.join(data_path, 'models/embeddings'), help="embeddings directory for textual inversion (default: embeddings)") -# parser.add_argument("--embeddings-templates-dir", type=str, default=os.path.join(script_path, 'train/templates'), help="directory with textual inversion templates") -# parser.add_argument("--hypernetwork-dir", type=str, default=os.path.join(models_path, 'hypernetworks'), help="hypernetwork directory") -# parser.add_argument("--codeformer-models-path", type=str, help="Path to directory with codeformer model file(s).", default=os.path.join(models_path, 'Codeformer')) -# parser.add_argument("--gfpgan-models-path", type=str, help="Path to directory with GFPGAN model file(s).", default=os.path.join(models_path, 'GFPGAN')) -# parser.add_argument("--esrgan-models-path", type=str, help="Path to directory with ESRGAN model file(s).", default=os.path.join(models_path, 'ESRGAN')) -# parser.add_argument("--bsrgan-models-path", type=str, help="Path to directory with BSRGAN model file(s).", default=os.path.join(models_path, 'BSRGAN')) -# parser.add_argument("--realesrgan-models-path", type=str, help="Path to directory with RealESRGAN model file(s).", default=os.path.join(models_path, 'RealESRGAN')) -# parser.add_argument("--clip-models-path", type=str, help="Path to directory with CLIP model file(s).", default=None) parser.add_argument("--allow-code", action='store_true', help="Allow custom script execution") parser.add_argument("--share", action='store_true', help="Enable to make the UI accessible through Gradio site") @@ -58,3 +46,20 @@ parser.add_argument("--server-name", type=str, help="Sets hostname of server", d parser.add_argument("--no-hashing", action='store_true', help="Disable sha256 hashing of checkpoints", default=False) parser.add_argument("--no-download-sd-model", action='store_true', help="Disable download of default model even if no model is found", default=False) parser.add_argument("--profile", action='store_true', help="Run profiler, default: %(default)s") + + +def compatibility_args(opts, args): + parser.add_argument("--ckpt-dir", type=str, help=argparse.SUPPRESS, default=opts.ckpt_dir) + parser.add_argument("--vae-dir", type=str, help=argparse.SUPPRESS, default=opts.vae_dir) + parser.add_argument("--embeddings-dir", type=str, help=argparse.SUPPRESS, default=opts.embeddings_dir) + parser.add_argument("--embeddings-templates-dir", type=str, help=argparse.SUPPRESS, default=opts.embeddings_templates_dir) + parser.add_argument("--hypernetwork-dir", type=str, help=argparse.SUPPRESS, default=opts.hypernetwork_dir) + parser.add_argument("--codeformer-models-path", type=str, help=argparse.SUPPRESS, default=opts.codeformer_models_path) + parser.add_argument("--gfpgan-models-path", type=str, help=argparse.SUPPRESS, default=opts.gfpgan_models_path) + parser.add_argument("--esrgan-models-path", type=str, help=argparse.SUPPRESS, default=opts.esrgan_models_path) + parser.add_argument("--bsrgan-models-path", type=str, help=argparse.SUPPRESS, default=opts.bsrgan_models_path) + parser.add_argument("--realesrgan-models-path", type=str, help=argparse.SUPPRESS, default=opts.realesrgan_models_path) + parser.add_argument("--clip-models-path", type=str, help=argparse.SUPPRESS, default=opts.clip_models_path) + if vars(parser)['_option_string_actions'].get('--lora-dir', None) is not None: + args.lora_dir = opts.lora_dir + return args diff --git a/modules/shared.py b/modules/shared.py index d241e31f1..ac0fe9c26 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -5,8 +5,6 @@ import os import sys import time -from setup import log as setup_log - import gradio as gr import tqdm @@ -18,6 +16,7 @@ from modules import script_loading, errors, ui_components, shared_items, cmd_arg from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir demo = None +from setup import log as setup_log # pylint: disable=E0611 log = setup_log parser = cmd_args.parser @@ -256,6 +255,7 @@ options_templates.update(options_section(('system-paths', "System Paths"), { "bsrgan_models_path": OptionInfo(os.path.join(models_path, 'BSRGAN'), "Path to directory with BSRGAN model file(s)"), "realesrgan_models_path": OptionInfo(os.path.join(models_path, 'RealESRGAN'), "Path to directory with RealESRGAN model file(s)"), "clip_models_path": OptionInfo(os.path.join(models_path, 'CLIP'), "Path to directory with CLIP model file(s)"), + "lora_dir": OptionInfo(os.path.join(models_path, 'Lora'), "Path to directory with Lora network(s)"), # "gfpgan_model": OptionInfo("", "GFPGAN model file name"), })) @@ -583,6 +583,8 @@ loaded_hypernetworks = [] if os.path.exists(config_filename): opts.load(config_filename) +cmd_opts = cmd_args.compatibility_args(opts, cmd_opts) + settings_components = None """assinged from ui.py, a mapping on setting anmes to gradio components repsponsible for those settings""" diff --git a/user.css b/user.css index 6d53897ad..83e7e55da 100644 --- a/user.css +++ b/user.css @@ -1,6 +1,7 @@ /* generic html tags */ +:root { --font: system-ui, "Segoe UI", "Roboto", "sans-serif"; } html { font-size: 16px; } -body, button, input, select, textarea { font-family: "Segoe UI"; font-variant: small-caps; overflow-x: hidden; } +body, button, input, select, textarea { font-family: var(--font); overflow-x: hidden; } button { font-size: 1.2rem; } img { background-color: black; } input[type=range] { height: 18px; appearance: none; margin-top: 0; min-width: 160px; background-color: black; width: 100%; background: transparent; } @@ -17,7 +18,7 @@ div.form { border-width: 0; box-shadow: none; background: transparent; overflow: div.gradio-container.dark > div.w-full.flex.flex-col.min-h-screen > div { background-color: black; } /* gradio shadowroot */ -.gradio-container { font-family: "Segoe UI"; font-variant: small-caps; --left-column: 490px; --highlight-color: #CE6400; --inactive-color: #4E1400; } +.gradio-container { font-family: var(--font); --left-column: 490px; --highlight-color: #CE6400; --inactive-color: #4E1400; } /* gradio style classes */ .border-2 { border-width: 0; }