Skip to content

gr.Image element causes high memory usage in Firefox and Chrome #11355

Open
@smallpillow

Description

@smallpillow

Describe the bug

Assigning values to gr.Image multiple times will cause the memory of Google Chrome to increase. The memory occupied by the sticky notes will keep growing until it crashes.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

with gr.Blocks() as demo:
    with gr.Row():
        in_image = gr.Image(sources=["upload"])
    with gr.Row():
        out_image = gr.Image(sources=["upload"])
    submit_btn = gr.Button('submit')
    submit_btn.click(fn=lambda x: x, inputs=[in_image], outputs=[out_image])

if __name__ == "__main__":
    demo.launch()

Screenshot

No response

Logs

System Info

gradio==5.29.1

Severity

I can work around it

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions