ysharma's picture
ysharma HF staff
Create app.py
9a6de88 verified
raw
history blame contribute delete
873 Bytes
import gradio as gr
from gradio_imageslider import ImageSlider
from PIL import ImageFilter
def fn(img1, img2):
#if not im or not im[0]:
# return im
return (img1, img2) #(im[0], im[0].filter(filter=ImageFilter.GaussianBlur(radius=10)))
with gr.Blocks() as demo:
with gr.Group():
with gr.Row():
img1 = gr.Image()
img2 = gr.Image()
imgsldr = ImageSlider(label="Blur image", value=["https://lllyasviel-ic-light.hf.space/file=/tmp/gradio/b6d84562c50f5d7dec385dc305f43784b778bb1f/i9.png",
"https://lllyasviel-ic-light.hf.space/file=/tmp/gradio/495c8d96f46ac9679c31cf662d2d0dc4f95287f8/image.webp#"])
gr.Button().click(fn, [img1, img2], imgsldr)
#img1.upload(fn, inputs=img1, outputs=img1)
if __name__ == "__main__":
demo.launch()