Severian commited on
Commit
4ee6a00
·
verified ·
1 Parent(s): cc8a350

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -315,11 +315,6 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
315
  placeholder="Enter URL or text for your QR code",
316
  info="This is what your QR code will link to or display when scanned.",
317
  )
318
- with gr.Accordion(label="QR Code Image (Optional)", open=False):
319
- qr_code_image = gr.Image(
320
- label="QR Code Image (Optional). Leave blank to automatically generate QR code",
321
- type="pil",
322
- )
323
 
324
  prompt = gr.Textbox(
325
  label="Artistic Prompt",
@@ -349,6 +344,12 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
349
  )
350
  invert_init_image_button = gr.Button("Invert Init Image")
351
 
 
 
 
 
 
 
352
  with gr.Accordion("Advanced Art Controls", open=True):
353
 
354
  controlnet_conditioning_scale = gr.Slider(
@@ -491,29 +492,28 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
491
  result_image = gr.Image(label="Your Artistic QR Code")
492
  used_seed = gr.Number(label="Seed Used", interactive=False)
493
 
494
- with gr.Row():
495
- scan_button = gr.Button("Scan QR Code")
 
 
496
  invert_button = gr.Button("Invert Image")
497
-
498
- with gr.Row():
499
- brightness = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Brightness")
500
- contrast = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Contrast")
501
- saturation = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Saturation")
502
-
503
- scan_result = gr.Textbox(label="Scan Result", interactive=False)
504
-
505
  gr.Markdown(
506
  """
507
  ### 🔍 Analyzing Your Creation
508
- - Is the QR code scannable? Click the 'Scan QR Code' button to test.
 
509
  - Does the art style match your prompt? If not, try adjusting the 'Prompt Adherence'.
510
  - Want more artistic flair? Increase the 'Artistic Freedom'.
511
  - Need a clearer QR code? Raise the 'QR Code Visibility'.
512
-
513
- Remember, creating the perfect QR art is a journey of experimentation and refinement.
514
- Enjoy the process of bringing your unique vision to life!
515
  """
516
  )
 
 
 
 
 
 
517
 
518
  def scan_and_display(image):
519
  if image is None:
 
315
  placeholder="Enter URL or text for your QR code",
316
  info="This is what your QR code will link to or display when scanned.",
317
  )
 
 
 
 
 
318
 
319
  prompt = gr.Textbox(
320
  label="Artistic Prompt",
 
344
  )
345
  invert_init_image_button = gr.Button("Invert Init Image")
346
 
347
+ with gr.Accordion(label="QR Code Image (Optional)", open=False, visible=False):
348
+ qr_code_image = gr.Image(
349
+ label="QR Code Image (Optional). Leave blank to automatically generate QR code",
350
+ type="pil",
351
+ )
352
+
353
  with gr.Accordion("Advanced Art Controls", open=True):
354
 
355
  controlnet_conditioning_scale = gr.Slider(
 
492
  result_image = gr.Image(label="Your Artistic QR Code")
493
  used_seed = gr.Number(label="Seed Used", interactive=False)
494
 
495
+ with gr.Row(visible=False):
496
+ scan_button = gr.Button("Verify QR Code Works")
497
+ scan_result = gr.Textbox(label="Validation Result of QR Code", interactive=False)
498
+
499
  invert_button = gr.Button("Invert Image")
500
+
 
 
 
 
 
 
 
501
  gr.Markdown(
502
  """
503
  ### 🔍 Analyzing Your Creation
504
+ - Is the QR code scannable? Check with your phone camera to see if it can scan it.
505
+ - If not scannable, use the Brightness, Contrast, and Saturation sliders to optimize the QR code for scanning.
506
  - Does the art style match your prompt? If not, try adjusting the 'Prompt Adherence'.
507
  - Want more artistic flair? Increase the 'Artistic Freedom'.
508
  - Need a clearer QR code? Raise the 'QR Code Visibility'.
 
 
 
509
  """
510
  )
511
+
512
+ with gr.Row():
513
+ brightness = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Brightness")
514
+ contrast = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Contrast")
515
+ saturation = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Saturation")
516
+
517
 
518
  def scan_and_display(image):
519
  if image is None: