Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mask generation speed #15

Closed
PladsElsker opened this issue Jan 11, 2024 · 0 comments
Closed

Improve mask generation speed #15

PladsElsker opened this issue Jan 11, 2024 · 0 comments

Comments

@PladsElsker
Copy link
Owner

PladsElsker commented Jan 11, 2024

So I found that for large images, gradio takes a significant amount of time JUST to convert images to a format readable by the browser (base64).
The maintainers of gradio won't implement any improvement to this before gradio v4, but they mention a patch here:
gradio-app/gradio#2635 (comment)

I did some tests.
I am getting ~2x faster mask generation for large images (7.2 seconds went down to 3.4 seconds for 2K x 2K images).

I will add this hijack by default in the extension, but I'll add it as a setting thing instead if it creates conflicts with other extensions somehow.
I don't think conflicts are very likely though, so for now the patch is imposed.

@PladsElsker PladsElsker changed the title Improve UI Improve mask generation speed Jan 11, 2024
PladsElsker added a commit that referenced this issue Jan 11, 2024
PladsElsker added a commit that referenced this issue Jan 11, 2024
* hijack gradio for faster base64 conversion

* Rename files (#15)
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

No branches or pull requests

1 participant