Skip to content

Commit

Permalink
Merge branch 'main' into release/invokeai-3-0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Lincoln Stein committed Jul 27, 2023
2 parents 0060754 + bb9460d commit 926bb6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions invokeai/app/api_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
from inspect import signature

import logging
import uvicorn
import socket

Expand Down Expand Up @@ -210,11 +211,25 @@ def find_port(port: int):
port = find_port(app_config.port)
if port != app_config.port:
logger.warn(f"Port {app_config.port} in use, using port {port}")

# Start our own event loop for eventing usage
loop = asyncio.new_event_loop()
config = uvicorn.Config(app=app, host=app_config.host, port=port, loop=loop)
# Use access_log to turn off logging
config = uvicorn.Config(
app=app,
host=app_config.host,
port=port,
loop=loop,
log_level=app_config.log_level,
)
server = uvicorn.Server(config)

# replace uvicorn's loggers with InvokeAI's for consistent appearance
for logname in ["uvicorn.access", "uvicorn"]:
l = logging.getLogger(logname)
l.handlers.clear()
for ch in logger.handlers:
l.addHandler(ch)

loop.run_until_complete(server.serve())


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"controlnet-aux>=0.0.6",
"timm==0.6.13", # needed to override timm latest in controlnet_aux, see https://github.com/isl-org/ZoeDepth/issues/26
"datasets",
"diffusers[torch]~=0.18.2",
"diffusers[torch]~=0.19.0",
"dnspython~=2.4.0",
"dynamicprompts",
"easing-functions",
Expand Down

0 comments on commit 926bb6d

Please sign in to comment.