ysharma HF staff commited on
Commit
9a6de88
1 Parent(s): e040b74

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_imageslider import ImageSlider
3
+ from PIL import ImageFilter
4
+
5
+
6
+ def fn(img1, img2):
7
+ #if not im or not im[0]:
8
+ # return im
9
+ return (img1, img2) #(im[0], im[0].filter(filter=ImageFilter.GaussianBlur(radius=10)))
10
+
11
+
12
+ with gr.Blocks() as demo:
13
+ with gr.Group():
14
+ with gr.Row():
15
+ img1 = gr.Image()
16
+ img2 = gr.Image()
17
+ imgsldr = ImageSlider(label="Blur image", value=["https://lllyasviel-ic-light.hf.space/file=/tmp/gradio/b6d84562c50f5d7dec385dc305f43784b778bb1f/i9.png",
18
+ "https://lllyasviel-ic-light.hf.space/file=/tmp/gradio/495c8d96f46ac9679c31cf662d2d0dc4f95287f8/image.webp#"])
19
+ gr.Button().click(fn, [img1, img2], imgsldr)
20
+ #img1.upload(fn, inputs=img1, outputs=img1)
21
+
22
+ if __name__ == "__main__":
23
+ demo.launch()