diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-05 16:37:11 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-05 16:37:11 +0000 |
commit | 064965c4660f57f24e2d51a9854defaeabf8c0cf (patch) | |
tree | a4f1a1cbe2a301ec3dde5d1231d7e1e124bbda70 /modules | |
parent | 5bb69bd915ff16fe233f887dba8c9ae8502d08d9 (diff) | |
download | stable-diffusion-webui-gfx803-064965c4660f57f24e2d51a9854defaeabf8c0cf.tar.gz stable-diffusion-webui-gfx803-064965c4660f57f24e2d51a9854defaeabf8c0cf.tar.bz2 stable-diffusion-webui-gfx803-064965c4660f57f24e2d51a9854defaeabf8c0cf.zip |
added --listen option to make gradio listen on network requests
Diffstat (limited to 'modules')
-rw-r--r-- | modules/shared.py | 1 | ||||
-rw-r--r-- | modules/ui.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py index 9e744f6c..70946fea 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -30,6 +30,7 @@ parser.add_argument("--precision", type=str, help="evaluate at this precision", parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site (doesn't work for me but you might have better luck)")
parser.add_argument("--esrgan-models-path", type=str, help="path to directory with ESRGAN models", default=os.path.join(script_path, 'ESRGAN'))
parser.add_argument("--opt-split-attention", action='store_true', help="enable optimization that reduced vram usage by a lot for about 10% decrease in performance")
+parser.add_argument("--listen", action='store_true', help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
cmd_opts = parser.parse_args()
cpu = torch.device("cpu")
diff --git a/modules/ui.py b/modules/ui.py index 0d70529c..ec583d14 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -27,7 +27,7 @@ mimetypes.init() mimetypes.add_type('application/javascript', '.js')
-if not cmd_opts.share:
+if not cmd_opts.share and not cmd_opts.listen:
# fix gradio phoning home
gradio.utils.version_check = lambda: None
gradio.utils.get_local_ip_address = lambda: '127.0.0.1'
|