Severian commited on
Commit
b15cf4e
·
verified ·
1 Parent(s): 8271398

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -441,7 +441,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
441
  with gr.Column(scale=2, elem_classes="welcome-content"):
442
  gr.Markdown(
443
  """
444
- <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/wbJq4-vjkSquskCjKlRfb.png" alt="UGD" width="250" class="centered-image">
445
 
446
  # 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
447
 
@@ -471,9 +471,9 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
471
  )
472
 
473
  with gr.Row():
474
- username = gr.Textbox(label="Username", placeholder="Enter your username", value="ugd")
475
  with gr.Row():
476
- password = gr.Textbox(label="Password", type="password", placeholder="Enter your password", value="ugd!")
477
  with gr.Row():
478
  login_button = gr.Button("Login", size="sm")
479
  login_message = gr.Markdown(visible=False)
@@ -484,7 +484,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
484
  gr.Markdown("""
485
  # How to Use Caption Captain
486
 
487
- <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/rLZkmUHaoRGHPqnCqKKou.png" alt="Captain" width="100" style="max-width: 100%; height: auto;">
488
 
489
  Hello, artist! Let's make some fun captions for your pictures. Here's how:
490
 
@@ -540,6 +540,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
540
  value="long",
541
  )
542
 
 
543
  extra_options = gr.CheckboxGroup(
544
  choices=[
545
  "If there is a person/character in the image you must refer to them as {name}.",
@@ -560,7 +561,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
560
  "Include whether the image is sfw, suggestive, or nsfw.",
561
  "ONLY describe the most important elements of the image."
562
  ],
563
- label="Extra Options"
564
  )
565
 
566
  name_input = gr.Textbox(label="Person/Character Name (if applicable)")
@@ -569,8 +570,14 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
569
  custom_prompt = gr.Textbox(label="Custom Prompt (optional, will override all other settings)")
570
  gr.Markdown("**Note:** Alpha Two is not a general instruction follower and will not follow prompts outside its training data well. Use this feature with caution.")
571
 
572
- # Container for advanced options
573
- with gr.Column(visible=False) as advanced_options:
 
 
 
 
 
 
574
  gr.Markdown("### Advanced Options for Style Prompt")
575
  lens_type = gr.Dropdown(
576
  choices=get_dropdown_choices(lens_types_info),
@@ -603,13 +610,6 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
603
  info="Choose a color effect to alter the overall color palette of the image."
604
  )
605
 
606
- with gr.Column():
607
- error_message = gr.Markdown(visible=False)
608
- output_prompt = gr.Textbox(label="Prompt that was used")
609
- output_caption = gr.Textbox(label="Generated Caption")
610
-
611
- run_button = gr.Button("Make My Caption!")
612
-
613
  def update_style_options(caption_type):
614
  return gr.update(visible=caption_type == "Style Prompt")
615
 
@@ -634,6 +634,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
634
  outputs=[caption_captain_tab, username, password, login_message]
635
  )
636
 
 
637
  password.submit(
638
  login,
639
  inputs=[username, password],
 
441
  with gr.Column(scale=2, elem_classes="welcome-content"):
442
  gr.Markdown(
443
  """
444
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/LVZnwLV43UUvKu3HORqSs.webp" alt="UDG" width="250" style="max-width: 100%; height: auto; class="centered-image">
445
 
446
  # 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
447
 
 
471
  )
472
 
473
  with gr.Row():
474
+ username = gr.Textbox(label="Username", placeholder="Enter your username")
475
  with gr.Row():
476
+ password = gr.Textbox(label="Password", type="password", placeholder="Enter your password")
477
  with gr.Row():
478
  login_button = gr.Button("Login", size="sm")
479
  login_message = gr.Markdown(visible=False)
 
484
  gr.Markdown("""
485
  # How to Use Caption Captain
486
 
487
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/Ce_Z478iOXljvpZ_Fr_Y7.png" alt="Captain" width="100" style="max-width: 100%; height: auto;">
488
 
489
  Hello, artist! Let's make some fun captions for your pictures. Here's how:
490
 
 
540
  value="long",
541
  )
542
 
543
+ with gr.Accordion("Extra Options", open=False):
544
  extra_options = gr.CheckboxGroup(
545
  choices=[
546
  "If there is a person/character in the image you must refer to them as {name}.",
 
561
  "Include whether the image is sfw, suggestive, or nsfw.",
562
  "ONLY describe the most important elements of the image."
563
  ],
564
+ label="Select Extra Options"
565
  )
566
 
567
  name_input = gr.Textbox(label="Person/Character Name (if applicable)")
 
570
  custom_prompt = gr.Textbox(label="Custom Prompt (optional, will override all other settings)")
571
  gr.Markdown("**Note:** Alpha Two is not a general instruction follower and will not follow prompts outside its training data well. Use this feature with caution.")
572
 
573
+ with gr.Column():
574
+ error_message = gr.Markdown(visible=False)
575
+ output_prompt = gr.Textbox(label="Prompt that was used")
576
+ output_caption = gr.Textbox(label="Generated Caption")
577
+
578
+ run_button = gr.Button("Make My Caption!")
579
+
580
+ with gr.Accordion("Advanced Options for Style Prompt", open=False, visible=False) as advanced_options:
581
  gr.Markdown("### Advanced Options for Style Prompt")
582
  lens_type = gr.Dropdown(
583
  choices=get_dropdown_choices(lens_types_info),
 
610
  info="Choose a color effect to alter the overall color palette of the image."
611
  )
612
 
 
 
 
 
 
 
 
613
  def update_style_options(caption_type):
614
  return gr.update(visible=caption_type == "Style Prompt")
615
 
 
634
  outputs=[caption_captain_tab, username, password, login_message]
635
  )
636
 
637
+ # Add this new event listener for the password field
638
  password.submit(
639
  login,
640
  inputs=[username, password],