Spaces:
Running
Running
Download run.py from gradio/fake_diffusion: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/gradio/fake_diffusion/resolve/main/run.py
- Command line
-
hf download hf://spaces/gradio/fake_diffusion/run.py
-
curl -L -o run.py https://huggingface.co/spaces/gradio/fake_diffusion/resolve/main/run.py
535 Bytes
| 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", | |
| api_name="predict") | |
| if __name__ == "__main__": | |
| demo.launch() | |