Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def generate_qr_image(url, image_size):
|
|
| 15 |
version=1,
|
| 16 |
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
| 17 |
box_size=60, # Set a default box size
|
| 18 |
-
border=0.
|
| 19 |
)
|
| 20 |
qr.add_data(url)
|
| 21 |
qr.make(fit=True)
|
|
@@ -72,5 +72,19 @@ inputs = [
|
|
| 72 |
]
|
| 73 |
output = gr.Image(type="pil", label="Generated Image")
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
# Gradio app interface
|
| 76 |
-
gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
version=1,
|
| 16 |
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
| 17 |
box_size=60, # Set a default box size
|
| 18 |
+
border=0.5, # Set a default border size
|
| 19 |
)
|
| 20 |
qr.add_data(url)
|
| 21 |
qr.make(fit=True)
|
|
|
|
| 72 |
]
|
| 73 |
output = gr.Image(type="pil", label="Generated Image")
|
| 74 |
|
| 75 |
+
examples = [
|
| 76 |
+
["https://example.com/1", "A colorful sunset over the ocean"],
|
| 77 |
+
["https://example.com/2", "A cute puppy playing in the park"],
|
| 78 |
+
["https://example.com/3", "A green mountains landscape"]
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
# Gradio app interface
|
| 82 |
+
gr.Interface(
|
| 83 |
+
fn=generate_image,
|
| 84 |
+
inputs=inputs,
|
| 85 |
+
outputs=output,
|
| 86 |
+
title="QR Code Image Generator 🖼",
|
| 87 |
+
description="Generate an image with a transparent QR code linked to the input URL and an image from the Dalle-3 API",
|
| 88 |
+
examples=examples,
|
| 89 |
+
cache_examples=False # Disable example caching
|
| 90 |
+
).launch()
|