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
e6060a7e
Commit
e6060a7e
authored
Nov 02, 2022
by
AUTOMATIC1111
Committed by
GitHub
Nov 02, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4155 from MaikoTan/fix/register-api-in-api-only-mode
fix: should invoke callback as well in api only mode
parents
eb5e82c7
dd2108fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
modules/script_callbacks.py
modules/script_callbacks.py
+2
-1
webui.py
webui.py
+2
-0
No files found.
modules/script_callbacks.py
View file @
e6060a7e
...
...
@@ -2,6 +2,7 @@ import sys
import
traceback
from
collections
import
namedtuple
import
inspect
from
typing
import
Optional
from
fastapi
import
FastAPI
from
gradio
import
Blocks
...
...
@@ -62,7 +63,7 @@ def clear_callbacks():
callbacks_image_saved
.
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
:
try
:
c
.
callback
(
demo
,
app
)
...
...
webui.py
View file @
e6060a7e
...
...
@@ -114,6 +114,8 @@ def api_only():
app
.
add_middleware
(
GZipMiddleware
,
minimum_size
=
1000
)
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
)
...
...
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