当你把stable-diffusion-webui环境安装好后,启动python webui.py后发现,局域网里面是不能访问这个网页的,为了解决这个问题翻阅资料发现解决起来很简单。我们去
stable-diffusion-webui/modules/shared.py这个文件,把--listen设置为True,具体看下面代码文章来源:https://www.toymoban.com/news/detail-517164.html
parser.add_argument("--always-batch-cond-uncond", action='store_true', help="a workaround test; may help with speed if you use --lowvram")
parser.add_argument("--unload-gfpgan", action='store_true', help="unload GFPGAN every time after processing images. Warning: seems to cause memory leaks")
parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
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 reduce vram usage by a lot for about 10%% decrease in performance")
parser.add_argument("--listen", action='store_true',default=True, help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
parser.add_argument("--port", type=int, help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available", default=None)
parser.add_argument("--show-negative-prompt", action='store_true', help="enable the field that lets you input negative prompt", default=False)
cmd_opts = parser.parse_args()
增加default=True即可。文章来源地址https://www.toymoban.com/news/detail-517164.html
到了这里,关于[深度学习]stable-diffusion-webui部署后局域网无法访问的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!