Spaces:
Configuration error
Configuration error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -103,89 +103,13 @@ DEFAULT_STEP = 3
|
|
| 103 |
|
| 104 |
|
| 105 |
css = """
|
| 106 |
-
/*
|
| 107 |
:root {
|
| 108 |
-
--
|
| 109 |
-
--
|
| 110 |
-
--bg-secondary: #161616;
|
| 111 |
-
--bg-tertiary: #1e1e1e;
|
| 112 |
-
--text-primary: #e8e8e8;
|
| 113 |
-
--text-secondary: #8a8a8a;
|
| 114 |
-
--border-color: #2a2a2a;
|
| 115 |
-
--border-light: #3a3a3a;
|
| 116 |
-
--accent: #b8b8b8;
|
| 117 |
}
|
| 118 |
|
| 119 |
-
|
| 120 |
-
background: var(--bg-primary) !important;
|
| 121 |
-
color: var(--text-primary) !important;
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
.block {
|
| 125 |
-
background: var(--bg-secondary) !important;
|
| 126 |
-
border-color: var(--border-color) !important;
|
| 127 |
-
}
|
| 128 |
-
|
| 129 |
-
input, textarea, select {
|
| 130 |
-
background: var(--bg-tertiary) !important;
|
| 131 |
-
border-color: var(--border-color) !important;
|
| 132 |
-
color: var(--text-primary) !important;
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
label, .label-wrap {
|
| 136 |
-
color: var(--text-secondary) !important;
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
/* Overwrite Gradio Default Style */
|
| 140 |
-
.stepper-wrapper {
|
| 141 |
-
padding: 0;
|
| 142 |
-
}
|
| 143 |
-
|
| 144 |
-
.stepper-container {
|
| 145 |
-
padding: 0;
|
| 146 |
-
align-items: center;
|
| 147 |
-
}
|
| 148 |
-
|
| 149 |
-
.step-button {
|
| 150 |
-
flex-direction: row;
|
| 151 |
-
}
|
| 152 |
-
|
| 153 |
-
.step-connector {
|
| 154 |
-
transform: none;
|
| 155 |
-
}
|
| 156 |
-
|
| 157 |
-
.step-number {
|
| 158 |
-
width: 16px;
|
| 159 |
-
height: 16px;
|
| 160 |
-
background: var(--bg-tertiary) !important;
|
| 161 |
-
border-color: var(--border-color) !important;
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
.step-label {
|
| 165 |
-
position: relative;
|
| 166 |
-
bottom: 0;
|
| 167 |
-
color: var(--text-secondary) !important;
|
| 168 |
-
}
|
| 169 |
-
|
| 170 |
-
.wrap.center.full {
|
| 171 |
-
inset: 0;
|
| 172 |
-
height: 100%;
|
| 173 |
-
}
|
| 174 |
-
|
| 175 |
-
.wrap.center.full.translucent {
|
| 176 |
-
background: var(--bg-secondary);
|
| 177 |
-
}
|
| 178 |
-
|
| 179 |
-
.meta-text-center {
|
| 180 |
-
display: block !important;
|
| 181 |
-
position: absolute !important;
|
| 182 |
-
top: unset !important;
|
| 183 |
-
bottom: 0 !important;
|
| 184 |
-
right: 0 !important;
|
| 185 |
-
transform: unset !important;
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
/* Previewer */
|
| 189 |
.previewer-container {
|
| 190 |
position: relative;
|
| 191 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
@@ -197,7 +121,6 @@ label, .label-wrap {
|
|
| 197 |
flex-direction: column;
|
| 198 |
align-items: center;
|
| 199 |
justify-content: center;
|
| 200 |
-
background: var(--bg-void);
|
| 201 |
}
|
| 202 |
|
| 203 |
.previewer-container .tips-icon {
|
|
@@ -206,8 +129,8 @@ label, .label-wrap {
|
|
| 206 |
top: 10px;
|
| 207 |
z-index: 10;
|
| 208 |
border-radius: 10px;
|
| 209 |
-
color:
|
| 210 |
-
background-color: var(--accent);
|
| 211 |
padding: 3px 6px;
|
| 212 |
user-select: none;
|
| 213 |
}
|
|
@@ -216,9 +139,8 @@ label, .label-wrap {
|
|
| 216 |
position: absolute;
|
| 217 |
right: 10px;
|
| 218 |
top: 50px;
|
| 219 |
-
color:
|
| 220 |
-
background-color: var(--
|
| 221 |
-
border: 1px solid var(--border-light);
|
| 222 |
border-radius: 10px;
|
| 223 |
padding: 6px;
|
| 224 |
text-align: left;
|
|
@@ -232,7 +154,6 @@ label, .label-wrap {
|
|
| 232 |
.previewer-container .tips-text p {
|
| 233 |
font-size: 14px;
|
| 234 |
line-height: 1.2;
|
| 235 |
-
color: var(--text-secondary);
|
| 236 |
}
|
| 237 |
|
| 238 |
.tips-icon:hover + .tips-text {
|
|
@@ -240,7 +161,6 @@ label, .label-wrap {
|
|
| 240 |
opacity: 100%;
|
| 241 |
}
|
| 242 |
|
| 243 |
-
/* Row 1: Display Modes */
|
| 244 |
.previewer-container .mode-row {
|
| 245 |
width: 100%;
|
| 246 |
display: flex;
|
|
@@ -256,17 +176,16 @@ label, .label-wrap {
|
|
| 256 |
cursor: pointer;
|
| 257 |
opacity: 0.5;
|
| 258 |
transition: all 0.2s;
|
| 259 |
-
border: 2px solid
|
| 260 |
object-fit: cover;
|
| 261 |
}
|
| 262 |
.previewer-container .mode-btn:hover { opacity: 0.9; transform: scale(1.1); }
|
| 263 |
.previewer-container .mode-btn.active {
|
| 264 |
opacity: 1;
|
| 265 |
-
border-color: var(--accent);
|
| 266 |
transform: scale(1.1);
|
| 267 |
}
|
| 268 |
|
| 269 |
-
/* Row 2: Display Image */
|
| 270 |
.previewer-container .display-row {
|
| 271 |
margin-bottom: 20px;
|
| 272 |
min-height: 400px;
|
|
@@ -287,7 +206,6 @@ label, .label-wrap {
|
|
| 287 |
display: block;
|
| 288 |
}
|
| 289 |
|
| 290 |
-
/* Row 3: Custom HTML Slider */
|
| 291 |
.previewer-container .slider-row {
|
| 292 |
width: 100%;
|
| 293 |
display: flex;
|
|
@@ -307,25 +225,24 @@ label, .label-wrap {
|
|
| 307 |
width: 100%;
|
| 308 |
height: 8px;
|
| 309 |
cursor: pointer;
|
| 310 |
-
background:
|
| 311 |
border-radius: 5px;
|
| 312 |
}
|
| 313 |
.previewer-container input[type=range]::-webkit-slider-thumb {
|
| 314 |
height: 20px;
|
| 315 |
width: 20px;
|
| 316 |
border-radius: 50%;
|
| 317 |
-
background: var(--accent);
|
| 318 |
cursor: pointer;
|
| 319 |
-webkit-appearance: none;
|
| 320 |
margin-top: -6px;
|
| 321 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.
|
| 322 |
transition: transform 0.1s;
|
| 323 |
}
|
| 324 |
.previewer-container input[type=range]::-webkit-slider-thumb:hover {
|
| 325 |
transform: scale(1.2);
|
| 326 |
}
|
| 327 |
|
| 328 |
-
/* Overwrite Previewer Block Style */
|
| 329 |
.gradio-container .padded:has(.previewer-container) {
|
| 330 |
padding: 0 !important;
|
| 331 |
}
|
|
@@ -335,24 +252,6 @@ label, .label-wrap {
|
|
| 335 |
top: 0;
|
| 336 |
left: 0;
|
| 337 |
}
|
| 338 |
-
|
| 339 |
-
/* Gallery styling */
|
| 340 |
-
.gallery {
|
| 341 |
-
background: var(--bg-tertiary) !important;
|
| 342 |
-
border-color: var(--border-color) !important;
|
| 343 |
-
}
|
| 344 |
-
|
| 345 |
-
/* Accordion */
|
| 346 |
-
.accordion {
|
| 347 |
-
background: var(--bg-secondary) !important;
|
| 348 |
-
border-color: var(--border-color) !important;
|
| 349 |
-
}
|
| 350 |
-
|
| 351 |
-
/* Scrollbar */
|
| 352 |
-
::-webkit-scrollbar { width: 10px; }
|
| 353 |
-
::-webkit-scrollbar-track { background: var(--bg-secondary); }
|
| 354 |
-
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 5px; }
|
| 355 |
-
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
|
| 356 |
"""
|
| 357 |
|
| 358 |
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
css = """
|
| 106 |
+
/* Minimal color overrides for dark theme */
|
| 107 |
:root {
|
| 108 |
+
--color-accent: #b8b8b8 !important;
|
| 109 |
+
--color-accent-soft: rgba(184, 184, 184, 0.15) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
+
/* Previewer (required for custom HTML viewer) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
.previewer-container {
|
| 114 |
position: relative;
|
| 115 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
|
|
| 121 |
flex-direction: column;
|
| 122 |
align-items: center;
|
| 123 |
justify-content: center;
|
|
|
|
| 124 |
}
|
| 125 |
|
| 126 |
.previewer-container .tips-icon {
|
|
|
|
| 129 |
top: 10px;
|
| 130 |
z-index: 10;
|
| 131 |
border-radius: 10px;
|
| 132 |
+
color: #fff;
|
| 133 |
+
background-color: var(--color-accent);
|
| 134 |
padding: 3px 6px;
|
| 135 |
user-select: none;
|
| 136 |
}
|
|
|
|
| 139 |
position: absolute;
|
| 140 |
right: 10px;
|
| 141 |
top: 50px;
|
| 142 |
+
color: #fff;
|
| 143 |
+
background-color: var(--color-accent);
|
|
|
|
| 144 |
border-radius: 10px;
|
| 145 |
padding: 6px;
|
| 146 |
text-align: left;
|
|
|
|
| 154 |
.previewer-container .tips-text p {
|
| 155 |
font-size: 14px;
|
| 156 |
line-height: 1.2;
|
|
|
|
| 157 |
}
|
| 158 |
|
| 159 |
.tips-icon:hover + .tips-text {
|
|
|
|
| 161 |
opacity: 100%;
|
| 162 |
}
|
| 163 |
|
|
|
|
| 164 |
.previewer-container .mode-row {
|
| 165 |
width: 100%;
|
| 166 |
display: flex;
|
|
|
|
| 176 |
cursor: pointer;
|
| 177 |
opacity: 0.5;
|
| 178 |
transition: all 0.2s;
|
| 179 |
+
border: 2px solid #ddd;
|
| 180 |
object-fit: cover;
|
| 181 |
}
|
| 182 |
.previewer-container .mode-btn:hover { opacity: 0.9; transform: scale(1.1); }
|
| 183 |
.previewer-container .mode-btn.active {
|
| 184 |
opacity: 1;
|
| 185 |
+
border-color: var(--color-accent);
|
| 186 |
transform: scale(1.1);
|
| 187 |
}
|
| 188 |
|
|
|
|
| 189 |
.previewer-container .display-row {
|
| 190 |
margin-bottom: 20px;
|
| 191 |
min-height: 400px;
|
|
|
|
| 206 |
display: block;
|
| 207 |
}
|
| 208 |
|
|
|
|
| 209 |
.previewer-container .slider-row {
|
| 210 |
width: 100%;
|
| 211 |
display: flex;
|
|
|
|
| 225 |
width: 100%;
|
| 226 |
height: 8px;
|
| 227 |
cursor: pointer;
|
| 228 |
+
background: #ddd;
|
| 229 |
border-radius: 5px;
|
| 230 |
}
|
| 231 |
.previewer-container input[type=range]::-webkit-slider-thumb {
|
| 232 |
height: 20px;
|
| 233 |
width: 20px;
|
| 234 |
border-radius: 50%;
|
| 235 |
+
background: var(--color-accent);
|
| 236 |
cursor: pointer;
|
| 237 |
-webkit-appearance: none;
|
| 238 |
margin-top: -6px;
|
| 239 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
| 240 |
transition: transform 0.1s;
|
| 241 |
}
|
| 242 |
.previewer-container input[type=range]::-webkit-slider-thumb:hover {
|
| 243 |
transform: scale(1.2);
|
| 244 |
}
|
| 245 |
|
|
|
|
| 246 |
.gradio-container .padded:has(.previewer-container) {
|
| 247 |
padding: 0 !important;
|
| 248 |
}
|
|
|
|
| 252 |
top: 0;
|
| 253 |
left: 0;
|
| 254 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
"""
|
| 256 |
|
| 257 |
|