Skip to content

Commit

Permalink
Add GZipMiddleware to root demo
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaker authored and AUTOMATIC1111 committed Oct 8, 2022
1 parent cc0258a commit 34acad1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import signal
import threading

from fastapi.middleware.gzip import GZipMiddleware

from modules.paths import script_path

from modules import devices, sd_samplers
Expand Down Expand Up @@ -93,7 +95,7 @@ def sigint_handler(sig, frame):

demo = modules.ui.create_ui(wrap_gradio_gpu_call=wrap_gradio_gpu_call)

demo.launch(
app,local_url,share_url = demo.launch(
share=cmd_opts.share,
server_name="0.0.0.0" if cmd_opts.listen else None,
server_port=cmd_opts.port,
Expand All @@ -102,6 +104,8 @@ def sigint_handler(sig, frame):
inbrowser=cmd_opts.autolaunch,
prevent_thread_lock=True
)

app.add_middleware(GZipMiddleware,minimum_size=1000)

while 1:
time.sleep(0.5)
Expand Down

0 comments on commit 34acad1

Please sign in to comment.