mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 12:25:06 +08:00
Add GZipMiddleware to root demo
This commit is contained in:
parent
cc0258aea7
commit
34acad1628
6
webui.py
6
webui.py
@ -5,6 +5,8 @@ import importlib
|
||||
import signal
|
||||
import threading
|
||||
|
||||
from fastapi.middleware.gzip import GZipMiddleware
|
||||
|
||||
from modules.paths import script_path
|
||||
|
||||
from modules import devices, sd_samplers
|
||||
@ -93,7 +95,7 @@ def webui():
|
||||
|
||||
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,
|
||||
@ -102,6 +104,8 @@ def webui():
|
||||
inbrowser=cmd_opts.autolaunch,
|
||||
prevent_thread_lock=True
|
||||
)
|
||||
|
||||
app.add_middleware(GZipMiddleware,minimum_size=1000)
|
||||
|
||||
while 1:
|
||||
time.sleep(0.5)
|
||||
|
Loading…
Reference in New Issue
Block a user