leoeric commited on
Commit
3421c13
·
1 Parent(s): 57092df

Fix CSS by using gr.HTML instead of css parameter for compatibility

Browse files
Files changed (1) hide show
  1. app.py +68 -69
app.py CHANGED
@@ -292,75 +292,74 @@ 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 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
- css=custom_css
363
- ) as demo:
364
  # Header
365
  gr.HTML("""
366
  <div class="main-header">
 
292
  return None, f"Error: {str(e)}"
293
 
294
 
295
+ # Create Gradio interface
296
+ with gr.Blocks(title="STARFlow - Text-to-Image & Video Generation") as demo:
297
+ # Add custom CSS using gr.HTML
298
+ gr.HTML("""
299
+ <style>
300
+ .gradio-container {
301
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
302
+ }
303
+ .main-header {
304
+ text-align: center;
305
+ padding: 2rem 0;
306
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
307
+ color: white;
308
+ border-radius: 10px;
309
+ margin-bottom: 2rem;
310
+ }
311
+ .main-header h1 {
312
+ margin: 0;
313
+ font-size: 2.5rem;
314
+ font-weight: 700;
315
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
316
+ }
317
+ .main-header p {
318
+ margin: 0.5rem 0 0 0;
319
+ font-size: 1.1rem;
320
+ opacity: 0.95;
321
+ }
322
+ .info-box {
323
+ background: #f0f4ff;
324
+ border-left: 4px solid #667eea;
325
+ padding: 1rem;
326
+ border-radius: 5px;
327
+ margin-bottom: 1.5rem;
328
+ }
329
+ .input-section {
330
+ background: #fafafa;
331
+ padding: 1.5rem;
332
+ border-radius: 10px;
333
+ border: 1px solid #e0e0e0;
334
+ }
335
+ .output-section {
336
+ background: white;
337
+ padding: 1.5rem;
338
+ border-radius: 10px;
339
+ border: 1px solid #e0e0e0;
340
+ box-shadow: 0 2px 8px rgba(0,0,0,0.05);
341
+ }
342
+ .generate-btn {
343
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
344
+ color: white !important;
345
+ font-weight: 600 !important;
346
+ padding: 0.75rem 2rem !important;
347
+ border-radius: 8px !important;
348
+ border: none !important;
349
+ font-size: 1rem !important;
350
+ transition: transform 0.2s, box-shadow 0.2s !important;
351
+ }
352
+ .generate-btn:hover {
353
+ transform: translateY(-2px);
354
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
355
+ }
356
+ .status-box {
357
+ font-family: 'Monaco', 'Menlo', monospace;
358
+ font-size: 0.9rem;
359
+ line-height: 1.6;
360
+ }
361
+ </style>
362
+ """)
 
363
  # Header
364
  gr.HTML("""
365
  <div class="main-header">