Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
902f8cf2
Commit
902f8cf2
authored
Aug 08, 2023
by
AUTOMATIC1111
Committed by
GitHub
Aug 08, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12254 from AUTOMATIC1111/auro-autolaunch
Automatically open webui in browser when running "locally"
parents
01997f45
f17c8c2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
modules/shared.py
modules/shared.py
+1
-0
webui.py
webui.py
+11
-4
No files found.
modules/shared.py
View file @
902f8cf2
...
...
@@ -422,6 +422,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."
)
.
needs_reload_ui
(),
"show_gradio_deprecation_warnings"
:
OptionInfo
(
True
,
"Show gradio deprecation warnings in console."
)
.
needs_reload_ui
(),
"memmon_poll_rate"
:
OptionInfo
(
8
,
"VRAM usage polls per second during generation."
,
gr
.
Slider
,
{
"minimum"
:
0
,
"maximum"
:
40
,
"step"
:
1
})
.
info
(
"0 = disable"
),
...
...
webui.py
View file @
902f8cf2
...
...
@@ -372,6 +372,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
,
...
...
@@ -381,7 +388,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
=
{
...
...
@@ -391,9 +398,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
...
...
@@ -438,6 +442,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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment