Kvikontent commited on
Commit
5ea8c0b
1 Parent(s): 5662123

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
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.3, # Set a default border size
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(fn=generate_image, inputs=inputs, outputs=output, title="QR Code Image Generator", description="Generate an image with a QR code linked to the input URL and an image from the Hugging Face API", theme="soft").launch()
 
 
 
 
 
 
 
 
 
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()