IgnoreLee commited on
Commit
3a52ee9
·
1 Parent(s): 86823ae

sharing test

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time
2
+ import gradio as gr
3
+ import numpy as np
4
+
5
+
6
+ # define core fn, which returns a generator {steps} times before returning the image
7
+ def fake_diffusion(steps):
8
+ for _ in range(steps):
9
+ time.sleep(1)
10
+ image = np.random.random((600, 600, 3))
11
+ yield image
12
+ image = "https://gradio-builds.s3.amazonaws.com/diffusion_image/cute_dog.jpg"
13
+ yield image
14
+
15
+
16
+ demo = gr.Interface(fake_diffusion, inputs=gr.Slider(1, 10, 3), outputs="image")
17
+
18
+ # define queue - required for generators
19
+ demo.queue()
20
+ demo.launch(share=True)