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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -17
app.py CHANGED
@@ -328,15 +328,16 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
328
  value="ugly, disfigured, low quality, blurry, nsfw, bad_pictures, (bad_prompt_version2:0.8), EasyNegative, 3d, cartoon, anime, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), poorly drawn, distorted, overexposed, flat shading, bad proportions, deformed, pixelated, messy details, lack of contrast, unrealistic textures, bad anatomy, rough edges, low resolution, text artifacts.",
329
  info="List elements or styles you want to avoid in your QR code art.",
330
  )
331
- use_qr_code_as_init_image = gr.Checkbox(
332
- label="Use QR code as init image",
333
- value=True,
334
- interactive=True,
335
- info="Whether init image should be QR code. Unclick to pass init image or generate init image with Stable Diffusion 2.1"
336
- )
337
  with gr.Accordion(label="Init Images (Optional)", open=False, visible=True) as init_image_acc:
338
  init_image = gr.Image(label="Init Image (Optional). Leave blank to generate image with AI", type="pil")
339
  with gr.Row():
 
 
 
 
 
 
340
  invert_init_image = gr.Checkbox(
341
  label="Invert Init Image",
342
  value=False,
@@ -357,9 +358,9 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
357
  maximum=5.0,
358
  step=0.01,
359
  value=2,
360
- label="QR Code Visibility",
361
  )
362
- with gr.Accordion("See Details", open=False):
363
  gr.Markdown(
364
  """
365
  **QR Code Visibility** determines how much the QR code itself stands out in the final design. Think of it like balancing between how "artistic" the image looks and how "functional" the QR code is.
@@ -379,9 +380,9 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
379
  maximum=1.0,
380
  step=0.01,
381
  value=0.9,
382
- label="Artistic Freedom",
383
  )
384
- with gr.Accordion("See Details", open=False):
385
  gr.Markdown(
386
  """
387
  **Artistic Freedom** controls how much the AI is allowed to change the QR code's look to match your description. It's like telling the AI how creative it can get with your QR code:
@@ -399,9 +400,9 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
399
  maximum=50.0,
400
  step=0.25,
401
  value=7.5,
402
- label="Follow the Prompt",
403
  )
404
- with gr.Accordion("See Details", open=False):
405
  gr.Markdown(
406
  """
407
  **Follow the Prompt** tells the AI how closely it should follow your description when creating the QR code art. Think of it like giving the AI instructions on how strict or flexible it can be with your design ideas:
@@ -419,9 +420,9 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
419
  sampler = gr.Dropdown(
420
  choices=list(SAMPLER_MAP.keys()),
421
  value="DPM++ Karras SDE",
422
- label="Art Style",
423
  )
424
- with gr.Accordion("See Details", open=False):
425
  gr.Markdown(
426
  """
427
  **Art Style** changes how the AI creates the image, using different methods (or "samplers"). Each method has a different effect on how detailed or artistic the final QR code looks:
@@ -441,10 +442,10 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
441
  maximum=9999999999,
442
  step=1,
443
  value=-1,
444
- label="Creative Seed",
445
  randomize=False,
446
  )
447
- with gr.Accordion("See Details", open=False):
448
  gr.Markdown(
449
  """
450
  **Creative Seed** controls whether the AI creates a completely new design each time or sticks to a specific design. Think of it like a recipe: with the same seed number, you get the same "recipe" for your QR code every time.
@@ -496,7 +497,7 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
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
  """
@@ -513,6 +514,7 @@ with gr.Blocks(theme='Hev832/Applio') as blocks:
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):
 
328
  value="ugly, disfigured, low quality, blurry, nsfw, bad_pictures, (bad_prompt_version2:0.8), EasyNegative, 3d, cartoon, anime, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), poorly drawn, distorted, overexposed, flat shading, bad proportions, deformed, pixelated, messy details, lack of contrast, unrealistic textures, bad anatomy, rough edges, low resolution, text artifacts.",
329
  info="List elements or styles you want to avoid in your QR code art.",
330
  )
331
+
 
 
 
 
 
332
  with gr.Accordion(label="Init Images (Optional)", open=False, visible=True) as init_image_acc:
333
  init_image = gr.Image(label="Init Image (Optional). Leave blank to generate image with AI", type="pil")
334
  with gr.Row():
335
+ use_qr_code_as_init_image = gr.Checkbox(
336
+ label="Uncheck to use your own image for generation",
337
+ value=True,
338
+ interactive=True,
339
+ info="Allows you to use your own image for generation"
340
+ )
341
  invert_init_image = gr.Checkbox(
342
  label="Invert Init Image",
343
  value=False,
 
358
  maximum=5.0,
359
  step=0.01,
360
  value=2,
361
+ label="QR Code Visibility in Image",
362
  )
363
+ with gr.Accordion("See Details on how much QR code visibility in image", open=False):
364
  gr.Markdown(
365
  """
366
  **QR Code Visibility** determines how much the QR code itself stands out in the final design. Think of it like balancing between how "artistic" the image looks and how "functional" the QR code is.
 
380
  maximum=1.0,
381
  step=0.01,
382
  value=0.9,
383
+ label="Artistic Freedom for the AI",
384
  )
385
+ with gr.Accordion("See Details on how much artistic freedom the AI has", open=False):
386
  gr.Markdown(
387
  """
388
  **Artistic Freedom** controls how much the AI is allowed to change the QR code's look to match your description. It's like telling the AI how creative it can get with your QR code:
 
400
  maximum=50.0,
401
  step=0.25,
402
  value=7.5,
403
+ label="How closely the AI follows the Prompt",
404
  )
405
+ with gr.Accordion("See Details on how closely the AI follows the Prompt", open=False):
406
  gr.Markdown(
407
  """
408
  **Follow the Prompt** tells the AI how closely it should follow your description when creating the QR code art. Think of it like giving the AI instructions on how strict or flexible it can be with your design ideas:
 
420
  sampler = gr.Dropdown(
421
  choices=list(SAMPLER_MAP.keys()),
422
  value="DPM++ Karras SDE",
423
+ label="Art Style the AI uses to create the image",
424
  )
425
+ with gr.Accordion("See Details on how the AI creates the image", open=False):
426
  gr.Markdown(
427
  """
428
  **Art Style** changes how the AI creates the image, using different methods (or "samplers"). Each method has a different effect on how detailed or artistic the final QR code looks:
 
442
  maximum=9999999999,
443
  step=1,
444
  value=-1,
445
+ label="Creative Seed for the Image Generation",
446
  randomize=False,
447
  )
448
+ with gr.Accordion("See Details on how the Creative Seed works to create new and unique images", open=False):
449
  gr.Markdown(
450
  """
451
  **Creative Seed** controls whether the AI creates a completely new design each time or sticks to a specific design. Think of it like a recipe: with the same seed number, you get the same "recipe" for your QR code every time.
 
497
  scan_button = gr.Button("Verify QR Code Works")
498
  scan_result = gr.Textbox(label="Validation Result of QR Code", interactive=False)
499
 
500
+
501
 
502
  gr.Markdown(
503
  """
 
514
  brightness = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Brightness")
515
  contrast = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Contrast")
516
  saturation = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Saturation")
517
+ invert_button = gr.Button("Invert Image")
518
 
519
 
520
  def scan_and_display(image):