Update app.py
Browse files
app.py
CHANGED
@@ -275,20 +275,42 @@ def stream_chat(input_image: Image.Image, caption_type: str, caption_tone: str,
|
|
275 |
return caption
|
276 |
|
277 |
css = """
|
278 |
-
h1, h2, h3, h4, h5, h6, p, li, ul, ol, a
|
279 |
-
text-align:
|
|
|
|
|
280 |
display: block;
|
281 |
margin-left: auto;
|
282 |
margin-right: auto;
|
|
|
|
|
283 |
}
|
284 |
ul, ol {
|
285 |
-
|
286 |
-
margin-right: auto;
|
287 |
-
display: table;
|
288 |
}
|
289 |
-
.
|
290 |
-
max-width: 100
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
}
|
293 |
"""
|
294 |
|
@@ -414,9 +436,9 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
414 |
)
|
415 |
|
416 |
with gr.Row():
|
417 |
-
username = gr.Textbox(label="Username", placeholder="Enter your username", value="ugd")
|
418 |
with gr.Row():
|
419 |
-
password = gr.Textbox(label="Password", type="password", placeholder="Enter your password", value="ugd!")
|
420 |
with gr.Row():
|
421 |
login_button = gr.Button("Login", size="sm")
|
422 |
login_message = gr.Markdown(visible=False)
|
@@ -433,27 +455,22 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
433 |
1. **Pick a Picture**: Find a cool picture you want to talk about and upload it.
|
434 |
|
435 |
2. **Choose What You Want**:
|
436 |
-
|
437 |
- **Caption Type**:
|
438 |
-
|
439 |
* "Descriptive" tells you what's in the picture
|
440 |
* "Training Prompt" helps computers make similar pictures
|
441 |
* "RNG-Tags" gives you short words about the picture
|
442 |
* "Style Prompt" creates detailed prompts for image generation
|
443 |
|
444 |
3. **Pick a Style** (for "Descriptive" and "Style Prompt" only):
|
445 |
-
|
446 |
- "Formal" sounds like a teacher talking
|
447 |
- "Informal" sounds like a friend chatting
|
448 |
|
449 |
4. **Decide How Long**:
|
450 |
-
|
451 |
- "Any" lets the computer decide
|
452 |
- Or pick a size from "very short" to "very long"
|
453 |
- You can even choose a specific number of words!
|
454 |
|
455 |
5. **Advanced Options** (for "Style Prompt" only):
|
456 |
-
|
457 |
- Choose lens type, film stock, composition, and lighting details
|
458 |
|
459 |
6. **Make the Caption**: Click the "Make My Caption!" button and watch the magic happen!
|
@@ -461,7 +478,6 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
461 |
Remember, have fun and be creative with your captions!
|
462 |
|
463 |
## Tips for Great Captions:
|
464 |
-
|
465 |
- Try different types to see what you like best
|
466 |
- Experiment with formal and informal tones for fun variations
|
467 |
- Adjust the length to get just the right amount of detail
|
|
|
275 |
return caption
|
276 |
|
277 |
css = """
|
278 |
+
h1, h2, h3, h4, h5, h6, p, li, ul, ol, a {
|
279 |
+
text-align: left;
|
280 |
+
}
|
281 |
+
.centered-image {
|
282 |
display: block;
|
283 |
margin-left: auto;
|
284 |
margin-right: auto;
|
285 |
+
max-width: 100%;
|
286 |
+
height: auto;
|
287 |
}
|
288 |
ul, ol {
|
289 |
+
padding-left: 20px;
|
|
|
|
|
290 |
}
|
291 |
+
.gradio-container {
|
292 |
+
max-width: 100% !important;
|
293 |
+
padding: 0 !important;
|
294 |
+
}
|
295 |
+
.gradio-row {
|
296 |
+
margin-left: 0 !important;
|
297 |
+
margin-right: 0 !important;
|
298 |
+
}
|
299 |
+
.gradio-column {
|
300 |
+
padding-left: 0 !important;
|
301 |
+
padding-right: 0 !important;
|
302 |
+
}
|
303 |
+
/* Left-align dropdown text */
|
304 |
+
.gradio-dropdown > div {
|
305 |
+
text-align: left !important;
|
306 |
+
}
|
307 |
+
/* Left-align checkbox labels */
|
308 |
+
.gradio-checkbox label {
|
309 |
+
text-align: left !important;
|
310 |
+
}
|
311 |
+
/* Left-align radio button labels */
|
312 |
+
.gradio-radio label {
|
313 |
+
text-align: left !important;
|
314 |
}
|
315 |
"""
|
316 |
|
|
|
436 |
)
|
437 |
|
438 |
with gr.Row():
|
439 |
+
username = gr.Textbox(label="Username", placeholder="Enter your username", value="ugd", visible=False)
|
440 |
with gr.Row():
|
441 |
+
password = gr.Textbox(label="Password", type="password", placeholder="Enter your password", value="ugd!", visible=False)
|
442 |
with gr.Row():
|
443 |
login_button = gr.Button("Login", size="sm")
|
444 |
login_message = gr.Markdown(visible=False)
|
|
|
455 |
1. **Pick a Picture**: Find a cool picture you want to talk about and upload it.
|
456 |
|
457 |
2. **Choose What You Want**:
|
|
|
458 |
- **Caption Type**:
|
|
|
459 |
* "Descriptive" tells you what's in the picture
|
460 |
* "Training Prompt" helps computers make similar pictures
|
461 |
* "RNG-Tags" gives you short words about the picture
|
462 |
* "Style Prompt" creates detailed prompts for image generation
|
463 |
|
464 |
3. **Pick a Style** (for "Descriptive" and "Style Prompt" only):
|
|
|
465 |
- "Formal" sounds like a teacher talking
|
466 |
- "Informal" sounds like a friend chatting
|
467 |
|
468 |
4. **Decide How Long**:
|
|
|
469 |
- "Any" lets the computer decide
|
470 |
- Or pick a size from "very short" to "very long"
|
471 |
- You can even choose a specific number of words!
|
472 |
|
473 |
5. **Advanced Options** (for "Style Prompt" only):
|
|
|
474 |
- Choose lens type, film stock, composition, and lighting details
|
475 |
|
476 |
6. **Make the Caption**: Click the "Make My Caption!" button and watch the magic happen!
|
|
|
478 |
Remember, have fun and be creative with your captions!
|
479 |
|
480 |
## Tips for Great Captions:
|
|
|
481 |
- Try different types to see what you like best
|
482 |
- Experiment with formal and informal tones for fun variations
|
483 |
- Adjust the length to get just the right amount of detail
|