当前位置:   article > 正文

[深度学习]stable-diffusion-webui部署后局域网无法访问_怎样在局域网内访问stable diffusion

怎样在局域网内访问stable diffusion

当你把stable-diffusion-webui环境安装好后,启动python webui.py后发现,局域网里面是不能访问这个网页的,为了解决这个问题翻阅资料发现解决起来很简单。我们去

stable-diffusion-webui/modules/shared.py这个文件,把--listen设置为True,具体看下面代码

  1. parser.add_argument("--always-batch-cond-uncond", action='store_true', help="a workaround test; may help with speed if you use --lowvram")
  2. parser.add_argument("--unload-gfpgan", action='store_true', help="unload GFPGAN every time after processing images. Warning: seems to cause memory leaks")
  3. parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
  4. 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)")
  5. parser.add_argument("--esrgan-models-path", type=str, help="path to directory with ESRGAN models", default=os.path.join(script_path, 'ESRGAN'))
  6. 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")
  7. 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")
  8. 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)
  9. parser.add_argument("--show-negative-prompt", action='store_true', help="enable the field that lets you input negative prompt", default=False)
  10. cmd_opts = parser.parse_args()

增加default=True即可。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/204368
推荐阅读
相关标签
  

闽ICP备14008679号