Spaces:
Running
Running
Aesthetic changes: remove fade effect, borders, and change color scheme.
Browse files
app.py
CHANGED
|
@@ -137,7 +137,7 @@ Each subsequent row of images was generated using the same process, but with a d
|
|
| 137 |
See SamplePrompts.csv for the list of prompts used and their descriptions.
|
| 138 |
"""
|
| 139 |
|
| 140 |
-
TOOLTIP_NOTE_HTML = '<div class="hover-hint">
|
| 141 |
|
| 142 |
HOVER_HINT_CSS = """
|
| 143 |
/* Solid, visible underline for tagged items */
|
|
@@ -162,6 +162,13 @@ HOVER_HINT_CSS = """
|
|
| 162 |
bottom: 6px;
|
| 163 |
text-align: right;
|
| 164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
"""
|
| 166 |
|
| 167 |
|
|
@@ -221,43 +228,6 @@ css = HOVER_HINT_CSS + """
|
|
| 221 |
.scrollable-content::-webkit-scrollbar-thumb{ background: rgba(180,180,180,.9); border-radius: 8px; }
|
| 222 |
.scrollable-content::-webkit-scrollbar-track{ background: rgba(0,0,0,.15); }
|
| 223 |
|
| 224 |
-
/* --- Fade that blends into the pane background, no chip --- */
|
| 225 |
-
.scroll-fade {
|
| 226 |
-
position: relative;
|
| 227 |
-
/* ensure our ::after overlay paints above children */
|
| 228 |
-
isolation: isolate;
|
| 229 |
-
}
|
| 230 |
-
|
| 231 |
-
.scroll-fade::after{
|
| 232 |
-
content: "";
|
| 233 |
-
position: absolute;
|
| 234 |
-
left: 0; right: 0; bottom: 0;
|
| 235 |
-
height: 20px; /* a hair taller; tweak if you like */
|
| 236 |
-
pointer-events: none;
|
| 237 |
-
/* transparent → panel background (Gradio theme var, with dark fallback) */
|
| 238 |
-
background: linear-gradient(
|
| 239 |
-
to bottom,
|
| 240 |
-
rgba(0,0,0,0),
|
| 241 |
-
var(--background-fill-secondary, #1f2937)
|
| 242 |
-
);
|
| 243 |
-
transition: opacity .18s ease;
|
| 244 |
-
z-index: 3; /* sit above the scroller’s content */
|
| 245 |
-
}
|
| 246 |
-
|
| 247 |
-
.scroll-fade.at-bottom::after { opacity: 0; }
|
| 248 |
-
|
| 249 |
-
/* no chip */
|
| 250 |
-
.scroll-fade::before { content: none; }
|
| 251 |
-
|
| 252 |
-
/* --- Subtle divider between Unknown and Suggested panes --- */
|
| 253 |
-
.pane-right {
|
| 254 |
-
border-left: 1px solid var(--block-border-color, rgba(255,255,255,.16));
|
| 255 |
-
padding-left: 16px; /* keep content away from divider */
|
| 256 |
-
}
|
| 257 |
-
.pane-left {
|
| 258 |
-
padding-right: 16px; /* symmetrical spacing */
|
| 259 |
-
}
|
| 260 |
-
|
| 261 |
/* (Optional) make both scroll panes taller so they fill more of the column */
|
| 262 |
.pane-left .scrollable-content,
|
| 263 |
.pane-right .scrollable-content {
|
|
@@ -983,12 +953,12 @@ def format_annotated_html(bad_entities, known_entities, text):
|
|
| 983 |
"Model Specific": "This is not an e621 tag, but may still be valid with the right model. Check your model's documentation. If the tag is not mentioned in the documentation, do not use it."
|
| 984 |
}
|
| 985 |
color_map = {
|
| 986 |
-
"
|
| 987 |
-
"Duplicate": ("black", "
|
| 988 |
-
"
|
| 989 |
-
"
|
| 990 |
-
"
|
| 991 |
-
"
|
| 992 |
}
|
| 993 |
|
| 994 |
# Splice from the original text so indexes stay valid.
|
|
@@ -1023,7 +993,11 @@ def format_annotated_html(bad_entities, known_entities, text):
|
|
| 1023 |
)
|
| 1024 |
else:
|
| 1025 |
fg, bg = color_map.get(label, ("black", "white"))
|
| 1026 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1027 |
|
| 1028 |
html_text = html_text[:start] + html_part + html_text[end:]
|
| 1029 |
|
|
|
|
| 137 |
See SamplePrompts.csv for the list of prompts used and their descriptions.
|
| 138 |
"""
|
| 139 |
|
| 140 |
+
TOOLTIP_NOTE_HTML = '<div class="hover-hint">Hover over underlined items for more info.</div>'
|
| 141 |
|
| 142 |
HOVER_HINT_CSS = """
|
| 143 |
/* Solid, visible underline for tagged items */
|
|
|
|
| 162 |
bottom: 6px;
|
| 163 |
text-align: right;
|
| 164 |
}
|
| 165 |
+
|
| 166 |
+
/* Extra padding around commas */
|
| 167 |
+
.badpad{
|
| 168 |
+
display:inline-block; /* make padding take effect */
|
| 169 |
+
padding: 0 0.60em; /* ~two extra spaces total on each side of ',' -> ~3-ch width overall */
|
| 170 |
+
border-radius: 3px; /* a tiny rounding looks nicer on a blocky background */
|
| 171 |
+
}
|
| 172 |
"""
|
| 173 |
|
| 174 |
|
|
|
|
| 228 |
.scrollable-content::-webkit-scrollbar-thumb{ background: rgba(180,180,180,.9); border-radius: 8px; }
|
| 229 |
.scrollable-content::-webkit-scrollbar-track{ background: rgba(0,0,0,.15); }
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
/* (Optional) make both scroll panes taller so they fill more of the column */
|
| 232 |
.pane-left .scrollable-content,
|
| 233 |
.pane-right .scrollable-content {
|
|
|
|
| 953 |
"Model Specific": "This is not an e621 tag, but may still be valid with the right model. Check your model's documentation. If the tag is not mentioned in the documentation, do not use it."
|
| 954 |
}
|
| 955 |
color_map = {
|
| 956 |
+
"Double Comma": ("black", "#E69F00"), # Orange — black text
|
| 957 |
+
"Duplicate": ("black", "#F0E442"), # Yellow — black text
|
| 958 |
+
"Model Specific": ("black", "#56B4E9"), # Sky blue — black text
|
| 959 |
+
"Move Comma Inside Parentheses": ("white", "#009E73"), # Bluish green
|
| 960 |
+
"Remove Final Comma": ("white", "#0072B2"), # Blue
|
| 961 |
+
"Unknown Tag": ("white", "#D55E00"), # Vermilion — danger
|
| 962 |
}
|
| 963 |
|
| 964 |
# Splice from the original text so indexes stay valid.
|
|
|
|
| 993 |
)
|
| 994 |
else:
|
| 995 |
fg, bg = color_map.get(label, ("black", "white"))
|
| 996 |
+
# Make single-character issues (commas) easier to see by padding the span
|
| 997 |
+
pad_labels = ("Remove Final Comma", "Move Comma Inside Parentheses", "Double Comma")
|
| 998 |
+
pad_class = "badpad" if label in pad_labels else ""
|
| 999 |
+
class_attr = f' class="{pad_class}"' if pad_class else ""
|
| 1000 |
+
html_part = f'<span{class_attr} style="background-color: {bg}; color: {fg};">{disp}</span>'
|
| 1001 |
|
| 1002 |
html_text = html_text[:start] + html_part + html_text[end:]
|
| 1003 |
|