Skip to content

Commit ccf1a15

Browse files
committed
add an option to enable installing extensions with --listen or --share
1 parent 5f01171 commit ccf1a15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/shared.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site")
4545
parser.add_argument("--ngrok", type=str, help="ngrok authtoken, alternative to gradio --share", default=None)
4646
parser.add_argument("--ngrok-region", type=str, help="The region in which ngrok should start.", default="us")
47+
parser.add_argument("--enable-insecure-extension-access", action='store_true', help="enable extensions tab regardless of other options")
4748
parser.add_argument("--codeformer-models-path", type=str, help="Path to directory with codeformer model file(s).", default=os.path.join(models_path, 'Codeformer'))
4849
parser.add_argument("--gfpgan-models-path", type=str, help="Path to directory with GFPGAN model file(s).", default=os.path.join(models_path, 'GFPGAN'))
4950
parser.add_argument("--esrgan-models-path", type=str, help="Path to directory with ESRGAN model file(s).", default=os.path.join(models_path, 'ESRGAN'))
@@ -99,7 +100,7 @@
99100
"outdir_save",
100101
}
101102

102-
cmd_opts.disable_extension_access = cmd_opts.share or cmd_opts.listen
103+
cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen) and not cmd_opts.enable_insecure_extension_access
103104

104105
devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_swinir, devices.device_esrgan, devices.device_scunet, devices.device_codeformer = \
105106
(devices.cpu if any(y in cmd_opts.use_cpu for y in [x, 'all']) else devices.get_optimal_device() for x in ['sd', 'interrogate', 'gfpgan', 'swinir', 'esrgan', 'scunet', 'codeformer'])

0 commit comments

Comments
 (0)