Severian commited on
Commit
5392984
·
verified ·
1 Parent(s): 1a2f2c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -0
app.py CHANGED
@@ -456,6 +456,58 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
456
  Try **-1** if you want to explore and generate different designs. If you find something you really love, write down the seed number and use it again to recreate the same design.
457
  """
458
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
 
460
  with gr.Row():
461
  brightness = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Brightness")
 
456
  Try **-1** if you want to explore and generate different designs. If you find something you really love, write down the seed number and use it again to recreate the same design.
457
  """
458
  )
459
+ with gr.Accordion("QR Code Customization", open=True):
460
+ bg_color = gr.ColorPicker(
461
+ label="Background Color",
462
+ value="#FFFFFF",
463
+ info="Choose the background color for the QR code"
464
+ )
465
+ qr_color = gr.ColorPicker(
466
+ label="QR Code Color",
467
+ value="#000000",
468
+ info="Choose the color for the QR code pattern"
469
+ )
470
+ invert_final_image = gr.Checkbox(
471
+ label="Invert Final Image",
472
+ value=False,
473
+ info="Check this to invert the colors of the final image"
474
+ )
475
+ with gr.Accordion("Model Selection", open=True):
476
+ controlnet_model_dropdown = gr.Dropdown(
477
+ choices=list(CONTROLNET_MODELS.keys()),
478
+ value="QR Code Monster",
479
+ label="ControlNet Model",
480
+ info="Select the ControlNet model for QR code generation"
481
+ )
482
+ diffusion_model_dropdown = gr.Dropdown(
483
+ choices=list(DIFFUSION_MODELS.keys()),
484
+ value="GhostMix",
485
+ label="Diffusion Model",
486
+ info="Select the main diffusion model for image generation"
487
+ )
488
+ with gr.Row():
489
+ run_btn = gr.Button("🎨 Create Your QR Art", variant="primary")
490
+
491
+ with gr.Column():
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
+
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")