Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
dd2108fd
Unverified
Commit
dd2108fd
authored
Nov 02, 2022
by
Maiko Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: should invoke callback as well in api only mode
parent
95c6308c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
script_callbacks.py
modules/script_callbacks.py
+2
-1
webui.py
webui.py
+2
-0
No files found.
modules/script_callbacks.py
View file @
dd2108fd
...
@@ -2,6 +2,7 @@ import sys
...
@@ -2,6 +2,7 @@ import sys
import
traceback
import
traceback
from
collections
import
namedtuple
from
collections
import
namedtuple
import
inspect
import
inspect
from
typing
import
Optional
from
fastapi
import
FastAPI
from
fastapi
import
FastAPI
from
gradio
import
Blocks
from
gradio
import
Blocks
...
@@ -62,7 +63,7 @@ def clear_callbacks():
...
@@ -62,7 +63,7 @@ def clear_callbacks():
callbacks_image_saved
.
clear
()
callbacks_image_saved
.
clear
()
callbacks_cfg_denoiser
.
clear
()
callbacks_cfg_denoiser
.
clear
()
def
app_started_callback
(
demo
:
Blocks
,
app
:
FastAPI
):
def
app_started_callback
(
demo
:
Optional
[
Blocks
]
,
app
:
FastAPI
):
for
c
in
callbacks_app_started
:
for
c
in
callbacks_app_started
:
try
:
try
:
c
.
callback
(
demo
,
app
)
c
.
callback
(
demo
,
app
)
...
...
webui.py
View file @
dd2108fd
...
@@ -114,6 +114,8 @@ def api_only():
...
@@ -114,6 +114,8 @@ def api_only():
app
.
add_middleware
(
GZipMiddleware
,
minimum_size
=
1000
)
app
.
add_middleware
(
GZipMiddleware
,
minimum_size
=
1000
)
api
=
create_api
(
app
)
api
=
create_api
(
app
)
modules
.
script_callbacks
.
app_started_callback
(
None
,
app
)
api
.
launch
(
server_name
=
"0.0.0.0"
if
cmd_opts
.
listen
else
"127.0.0.1"
,
port
=
cmd_opts
.
port
if
cmd_opts
.
port
else
7861
)
api
.
launch
(
server_name
=
"0.0.0.0"
if
cmd_opts
.
listen
else
"127.0.0.1"
,
port
=
cmd_opts
.
port
if
cmd_opts
.
port
else
7861
)
...
...
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