Spaces:
Running
on
Zero
Running
on
Zero
Improve UI design with modern styling, better layout, and visual enhancements
Browse files
app.py
CHANGED
|
@@ -292,14 +292,93 @@ def generate_video(prompt, aspect_ratio, cfg, seed, target_length, checkpoint_fi
|
|
| 292 |
return None, f"Error: {str(e)}"
|
| 293 |
|
| 294 |
|
| 295 |
-
# Create Gradio interface
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
|
| 302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
""")
|
| 304 |
|
| 305 |
with gr.Tabs():
|
|
|
|
| 292 |
return None, f"Error: {str(e)}"
|
| 293 |
|
| 294 |
|
| 295 |
+
# Create Gradio interface with custom CSS
|
| 296 |
+
custom_css = """
|
| 297 |
+
.gradio-container {
|
| 298 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 299 |
+
}
|
| 300 |
+
.main-header {
|
| 301 |
+
text-align: center;
|
| 302 |
+
padding: 2rem 0;
|
| 303 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 304 |
+
color: white;
|
| 305 |
+
border-radius: 10px;
|
| 306 |
+
margin-bottom: 2rem;
|
| 307 |
+
}
|
| 308 |
+
.main-header h1 {
|
| 309 |
+
margin: 0;
|
| 310 |
+
font-size: 2.5rem;
|
| 311 |
+
font-weight: 700;
|
| 312 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
|
| 313 |
+
}
|
| 314 |
+
.main-header p {
|
| 315 |
+
margin: 0.5rem 0 0 0;
|
| 316 |
+
font-size: 1.1rem;
|
| 317 |
+
opacity: 0.95;
|
| 318 |
+
}
|
| 319 |
+
.info-box {
|
| 320 |
+
background: #f0f4ff;
|
| 321 |
+
border-left: 4px solid #667eea;
|
| 322 |
+
padding: 1rem;
|
| 323 |
+
border-radius: 5px;
|
| 324 |
+
margin-bottom: 1.5rem;
|
| 325 |
+
}
|
| 326 |
+
.input-section {
|
| 327 |
+
background: #fafafa;
|
| 328 |
+
padding: 1.5rem;
|
| 329 |
+
border-radius: 10px;
|
| 330 |
+
border: 1px solid #e0e0e0;
|
| 331 |
+
}
|
| 332 |
+
.output-section {
|
| 333 |
+
background: white;
|
| 334 |
+
padding: 1.5rem;
|
| 335 |
+
border-radius: 10px;
|
| 336 |
+
border: 1px solid #e0e0e0;
|
| 337 |
+
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
| 338 |
+
}
|
| 339 |
+
.generate-btn {
|
| 340 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 341 |
+
color: white !important;
|
| 342 |
+
font-weight: 600 !important;
|
| 343 |
+
padding: 0.75rem 2rem !important;
|
| 344 |
+
border-radius: 8px !important;
|
| 345 |
+
border: none !important;
|
| 346 |
+
font-size: 1rem !important;
|
| 347 |
+
transition: transform 0.2s, box-shadow 0.2s !important;
|
| 348 |
+
}
|
| 349 |
+
.generate-btn:hover {
|
| 350 |
+
transform: translateY(-2px);
|
| 351 |
+
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
|
| 352 |
+
}
|
| 353 |
+
.status-box {
|
| 354 |
+
font-family: 'Monaco', 'Menlo', monospace;
|
| 355 |
+
font-size: 0.9rem;
|
| 356 |
+
line-height: 1.6;
|
| 357 |
+
}
|
| 358 |
+
"""
|
| 359 |
+
|
| 360 |
+
with gr.Blocks(
|
| 361 |
+
title="STARFlow - Text-to-Image & Video Generation",
|
| 362 |
+
theme=gr.themes.Soft(primary_hue="purple"),
|
| 363 |
+
css=custom_css
|
| 364 |
+
) as demo:
|
| 365 |
+
# Header
|
| 366 |
+
gr.HTML("""
|
| 367 |
+
<div class="main-header">
|
| 368 |
+
<h1>🎨 STARFlow</h1>
|
| 369 |
+
<p>Scalable Transformer Auto-Regressive Flow</p>
|
| 370 |
+
<p style="font-size: 0.95rem; margin-top: 0.5rem; opacity: 0.9;">
|
| 371 |
+
Generate high-quality images and videos from text prompts
|
| 372 |
+
</p>
|
| 373 |
+
</div>
|
| 374 |
+
""")
|
| 375 |
|
| 376 |
+
# Info box
|
| 377 |
+
gr.Markdown("""
|
| 378 |
+
<div class="info-box">
|
| 379 |
+
<strong>ℹ️ Note:</strong> Checkpoints are automatically downloaded from Model Hub on first use.
|
| 380 |
+
First generation may take 10-20 minutes for download and model loading.
|
| 381 |
+
</div>
|
| 382 |
""")
|
| 383 |
|
| 384 |
with gr.Tabs():
|