Skip to content

Add GZipMiddleware to root demo instance#1916

Merged
AUTOMATIC1111 merged 1 commit into
masterfrom
add-GZipMiddleware
Oct 8, 2022
Merged

Add GZipMiddleware to root demo instance#1916
AUTOMATIC1111 merged 1 commit into
masterfrom
add-GZipMiddleware

Conversation

@dfaker
Copy link
Copy Markdown
Collaborator

@dfaker dfaker commented Oct 7, 2022

Adding GZipMiddleware middleware for all requests over 1000 bytes represents a 23%+ saving in bytes transferred for large images with little speed change, tests with image response from 1 step at 1024x2048 purely for image size:

Gzip Off:

Bytes Time
4.2 MB 14.75 s
4.2 MB 13.79 s
4.2 MB 14.12 s
4.2 MB 14.04 s
4.2 MB 14.07 s

Gzip On:

Bytes Time
3.2 MB 14.36 s
3.2 MB 14.44 s
3.2 MB 14.26 s
3.2 MB 14.14 s
3.2 MB 14.53 s

@dfaker dfaker changed the title Add GZipMiddleware to root demo Add GZipMiddleware to root demo instance Oct 8, 2022
@HookedBehemoth
Copy link
Copy Markdown

HookedBehemoth commented Oct 8, 2022

It might be worthwhile to use better lossless formats like webp, jpegxl or avif. Serving them compressed and offering an uncompressed download would also help drastically. In my testing, that reduced the size by factor 30.

@dfaker
Copy link
Copy Markdown
Collaborator Author

dfaker commented Oct 8, 2022

You mean generally, or with Gradio? It does look like a big improvement is in the works with gradio-app/gradio#2265 as @evanjs spotted, still slightly limited to the PIL supported formats for now though.

@AUTOMATIC1111 AUTOMATIC1111 merged commit 34acad1 into master Oct 8, 2022
@HookedBehemoth
Copy link
Copy Markdown

Gradio. I plugged in pillow-avif-plugin for testing.

@dfaker dfaker deleted the add-GZipMiddleware branch October 15, 2022 18:09
nne998 pushed a commit to fjteam/stable-diffusion-webui that referenced this pull request Sep 26, 2023
ifsheldon pushed a commit to GempollAI/stable-diffusion-webui that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants