pngwn / gradio-imageslider

ImageSlider custom component for gradio.
https://huggingface.co/spaces/pngwn/gradio_imageslider
31 stars 5 forks source link

[BUG] Progress tracker doesn't display after the first iteration #31

Open apolinario opened 5 months ago

apolinario commented 5 months ago

The progress tracker is not displayed once an image is already in the component and you attempt a second activity

Repro:

import gradio as gr
from gradio_imageslider import ImageSlider
from PIL import ImageFilter
import time
from tqdm import tqdm

def fn(im):
    time.sleep(4)
    return (im, im.filter(filter=ImageFilter.GaussianBlur(radius=10)))

with gr.Blocks() as demo:
    with gr.Group():
        with gr.Row():
            img2 = gr.Image(type="pil")
            img1 = ImageSlider(label="Blur image", type="pil", slider_color="pink")
    btn = gr.Button()
    btn.click(fn, inputs=img2, outputs=img1)
if __name__ == "__main__":
    demo.launch(share=True)

I realize this is because the status-wrap class actually tracking the progress just fine but is behind the image component itself. I was able to fix it in a hacky way by changing the z-index of the class status-wrap as a custom css for gradio

innat-asj commented 4 months ago

@apolinario Did you manage to find any workaround?