File size: 637 Bytes
d8eaf88 23e9852 d8eaf88 e32d51c d8eaf88 e32d51c 23e9852 cdcc96d f980881 5ace451 f980881 cdcc96d e32d51c cdcc96d 23e9852 cdcc96d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os
import gradio as gr
def update(img):
if not os.path.exists('temp'):
os.system('mkdir temp')
img.save("temp/image.jpg", "JPEG")
return f'temp/image.jpg'
with gr.Blocks() as demo:
gr.Markdown("Start typing below and then click **Run** to see the output.")
gr.Markdown("The **Slider** is the amount of new views")
gr.inputs.Slider(1,15, default = 2, label='StepCycles',step= 1)
with gr.Row():
inp = gr.Image(type="pil", label="Input")
out = gr.Image(type="file", label="Output")
btn = gr.Button("Run")
btn.click(fn=update, inputs=inp, outputs=out)
demo.launch() |