Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -348,6 +348,16 @@ ul, ol {
|
|
| 348 |
.gradio-radio label {
|
| 349 |
text-align: left !important;
|
| 350 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
"""
|
| 352 |
|
| 353 |
# Add detailed descriptions for each option
|
|
@@ -463,14 +473,10 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 463 |
gr.Markdown(
|
| 464 |
"""
|
| 465 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/LVZnwLV43UUvKu3HORqSs.webp" alt="UDG" width="250" class="centered-image">
|
| 466 |
-
|
| 467 |
# 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
|
| 468 |
-
|
| 469 |
## Accelerate Your Creative Workflow with Intelligent Image Analysis
|
| 470 |
-
|
| 471 |
This innovative tool empowers Yamamoto's artists to quickly generate descriptive captions,<br>
|
| 472 |
training prompts, and tags from existing artwork, fueling the creative process for GenAI models.
|
| 473 |
-
|
| 474 |
## 🚀 How It Works:
|
| 475 |
1. **Upload Your Inspiration**: Drop in an image (e.g., a charcoal horse picture) that embodies your desired style.
|
| 476 |
2. **Choose Your Output**: Select from descriptive captions, training prompts, and tags.
|
|
@@ -504,17 +510,14 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 504 |
with gr.Accordion("How to Use Caption Captain", open=False):
|
| 505 |
gr.Markdown("""
|
| 506 |
# How to Use Caption Captain
|
| 507 |
-
|
| 508 |
<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;">
|
| 509 |
|
| 510 |
Hello, artist! Let's create amazing captions for your pictures. Here's a comprehensive guide:
|
| 511 |
-
|
| 512 |
1. **Upload Your Image**: Choose a picture you want to caption and upload it.
|
| 513 |
-
|
| 514 |
2. **Select Caption Type**:
|
| 515 |
- "Descriptive": Provides a detailed description of the image
|
| 516 |
- "Descriptive (Informal)": Gives a casual description of the image
|
| 517 |
-
- "
|
| 518 |
- "MidJourney": Generates prompts specifically for MidJourney AI
|
| 519 |
- "Booru tag list": Produces tags in the style of image booru websites
|
| 520 |
- "Booru-like tag list": Creates tags similar to booru style, but more flexible
|
|
@@ -522,12 +525,10 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 522 |
- "Product Listing": Describes the image as if it were a product for sale
|
| 523 |
- "Social Media Post": Crafts a caption suitable for social media
|
| 524 |
- "Style Prompt": Generates detailed prompts for specific image styles
|
| 525 |
-
|
| 526 |
3. **Choose Caption Length**:
|
| 527 |
- "Any": Lets the AI decide the appropriate length
|
| 528 |
- Select from "very short" to "very long"
|
| 529 |
- Or specify an exact word count (20 to 260 words)
|
| 530 |
-
|
| 531 |
4. **Extra Options**: Customize your caption with these choices:
|
| 532 |
- Refer to people/characters as a specific name
|
| 533 |
- Focus on changeable attributes, not unchangeable characteristics
|
|
@@ -536,7 +537,6 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 536 |
- Control the tone (e.g., keep it PG, avoid ambiguous language)
|
| 537 |
- Include or exclude specific elements (e.g., text in the image, aesthetic quality)
|
| 538 |
- Determine the level of detail in the description
|
| 539 |
-
|
| 540 |
5. **Advanced Options for Style Prompt**:
|
| 541 |
- Lens Type: Choose from various lens effects (e.g., wide-angle, telephoto)
|
| 542 |
- Film Stock: Select different film types for unique color and grain effects
|
|
@@ -544,16 +544,13 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 544 |
- Lighting Aspect: Define the mood through lighting choices
|
| 545 |
- Special Technique: Add unique photographic effects
|
| 546 |
- Color Effect: Alter the overall color palette of the image
|
| 547 |
-
|
| 548 |
6. **Generate Your Caption**: Click "Make My Caption!" and see the results!
|
| 549 |
-
|
| 550 |
## Tips for Great Captions:
|
| 551 |
- Experiment with different caption types to find what works best for your needs
|
| 552 |
- Use the extra options to fine-tune the focus and style of your captions
|
| 553 |
- For "Style Prompt", explore the advanced options to create highly specific image descriptions
|
| 554 |
- If you're not satisfied with a caption, simply generate a new one
|
| 555 |
- The "Custom Prompt" option allows for more specific instructions, but use it cautiously
|
| 556 |
-
|
| 557 |
Remember, Caption Captain is here to inspire and assist your creative process. Have fun exploring all the possibilities!
|
| 558 |
""")
|
| 559 |
|
|
@@ -562,7 +559,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 562 |
input_image = gr.Image(type="pil", label="Input Image")
|
| 563 |
|
| 564 |
caption_type = gr.Dropdown(
|
| 565 |
-
choices=["Descriptive", "Descriptive (Informal)", "
|
| 566 |
label="Caption Type",
|
| 567 |
value="Descriptive",
|
| 568 |
)
|
|
@@ -668,7 +665,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 668 |
outputs=[caption_captain_tab, username, password, login_message]
|
| 669 |
)
|
| 670 |
|
| 671 |
-
|
| 672 |
password.submit(
|
| 673 |
login,
|
| 674 |
inputs=[username, password],
|
|
|
|
| 348 |
.gradio-radio label {
|
| 349 |
text-align: left !important;
|
| 350 |
}
|
| 351 |
+
/* Change button color to green */
|
| 352 |
+
.gradio-button {
|
| 353 |
+
background-color: #4CAF50 !important; /* Green color */
|
| 354 |
+
border-color: #4CAF50 !important;
|
| 355 |
+
color: white !important;
|
| 356 |
+
}
|
| 357 |
+
.gradio-button:hover {
|
| 358 |
+
background-color: #45a049 !important; /* Darker green on hover */
|
| 359 |
+
border-color: #45a049 !important;
|
| 360 |
+
}
|
| 361 |
"""
|
| 362 |
|
| 363 |
# Add detailed descriptions for each option
|
|
|
|
| 473 |
gr.Markdown(
|
| 474 |
"""
|
| 475 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/LVZnwLV43UUvKu3HORqSs.webp" alt="UDG" width="250" class="centered-image">
|
|
|
|
| 476 |
# 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
|
|
|
|
| 477 |
## Accelerate Your Creative Workflow with Intelligent Image Analysis
|
|
|
|
| 478 |
This innovative tool empowers Yamamoto's artists to quickly generate descriptive captions,<br>
|
| 479 |
training prompts, and tags from existing artwork, fueling the creative process for GenAI models.
|
|
|
|
| 480 |
## 🚀 How It Works:
|
| 481 |
1. **Upload Your Inspiration**: Drop in an image (e.g., a charcoal horse picture) that embodies your desired style.
|
| 482 |
2. **Choose Your Output**: Select from descriptive captions, training prompts, and tags.
|
|
|
|
| 510 |
with gr.Accordion("How to Use Caption Captain", open=False):
|
| 511 |
gr.Markdown("""
|
| 512 |
# How to Use Caption Captain
|
|
|
|
| 513 |
<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;">
|
| 514 |
|
| 515 |
Hello, artist! Let's create amazing captions for your pictures. Here's a comprehensive guide:
|
|
|
|
| 516 |
1. **Upload Your Image**: Choose a picture you want to caption and upload it.
|
|
|
|
| 517 |
2. **Select Caption Type**:
|
| 518 |
- "Descriptive": Provides a detailed description of the image
|
| 519 |
- "Descriptive (Informal)": Gives a casual description of the image
|
| 520 |
+
- "Stable Diffusion Prompt": Creates prompts for AI image generation
|
| 521 |
- "MidJourney": Generates prompts specifically for MidJourney AI
|
| 522 |
- "Booru tag list": Produces tags in the style of image booru websites
|
| 523 |
- "Booru-like tag list": Creates tags similar to booru style, but more flexible
|
|
|
|
| 525 |
- "Product Listing": Describes the image as if it were a product for sale
|
| 526 |
- "Social Media Post": Crafts a caption suitable for social media
|
| 527 |
- "Style Prompt": Generates detailed prompts for specific image styles
|
|
|
|
| 528 |
3. **Choose Caption Length**:
|
| 529 |
- "Any": Lets the AI decide the appropriate length
|
| 530 |
- Select from "very short" to "very long"
|
| 531 |
- Or specify an exact word count (20 to 260 words)
|
|
|
|
| 532 |
4. **Extra Options**: Customize your caption with these choices:
|
| 533 |
- Refer to people/characters as a specific name
|
| 534 |
- Focus on changeable attributes, not unchangeable characteristics
|
|
|
|
| 537 |
- Control the tone (e.g., keep it PG, avoid ambiguous language)
|
| 538 |
- Include or exclude specific elements (e.g., text in the image, aesthetic quality)
|
| 539 |
- Determine the level of detail in the description
|
|
|
|
| 540 |
5. **Advanced Options for Style Prompt**:
|
| 541 |
- Lens Type: Choose from various lens effects (e.g., wide-angle, telephoto)
|
| 542 |
- Film Stock: Select different film types for unique color and grain effects
|
|
|
|
| 544 |
- Lighting Aspect: Define the mood through lighting choices
|
| 545 |
- Special Technique: Add unique photographic effects
|
| 546 |
- Color Effect: Alter the overall color palette of the image
|
|
|
|
| 547 |
6. **Generate Your Caption**: Click "Make My Caption!" and see the results!
|
|
|
|
| 548 |
## Tips for Great Captions:
|
| 549 |
- Experiment with different caption types to find what works best for your needs
|
| 550 |
- Use the extra options to fine-tune the focus and style of your captions
|
| 551 |
- For "Style Prompt", explore the advanced options to create highly specific image descriptions
|
| 552 |
- If you're not satisfied with a caption, simply generate a new one
|
| 553 |
- The "Custom Prompt" option allows for more specific instructions, but use it cautiously
|
|
|
|
| 554 |
Remember, Caption Captain is here to inspire and assist your creative process. Have fun exploring all the possibilities!
|
| 555 |
""")
|
| 556 |
|
|
|
|
| 559 |
input_image = gr.Image(type="pil", label="Input Image")
|
| 560 |
|
| 561 |
caption_type = gr.Dropdown(
|
| 562 |
+
choices=["Descriptive", "Descriptive (Informal)", "Stable Diffusion", "MidJourney", "Booru tag list", "Booru-like tag list", "Art Critic", "Product Listing", "Social Media Post", "Style Prompt"],
|
| 563 |
label="Caption Type",
|
| 564 |
value="Descriptive",
|
| 565 |
)
|
|
|
|
| 665 |
outputs=[caption_captain_tab, username, password, login_message]
|
| 666 |
)
|
| 667 |
|
| 668 |
+
|
| 669 |
password.submit(
|
| 670 |
login,
|
| 671 |
inputs=[username, password],
|