Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
Hunter0726
Stable Diffusion Webui
提交
c75bda86
提交
c75bda86
编辑于
1 year ago
作者:
w-e-w
浏览文件
操作
下载
补丁
差异文件
setting: Automatically open webui in browser on startup
上级
6a0d498c
No related branches found
No related tags found
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
modules/shared.py
+1
-0
1 个添加, 0 个删除
modules/shared.py
webui.py
+11
-4
11 个添加, 4 个删除
webui.py
有
12 个添加
和
4 个删除
modules/shared.py
+
1
−
0
浏览文件 @
c75bda86
...
...
@@ -385,6 +385,7 @@ options_templates.update(options_section(('face-restoration', "Face restoration"
}))
options_templates
.
update
(
options_section
((
'
system
'
,
"
System
"
),
{
"
auto_launch_browser
"
:
OptionInfo
(
"
Local
"
,
"
Automatically open webui in browser on startup
"
,
gr
.
Radio
,
lambda
:
{
"
choices
"
:
[
"
Disable
"
,
"
Local
"
,
"
Remote
"
]}),
"
show_warnings
"
:
OptionInfo
(
False
,
"
Show warnings in console.
"
),
"
memmon_poll_rate
"
:
OptionInfo
(
8
,
"
VRAM usage polls per second during generation.
"
,
gr
.
Slider
,
{
"
minimum
"
:
0
,
"
maximum
"
:
40
,
"
step
"
:
1
}).
info
(
"
0 = disable
"
),
"
samples_log_stdout
"
:
OptionInfo
(
False
,
"
Always print all generation info to standard output
"
),
...
...
此差异已折叠。
点击以展开。
webui.py
+
11
−
4
浏览文件 @
c75bda86
...
...
@@ -398,6 +398,13 @@ def webui():
gradio_auth_creds
=
list
(
get_gradio_auth_creds
())
or
None
auto_launch_browser
=
False
if
os
.
getenv
(
'
SD_WEBUI_RESTARTING
'
)
!=
'
1
'
:
if
shared
.
opts
.
auto_launch_browser
==
"
Remote
"
or
cmd_opts
.
autolaunch
:
auto_launch_browser
=
True
elif
shared
.
opts
.
auto_launch_browser
==
"
Local
"
:
auto_launch_browser
=
not
any
([
cmd_opts
.
listen
,
cmd_opts
.
share
,
cmd_opts
.
ngrok
])
app
,
local_url
,
share_url
=
shared
.
demo
.
launch
(
share
=
cmd_opts
.
share
,
server_name
=
server_name
,
...
...
@@ -407,7 +414,7 @@ def webui():
ssl_verify
=
cmd_opts
.
disable_tls_verify
,
debug
=
cmd_opts
.
gradio_debug
,
auth
=
gradio_auth_creds
,
inbrowser
=
cmd_opts
.
autolaunch
and
os
.
getenv
(
'
SD_WEBUI_RESTARTING
'
)
!=
'
1
'
,
inbrowser
=
auto
_
launch
_browser
,
prevent_thread_lock
=
True
,
allowed_paths
=
cmd_opts
.
gradio_allowed_path
,
app_kwargs
=
{
...
...
@@ -417,9 +424,6 @@ def webui():
root_path
=
f
"
/
{
cmd_opts
.
subpath
}
"
if
cmd_opts
.
subpath
else
""
,
)
# after initial launch, disable --autolaunch for subsequent restarts
cmd_opts
.
autolaunch
=
False
startup_timer
.
record
(
"
gradio launch
"
)
# gradio uses a very open CORS policy via app.user_middleware, which makes it possible for
...
...
@@ -464,6 +468,9 @@ def webui():
shared
.
demo
.
close
()
break
# disable auto launch webui in browser for subsequent UI Reload
os
.
environ
.
setdefault
(
'
SD_WEBUI_RESTARTING
'
,
'
1
'
)
print
(
'
Restarting UI...
'
)
shared
.
demo
.
close
()
time
.
sleep
(
0.5
)
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录