Spaces:
Running
Running
Aesthetic changes: remove fade effect, borders, and change color scheme.
Browse files136 unmodified lines13713813914014014114214318 unmodified lines16216316416516616716816917017117217317453 unmodified lines228229230224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260231232233719 unmodified lines95395495598698798898999099195695795895996096196296396428 unmodified lines99399499599699799899910261000100110021003136 unmodified linesSee SamplePrompts.csv for the list of prompts used and their descriptions.
"""
TOOLTIP_NOTE_HTML = '<div class="hover-hint">Underlined items can be hovered for more info.</div>'
TOOLTIP_NOTE_HTML = '<div class="hover-hint">Hover over underlined items for more info.</div>'
HOVER_HINT_CSS = """
/* Solid, visible underline for tagged items */18 unmodified lines bottom: 6px;
text-align: right;
}
/* Extra padding around commas */
.badpad{
display:inline-block; /* make padding take effect */
padding: 0 0.60em; /* ~two extra spaces total on each side of ',' -> ~3-ch width overall */
border-radius: 3px; /* a tiny rounding looks nicer on a blocky background */
}
"""
53 unmodified lines.scrollable-content::-webkit-scrollbar-thumb{ background: rgba(180,180,180,.9); border-radius: 8px; }
.scrollable-content::-webkit-scrollbar-track{ background: rgba(0,0,0,.15); }
/* --- Fade that blends into the pane background, no chip --- */
.scroll-fade {
position: relative;
/* ensure our ::after overlay paints above children */
isolation: isolate;
}
.scroll-fade::after{
content: "";
position: absolute;
left: 0; right: 0; bottom: 0;
height: 20px; /* a hair taller; tweak if you like */
pointer-events: none;
/* transparent → panel background (Gradio theme var, with dark fallback) */
background: linear-gradient(
to bottom,
rgba(0,0,0,0),
var(--background-fill-secondary, #1f2937)
);
transition: opacity .18s ease;
z-index: 3; /* sit above the scroller’s content */
}
.scroll-fade.at-bottom::after { opacity: 0; }
/* no chip */
.scroll-fade::before { content: none; }
/* --- Subtle divider between Unknown and Suggested panes --- */
.pane-right {
border-left: 1px solid var(--block-border-color, rgba(255,255,255,.16));
padding-left: 16px; /* keep content away from divider */
}
.pane-left {
padding-right: 16px; /* symmetrical spacing */
}
/* (Optional) make both scroll panes taller so they fill more of the column */
.pane-left .scrollable-content,
.pane-right .scrollable-content {719 unmodified lines "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."
}
color_map = {
"Unknown Tag": ("white", "red"),
"Duplicate": ("black", "yellow"),
"Move Comma Inside Parentheses": ("white", "green"),
"Double Comma": ("white", "orange"),
"Model Specific": ("black", "lightgray"),
"Remove Final Comma": ("white", "brown")
"Double Comma": ("black", "#E69F00"), # Orange — black text
"Duplicate": ("black", "#F0E442"), # Yellow — black text
"Model Specific": ("black", "#56B4E9"), # Sky blue — black text
"Move Comma Inside Parentheses": ("white", "#009E73"), # Bluish green
"Remove Final Comma": ("white", "#0072B2"), # Blue
"Unknown Tag": ("white", "#D55E00"), # Vermilion — danger
}
# Splice from the original text so indexes stay valid.28 unmodified lines )
else:
fg, bg = color_map.get(label, ("black", "white"))
# Make single-character issues (commas) easier to see by padding the span
pad_labels = ("Remove Final Comma", "Move Comma Inside Parentheses", "Double Comma")
pad_class = "badpad" if label in pad_labels else ""
class_attr = f' class="{pad_class}"' if pad_class else ""
html_part = f'<span style="background-color: {bg}; color: {fg};">{disp}</span>'
html_part = f'<span{class_attr} style="background-color: {bg}; color: {fg};">{disp}</span>'
html_text = html_text[:start] + html_part + html_text[end:]
app.py+19-45