gradio
gradio copied to clipboard
Don't serialize `gr.Gallery()` images to base64 format
We currently serialize all gr.Gallery()
images into base64 format (similar to gr.Image()
). In the case of gr.Image()
we may need to do this so that the image editor can edit the images. But we don't need this for gr.Gallery()
and it can significantly slow down the loading time if there are a lot of images in the gallery. Let's remove this unnecessary serialization when an image file is provided.
As pointed out by @pngwn, we may not need to serialize images for gr.Image()
either anymore, so we can remove the serialization logic from there as well.
h/t @apolinario
Is the expected behavior to serve a file from the backend like we do for Video?
Is the expected behavior to serve a file from the backend like we do for Video?
Yes exactly that would be the fix