gradio-app / gradio

Build and share delightful machine learning apps, all in Python. ๐ŸŒŸ Star to support our work!
http://www.gradio.app
Apache License 2.0
34.19k stars 2.6k forks source link

gr.ImageEditor color picker is not working #9066

Open honglin-chen opened 3 months ago

honglin-chen commented 3 months ago

Describe the bug

Changing the brush color in gr.ImageEditor has no effects. This issue can be reproduced by using the official demo:

Have you searched existing issues? ๐Ÿ”Ž

Reproduction

import time

def sleep(im):
    time.sleep(5)
    return [im["background"], im["layers"][0], im["layers"][1], im["composite"]]

def predict(im):
    return im["composite"]

with gr.Blocks() as demo:
    with gr.Row():
        im = gr.ImageEditor(
            type="numpy",
            crop_size="1:1",
        )
        im_preview = gr.Image()
    n_upload = gr.Number(0, label="Number of upload events", step=1)
    n_change = gr.Number(0, label="Number of change events", step=1)
    n_input = gr.Number(0, label="Number of input events", step=1)

    im.upload(lambda x: x + 1, outputs=n_upload, inputs=n_upload)
    im.change(lambda x: x + 1, outputs=n_change, inputs=n_change)
    im.input(lambda x: x + 1, outputs=n_input, inputs=n_input)
    im.change(predict, outputs=im_preview, inputs=im, show_progress="hidden")

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

Screenshot

https://github.com/user-attachments/assets/9013c52c-77af-47b0-84cb-1bfffb216dfe

Logs

No response

System Info

Gradio Playground

Severity

Blocking usage of gradio

honglin-chen commented 3 months ago

Hi @abidlabs, I just want to float this issue and see if you might have suggestions on how to resolve this issue. Thanks!

ccalauzenes commented 1 month ago

Hi,

Even though I do not have a solution, I believe this issue has been introduced here: #8802 as the functionality works fine with gradio 4.38.1 and seems broken after.