Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from PIL import Image
|
| 3 |
import rembg
|
| 4 |
import io
|
| 5 |
import base64
|
|
@@ -37,7 +37,6 @@ def process_image(image, outline_size):
|
|
| 37 |
# Overlay original image
|
| 38 |
outlined_img = Image.alpha_composite(outlined_img, processed_img)
|
| 39 |
|
| 40 |
-
|
| 41 |
# Save the result as bytes for Gradio
|
| 42 |
output_buffer = io.BytesIO()
|
| 43 |
outlined_img.save(output_buffer, format="PNG")
|
|
@@ -64,7 +63,7 @@ with gr.Blocks(title="Sticker Maker") as interface:
|
|
| 64 |
)
|
| 65 |
create_btn = gr.Button("Create Sticker", variant="primary")
|
| 66 |
|
| 67 |
-
with gr.Column():
|
| 68 |
# Use HTML to create an image and a download link
|
| 69 |
image_output_html = gr.HTML(
|
| 70 |
"""
|
|
@@ -100,7 +99,6 @@ with gr.Blocks(title="Sticker Maker") as interface:
|
|
| 100 |
</div>
|
| 101 |
"""
|
| 102 |
|
| 103 |
-
|
| 104 |
create_btn.click(
|
| 105 |
fn=update_image,
|
| 106 |
inputs=[image_upload, outline_size],
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from PIL import Image
|
| 3 |
import rembg
|
| 4 |
import io
|
| 5 |
import base64
|
|
|
|
| 37 |
# Overlay original image
|
| 38 |
outlined_img = Image.alpha_composite(outlined_img, processed_img)
|
| 39 |
|
|
|
|
| 40 |
# Save the result as bytes for Gradio
|
| 41 |
output_buffer = io.BytesIO()
|
| 42 |
outlined_img.save(output_buffer, format="PNG")
|
|
|
|
| 63 |
)
|
| 64 |
create_btn = gr.Button("Create Sticker", variant="primary")
|
| 65 |
|
| 66 |
+
with gr.Column(visible=True): # Ensure this column is always visible
|
| 67 |
# Use HTML to create an image and a download link
|
| 68 |
image_output_html = gr.HTML(
|
| 69 |
"""
|
|
|
|
| 99 |
</div>
|
| 100 |
"""
|
| 101 |
|
|
|
|
| 102 |
create_btn.click(
|
| 103 |
fn=update_image,
|
| 104 |
inputs=[image_upload, outline_size],
|