Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from paintify import stylize_image | |
| def process(image): | |
| output = stylize_image(image) | |
| return image, output | |
| with gr.Blocks(title="MSPaintify") as demo: | |
| gr.Markdown("## π¨ MSPaintify: Turn any image into a crude MS Paint-style masterpiece") | |
| with gr.Row(): | |
| with gr.Column(): | |
| input_img = gr.Image(label="Upload Image", type="pil") | |
| submit_btn = gr.Button("Convert to MS Paint Style") | |
| with gr.Column(): | |
| original = gr.Image(label="Original", interactive=False) | |
| result = gr.Image(label="Stylized", interactive=False) | |
| download_btn = gr.Button("Download") | |
| submit_btn.click(fn=process, inputs=input_img, outputs=[original, result]) | |
| download_btn.click(lambda img: img, inputs=result, outputs=gr.File(label="Download")) | |
| demo.launch() | |