File size: 495 Bytes
463ee74
 
 
 
 
6dad6fd
acbc903
463ee74
6dad6fd
463ee74
8b7b306
 
463ee74
 
6dad6fd
 
 
463ee74
acbc903
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
import numpy as np
import time

def fake_diffusion(steps):
    rng = np.random.default_rng()
    for i in range(steps):
        time.sleep(1)
        image = rng.random(size=(600, 600, 3))
        yield image
    image = np.ones((1000,1000,3), np.uint8)
    image[:] = [255, 124, 0]
    yield image

demo = gr.Interface(fake_diffusion,
                    inputs=gr.Slider(1, 10, 3, step=1),
                    outputs="image")

if __name__ == "__main__":
    demo.launch()