Spaces:
Running
Running
Update app.py
Browse files1 unmodified line23456733 unmodified lines41424344454629 unmodified lines76777879808182838485868788891 unmodified linefrom PIL import Imageimport rembgimport iodef process_image(image, outline_size, outline_color, add_outline):if image is None:33 unmodified linesreturn final_img# Gradio Interfacewith gr.Blocks(title="Sticker Maker") as interface:gr.Markdown("# Sticker Maker")29 unmodified linesoutputs=output_image,)# Handle downloaddef download_sticker(image):if image:img_byte_arr = io.BytesIO()image.save(img_byte_arr, format="PNG")img_byte_arr.seek(0)return img_byte_arrdownload_btn.click(fn=download_sticker,inputs=output_image,1 unmodified line234567833 unmodified lines42434445464748495051525354555629 unmodified lines868788899091921 unmodified linefrom PIL import Imageimport rembgimport ioimport tempfiledef process_image(image, outline_size, outline_color, add_outline):if image is None:33 unmodified linesreturn final_img# Handle downloaddef download_sticker(image):if image:# Save image to a temporary filetemp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".png")image.save(temp_file.name, format="PNG")temp_file.close()return temp_file.name # Return the file path# Gradio Interfacewith gr.Blocks(title="Sticker Maker") as interface:gr.Markdown("# Sticker Maker")29 unmodified linesoutputs=output_image,)# Enable download functionalitydownload_btn.click(fn=download_sticker,inputs=output_image,
app.py+11-8