Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
import time
|
4 |
+
|
5 |
+
def fake_diffusion(text, steps):
|
6 |
+
for i in range(steps):
|
7 |
+
time.sleep(1)
|
8 |
+
image = np.random.random((600, 600, 3))
|
9 |
+
yield image
|
10 |
+
image = np.ones((1000,1000,3), np.uint8)
|
11 |
+
image[:] = [255, 124, 0]
|
12 |
+
yield image
|
13 |
+
|
14 |
+
|
15 |
+
demo = gr.Interface(fake_diffusion, inputs=[gr.Textbox(), gr.Slider(1, 10, 3)], outputs="image")
|
16 |
+
|
17 |
+
if __name__ == "__main__":
|
18 |
+
demo.launch()
|