Director Bake-Off Studio
Let legendary directors compete to bring your vision to life
#!/usr/bin/env python3 import gradio as gr import asyncio from director_bake_off import run_bake_off import traceback # Swedish-inspired color palette and styling SWEDISH_CSS = """ /* Swedish Minimalist Design */ :root { --primary-white: #FFFFFF; --soft-gray: #F5F5F5; --muted-blue: #4A90A4; --warm-beige: #E8DCC6; --charcoal: #2C2C2C; --light-blue: #E8F4F8; --accent-gold: #D4AF37; --success-green: #7FB069; --border-gray: #E0E0E0; } /* Global styling */ .gradio-container { font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important; background: linear-gradient(135deg, var(--soft-gray) 0%, var(--primary-white) 100%) !important; min-height: 100vh; } /* Header styling */ .main-header { text-align: center; padding: 2rem 0; background: var(--primary-white); border-bottom: 1px solid var(--border-gray); margin-bottom: 2rem; } .main-title { font-size: 2.5rem; font-weight: 300; color: var(--charcoal); margin-bottom: 0.5rem; letter-spacing: -0.02em; } .main-subtitle { font-size: 1.1rem; color: var(--muted-blue); font-weight: 400; margin-bottom: 0; } /* Input section styling */ .input-section { background: var(--primary-white); border-radius: 12px; padding: 2rem; box-shadow: 0 2px 20px rgba(0,0,0,0.05); border: 1px solid var(--border-gray); margin-bottom: 2rem; } .input-label { font-size: 1rem; font-weight: 500; color: var(--charcoal); margin-bottom: 0.5rem; display: block; } /* Button styling */ .submit-btn { background: linear-gradient(135deg, var(--muted-blue) 0%, #5BA0B5 100%) !important; border: none !important; border-radius: 8px !important; padding: 12px 32px !important; font-weight: 500 !important; font-size: 1rem !important; color: white !important; transition: all 0.3s ease !important; box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3) !important; } .submit-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 6px 25px rgba(74, 144, 164, 0.4) !important; } /* Results section */ .results-container { background: var(--primary-white); border-radius: 12px; padding: 2rem; box-shadow: 0 2px 20px rgba(0,0,0,0.05); border: 1px solid var(--border-gray); margin-top: 2rem; } .director-card { background: var(--light-blue); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; border-left: 4px solid var(--muted-blue); transition: all 0.3s ease; } .director-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); } .rank-badge { display: inline-block; background: var(--accent-gold); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; } .rank-1 { background: var(--accent-gold); } .rank-2 { background: #C0C0C0; } .rank-3 { background: #CD7F32; } .director-name { font-size: 1.3rem; font-weight: 600; color: var(--charcoal); margin-bottom: 1rem; } .prompt-text { font-size: 1rem; line-height: 1.6; color: var(--charcoal); background: var(--primary-white); padding: 1rem; border-radius: 8px; border: 1px solid var(--border-gray); margin-bottom: 1rem; } .additional-director { background: var(--warm-beige); border-radius: 10px; padding: 1.5rem; margin-bottom: 2rem; border-left: 4px solid var(--success-green); } .explanation-section { background: var(--soft-gray); border-radius: 10px; padding: 1.5rem; margin-top: 2rem; border-left: 4px solid var(--muted-blue); } .section-title { font-size: 1.2rem; font-weight: 600; color: var(--charcoal); margin-bottom: 1rem; } /* Loading animation */ .loading { text-align: center; padding: 2rem; color: var(--muted-blue); } /* Responsive design */ @media (max-width: 768px) { .main-title { font-size: 2rem; } .input-section, .results-container { padding: 1.5rem; margin: 1rem; } .director-card { padding: 1rem; } } /* Custom textbox styling */ .gr-textbox { border-radius: 8px !important; border: 1px solid var(--border-gray) !important; } .gr-textbox:focus { border-color: var(--muted-blue) !important; box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1) !important; } """ def format_results_html(result): """Format the results into beautiful HTML with Swedish design.""" if not result: return "
{traceback.format_exc()}
Let legendary directors compete to bring your vision to life
Powered by DSPy and the creative genius of legendary directors 🎬