-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
682 lines (604 loc) · 27.6 KB
/
Copy pathapp.py
File metadata and controls
682 lines (604 loc) · 27.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
"""Darc Studio - Enterprise AI Video, Movie & Ad Creation Suite.
Flagship studio for generating viral social scenes, cinematic micro-dramas,
POV thrillers, movie trailers, and high-converting video ads powered by
next-generation video models (ByteDance Seedance 2.5/2.0, Kling 2.0, Wan 2.2,
Minimax Hailuo-02, Luma Ray 2, Runway Gen-3, Sora, and Veo 2).
Run with: python3 app.py
"""
import json
import os
import sys
import traceback
from pathlib import Path
from typing import Dict, List, Optional, Tuple
import gradio as gr
import gradio_client.utils
# Pydantic v2 JSON schema compatibility patch for Gradio 4
_orig_json_schema = gradio_client.utils._json_schema_to_python_type
def _safe_json_schema(schema, defs=None):
if isinstance(schema, bool):
return "Any" if schema else "None"
return _orig_json_schema(schema, defs)
gradio_client.utils._json_schema_to_python_type = _safe_json_schema
sys.path.insert(0, str(Path(__file__).resolve().parent))
from src.avatars import list_actors
from src.config import (
AVATAR_MODEL_CHOICES,
PLATFORM_PRESETS,
QUALITY_PRESETS,
VIDEO_MODEL_CHOICES,
available_providers,
ensure_env_loaded,
)
from src.llm_director import (
CINEMATIC_PROMPTS_BY_STYLE,
HOOK_FRAMEWORKS,
generate_movie_timeline,
)
from src.models import BrandKit
from src.pipeline import run_darcads_pipeline, run_movie_pipeline
from src.utils import ffmpeg_available
ensure_env_loaded()
FRAMEWORK_CHOICES = [(f.name, key) for key, f in sorted(HOOK_FRAMEWORKS.items())]
ACTOR_METADATA = {
"emma_creator": {"title": "Emma", "role": "Lifestyle & Creator", "vibe": "Energetic, authentic, high-conversion"},
"marcus_tech": {"title": "Marcus", "role": "Tech & Analysis", "vibe": "Sharp, insightful, premium"},
"sophia_fashion": {"title": "Sophia", "role": "Beauty & Luxury", "vibe": "Chic, aesthetic, cinematic"},
"david_founder": {"title": "David", "role": "Executive & Founder", "vibe": "Authoritative, confident, direct"},
}
PREMIUM_CSS = """
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');
:root {
--bg-primary: #05070a;
--bg-secondary: #0a0e14;
--bg-tertiary: #101520;
--bg-glass: rgba(13, 18, 27, 0.82);
--border-glass: rgba(255, 255, 255, 0.08);
--accent-emerald: #00f59b;
--accent-violet: #8b5cf6;
--accent-cyan: #00d2ff;
--text-main: #f8fafc;
--text-muted: #8492a6;
}
body, .gradio-container {
background-color: var(--bg-primary) !important;
background-image:
radial-gradient(circle at 50% 0%, rgba(0, 245, 155, 0.07) 0%, transparent 55%),
radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 45%),
radial-gradient(circle at 10% 80%, rgba(0, 210, 255, 0.04) 0%, transparent 45%) !important;
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
color: var(--text-main) !important;
min-height: 100vh;
}
/* Header & Badges */
.darc-hero-wrapper {
background: linear-gradient(180deg, rgba(14, 20, 30, 0.9) 0%, rgba(8, 12, 18, 0.7) 100%);
border: 1px solid var(--border-glass);
border-radius: 20px;
padding: 30px 32px;
margin-bottom: 24px;
box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
backdrop-filter: blur(28px);
position: relative;
overflow: hidden;
}
.darc-hero-wrapper::before {
content: '';
position: absolute;
top: 0;
left: 20%;
right: 20%;
height: 1px;
background: linear-gradient(90deg, transparent, var(--accent-emerald), var(--accent-violet), transparent);
}
.darc-badge-pill {
display: inline-flex;
align-items: center;
gap: 8px;
background: rgba(0, 245, 155, 0.08);
border: 1px solid rgba(0, 245, 155, 0.25);
color: var(--accent-emerald);
padding: 5px 13px;
border-radius: 100px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.8px;
text-transform: uppercase;
margin-bottom: 12px;
}
.darc-hero-title {
font-size: 34px !important;
font-weight: 800 !important;
letter-spacing: -1.1px;
margin: 0 0 8px 0 !important;
background: linear-gradient(135deg, #ffffff 30%, #a7b5cc 75%, var(--accent-emerald) 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
.darc-hero-sub {
font-size: 15px;
color: var(--text-muted);
line-height: 1.6;
max-width: 860px;
margin: 0 0 18px 0;
}
.darc-stats-strip {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 14px;
}
.darc-stat-item {
background: rgba(255, 255, 255, 0.025);
border: 1px solid rgba(255, 255, 255, 0.06);
padding: 7px 13px;
border-radius: 9px;
font-size: 12px;
color: #cbd5e1;
display: flex;
align-items: center;
gap: 6px;
font-weight: 500;
}
.darc-stat-item span.indicator {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent-emerald);
box-shadow: 0 0 8px var(--accent-emerald);
}
/* Glassmorphic Panels */
.gr-panel, .gr-box, .gr-card, .gr-form {
background: var(--bg-glass) !important;
border: 1px solid var(--border-glass) !important;
border-radius: 16px !important;
backdrop-filter: blur(20px) !important;
box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4) !important;
}
.gr-input, .gr-textarea, .gr-dropdown, .gr-select {
background: rgba(7, 10, 15, 0.85) !important;
border: 1px solid rgba(255, 255, 255, 0.09) !important;
border-radius: 10px !important;
color: #ffffff !important;
font-family: inherit !important;
transition: all 0.2s ease;
}
.gr-input:focus, .gr-dropdown:focus-within {
border-color: var(--accent-emerald) !important;
box-shadow: 0 0 0 2px rgba(0, 245, 155, 0.15) !important;
}
/* Tabs */
.gr-tab-nav {
border-bottom: 1px solid var(--border-glass) !important;
gap: 6px !important;
}
.gr-tab-nav button {
border-radius: 10px 10px 0 0 !important;
font-weight: 600 !important;
font-size: 13px !important;
color: var(--text-muted) !important;
padding: 10px 18px !important;
border: none !important;
transition: all 0.2s ease !important;
}
.gr-tab-nav button.selected {
color: #ffffff !important;
background: rgba(0, 245, 155, 0.08) !important;
border-bottom: 2px solid var(--accent-emerald) !important;
}
/* Action Button */
.darc-generate-btn {
background: linear-gradient(135deg, #00f59b 0%, #00d2ff 50%, #8b5cf6 100%) !important;
background-size: 200% 200% !important;
color: #06080d !important;
font-size: 16px !important;
font-weight: 800 !important;
letter-spacing: 0.5px !important;
border-radius: 12px !important;
padding: 16px 26px !important;
border: none !important;
box-shadow: 0 12px 28px -8px rgba(0, 245, 155, 0.45) !important;
cursor: pointer !important;
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
text-transform: uppercase !important;
}
.darc-generate-btn:hover {
transform: translateY(-2px) !important;
box-shadow: 0 16px 32px -6px rgba(0, 245, 155, 0.65) !important;
}
/* Video Card Preview */
.darc-preview-container {
background: rgba(8, 11, 16, 0.95);
border: 1px solid var(--border-glass);
border-radius: 14px;
padding: 16px;
display: flex;
flex-direction: column;
align-items: center;
}
.darc-model-badge {
display: inline-flex;
align-items: center;
gap: 6px;
background: rgba(139, 92, 246, 0.12);
border: 1px solid rgba(139, 92, 246, 0.3);
color: #c4b5fd;
padding: 4px 10px;
border-radius: 6px;
font-size: 11px;
font-family: 'JetBrains Mono', monospace;
font-weight: 600;
}
"""
def get_hero_html() -> str:
providers = available_providers()
active_count = sum(1 for v in providers.values() if v)
return f"""
<div class="darc-hero-wrapper">
<div class="darc-badge-pill">
<span style="font-size: 14px;">⚡</span> Darc Studio Enterprise 3.0 • Flagship Video & Movie Engine
</div>
<h1 class="darc-hero-title">High-Fidelity AI Movies, Viral Social Scenes & Ad Studio</h1>
<p class="darc-hero-sub">
Generate cinematic micro-dramas, viral POV thrillers, and direct-response video ads with Hollywood-grade camera physics, multi-speaker voice synthesis, and word-level karaoke subtitles.
</p>
<div class="darc-stats-strip">
<div class="darc-stat-item"><span class="indicator"></span> Active Engines: {active_count}/10 Connected</div>
<div class="darc-stat-item"><span class="indicator"></span> Video Models: Seedance 2.5 • Kling 2.0 • Wan 2.2 • Minimax • Luma Ray 2</div>
<div class="darc-stat-item"><span class="indicator"></span> Native Formats: 9:16 Vertical • 16:9 Cinema • 1:1 Square • 21:9 Ultra</div>
<div class="darc-stat-item"><span class="indicator"></span> Subtitles: Whisper Neural Sync (0.0s Drift)</div>
</div>
</div>
"""
def generate_movie_ui(
premise: str,
framework: str,
style: str,
video_model: str,
aspect_ratio: str,
voice: str,
tts_engine: str,
runtime: float,
captions: str,
allow_gen: bool,
progress=gr.Progress(),
) -> Tuple[Optional[str], str, str]:
"""Handles cinematic movie and viral scene generation from the UI."""
if not premise or not premise.strip():
return None, "Error: Story premise or scene concept cannot be empty.", "{}"
output_dir = "output"
os.makedirs(output_dir, exist_ok=True)
out_file = os.path.join(output_dir, "cinematic_scene.mp4")
try:
def p_callback(frac, msg):
progress(frac, desc=msg)
result = run_movie_pipeline(
premise=premise.strip(),
output_path=out_file,
framework=framework,
style=style,
video_model=video_model,
platform=aspect_ratio,
voice=voice,
tts_engine=tts_engine,
target_seconds=runtime,
captions=captions,
allow_generation=allow_gen,
progress=p_callback,
)
timeline_data = result.timeline.model_dump()
manifest_str = json.dumps(timeline_data, indent=2)
summary = (
f"🎬 Scene Render Complete\n"
f"• Title: {result.timeline.title or premise[:40]}\n"
f"• Duration: {result.duration:.1f}s\n"
f"• Engine: {video_model}\n"
f"• Style: {style}\n"
f"• Scenes: {len(result.timeline.scenes)} beats\n"
f"• Path: {result.final_video_path}"
)
return result.final_video_path, summary, manifest_str
except Exception as exc:
err = f"Render failed: {exc}\n{traceback.format_exc()}"
return None, err, "{}"
def generate_ad_ui(
url: str,
framework: str,
video_model: str,
platform: str,
voice: str,
tts_engine: str,
runtime: float,
variants: int,
use_avatar: bool,
actor: str,
captions: str,
brand_name: str,
cta_text: str,
accent_color: str,
allow_gen: bool,
progress=gr.Progress(),
) -> Tuple[Optional[str], str, str]:
"""Handles direct-response commerce ad generation from product URL."""
if not url or not url.strip():
return None, "Error: Product URL cannot be empty.", "{}"
output_dir = "output"
os.makedirs(output_dir, exist_ok=True)
out_file = os.path.join(output_dir, "product_ad.mp4")
brand = BrandKit(
name=brand_name if brand_name else None,
cta_text=cta_text if cta_text else "Shop now",
accent_color=accent_color if accent_color else "#00E5A0",
)
try:
def p_callback(frac, msg):
progress(frac, desc=msg)
results = run_darcads_pipeline(
product_url=url.strip(),
output_path=out_file,
framework=framework,
video_model=video_model,
platform=platform,
voice=voice,
tts_engine=tts_engine,
target_seconds=runtime,
variants=variants,
brand=brand,
use_avatar=use_avatar,
actor=actor if use_avatar else None,
captions=captions,
allow_generation=allow_gen,
progress=p_callback,
)
if not results:
return None, "Pipeline finished without producing results.", "{}"
first = results[0]
manifest_str = json.dumps(first.timeline.model_dump(), indent=2)
summary = (
f"⚡ Video Ad Render Complete\n"
f"• Product: {first.product.title}\n"
f"• Variants: {len(results)}\n"
f"• Primary Duration: {first.duration:.1f}s\n"
f"• Video Model: {video_model}\n"
f"• Path: {first.final_video_path}"
)
return first.final_video_path, summary, manifest_str
except Exception as exc:
err = f"Ad generation failed: {exc}\n{traceback.format_exc()}"
return None, err, "{}"
def build_studio_app() -> gr.Blocks:
actors = list_actors()
actor_choices = list(actors.keys()) if actors else ["emma_creator", "marcus_tech", "sophia_fashion", "david_founder"]
with gr.Blocks(title="Darc Studio Enterprise", css=PREMIUM_CSS, theme=gr.themes.Base()) as demo:
gr.HTML(get_hero_html())
with gr.Tabs():
# -------------------------------------------------------------
# TAB 1: Quick Movies & Viral Cinema Studio
# -------------------------------------------------------------
with gr.TabItem("🎬 Quick Movies & Viral Cinema"):
with gr.Row():
with gr.Column(scale=6):
gr.Markdown("### 1. Scene Concept & Creative Direction")
movie_premise = gr.Textbox(
label="Story Premise / Scene Concept",
placeholder="e.g. A solo astronaut discovers an ancient temple buried under the ice of Europa...",
value="An ancient ornate doorway in a modern penthouse begins to whisper in a forgotten language at midnight.",
lines=3,
)
with gr.Row():
movie_framework = gr.Dropdown(
label="Narrative Framework",
choices=[
("Viral Micro-Drama (Plot Twist)", "viral_plot_twist"),
("POV Immersion & Suspense", "pov_suspense"),
("Cinematic Movie Trailer", "cinematic_trailer"),
("Viral Confession & Mystery", "reddit_story"),
("Viral Satire & Comedy", "comedy_skit"),
],
value="viral_plot_twist",
)
movie_style = gr.Dropdown(
label="Cinematic Visual Style",
choices=[
("Hyper-Realistic 8K Cinema", "hyper_realistic"),
("Hollywood Blockbuster (35mm Anamorphic)", "cinematic_hollywood"),
("Dark Fantasy & Atmospheric Haze", "dark_fantasy"),
("Cyberpunk Neon Noir", "cyberpunk"),
("Anime Cinema (Makoto Shinkai)", "anime_cinematic"),
("Retro 1970s 35mm Film", "retro_35mm_film"),
("3D Pixar Animation", "3d_pixar"),
("Film Noir (Chiaroscuro)", "analog_noir"),
("Handheld Documentary Realism", "documentary"),
],
value="hyper_realistic",
)
with gr.Row():
movie_video_model = gr.Dropdown(
label="AI Video Generation Model",
choices=VIDEO_MODEL_CHOICES,
value="seedance-2.0",
)
movie_aspect = gr.Dropdown(
label="Aspect Ratio / Platform",
choices=[
("9:16 Vertical (TikTok / Reels / Shorts)", "9:16"),
("16:9 Cinema (YouTube / 4K Film)", "16:9"),
("1:1 Square (Social Feed)", "1:1"),
("21:9 Ultra-Wide (Cinemascope)", "21:9"),
],
value="9:16",
)
with gr.Row():
movie_voice = gr.Dropdown(
label="Voice Actor & Delivery",
choices=[
("Female Energetic (High Pace)", "female_energetic"),
("Male Authoritative (Cinema Voice)", "male_authoritative"),
("Female Warm (Narrative)", "female_warm"),
("Male Casual (Conversational)", "male_casual"),
("Whisper Dramatic (Thriller)", "whisper_dramatic"),
],
value="male_authoritative",
)
movie_runtime = gr.Slider(
label="Target Runtime (seconds)",
minimum=10.0,
maximum=60.0,
step=2.0,
value=24.0,
)
with gr.Row():
movie_captions = gr.Dropdown(
label="Dynamic Caption Style",
choices=[
("Word Pop (Viral Retention)", "word_pop"),
("Karaoke Glowing Highlight", "karaoke"),
("Clean Block Subtitles", "block"),
("None (Clean Cinema)", "none"),
],
value="word_pop",
)
movie_allow_gen = gr.Checkbox(
label="Enable Cloud AI Video Generation",
value=True,
info="Calls fal.ai for Seedance/Kling; falls back to local high-res compositor if offline.",
)
movie_submit_btn = gr.Button("🎬 Render Cinematic Scene", variant="primary", elem_classes=["darc-generate-btn"])
with gr.Column(scale=5):
gr.Markdown("### 2. Studio Master Render & Timeline")
movie_video_out = gr.Video(label="Final Cinematic Render", elem_classes=["darc-preview-container"])
movie_summary_out = gr.Textbox(label="Production Log", lines=6)
movie_json_out = gr.Code(label="Scene Storyboard Manifest (JSON)", language="json")
movie_submit_btn.click(
fn=generate_movie_ui,
inputs=[
movie_premise,
movie_framework,
movie_style,
movie_video_model,
movie_aspect,
movie_voice,
gr.State("auto"),
movie_runtime,
movie_captions,
movie_allow_gen,
],
outputs=[movie_video_out, movie_summary_out, movie_json_out],
)
# -------------------------------------------------------------
# TAB 2: Direct-Response Video Ads Studio
# -------------------------------------------------------------
with gr.TabItem("🛍️ E-Commerce & Direct-Response Ads"):
with gr.Row():
with gr.Column(scale=6):
gr.Markdown("### 1. Storefront Ingest & Angle")
ad_url = gr.Textbox(
label="Product URL",
placeholder="https://brand.com/products/example-item",
value="https://allbirds.com/products/mens-tree-runners",
)
with gr.Row():
ad_framework = gr.Dropdown(
label="Conversion Framework",
choices=[
("Problem - Agitate - Solve (PAS)", "pas"),
("UGC Creator Testimonial", "testimonial"),
("Three Reasons Listicle", "three_reasons"),
("Before / After Transformation", "before_after"),
("Us vs Them Positioning", "us_vs_them"),
("Myth Buster Proof", "myth_bust"),
("Curiosity Unboxing Reveal", "unboxing"),
],
value="pas",
)
ad_video_model = gr.Dropdown(
label="Video Synthesis Model",
choices=VIDEO_MODEL_CHOICES,
value="seedance-2.0",
)
with gr.Row():
ad_platform = gr.Dropdown(
label="Platform Preset",
choices=[("TikTok / Reels (9:16)", "tiktok"), ("YouTube Shorts (9:16)", "shorts"), ("Instagram Feed (1:1)", "square"), ("Landscape (16:9)", "landscape")],
value="tiktok",
)
ad_voice = gr.Dropdown(
label="Voiceover Style",
choices=["female_energetic", "male_authoritative", "female_warm", "male_casual"],
value="female_energetic",
)
with gr.Row():
ad_use_avatar = gr.Checkbox(label="Enable UGC Presenter / Actor", value=False)
ad_actor = gr.Dropdown(label="Select UGC Actor", choices=actor_choices, value=actor_choices[0])
with gr.Accordion("Brand Kit & End Card Settings", open=False):
with gr.Row():
ad_brand_name = gr.Textbox(label="Brand Name", placeholder="e.g. Allbirds")
ad_cta = gr.Textbox(label="Call to Action", value="Shop Now • 20% Off")
ad_accent = gr.ColorPicker(label="Accent Color", value="#00E5A0")
with gr.Row():
ad_runtime = gr.Slider(label="Target Runtime (s)", minimum=10.0, maximum=45.0, step=1.0, value=20.0)
ad_variants = gr.Slider(label="A/B Creative Variants", minimum=1, maximum=5, step=1, value=1)
ad_allow_gen = gr.Checkbox(label="Cloud AI Video Generation", value=True)
ad_submit_btn = gr.Button("⚡ Generate High-Converting Ads", variant="primary", elem_classes=["darc-generate-btn"])
with gr.Column(scale=5):
gr.Markdown("### 2. Ad Production Output")
ad_video_out = gr.Video(label="Finished Video Ad", elem_classes=["darc-preview-container"])
ad_summary_out = gr.Textbox(label="Engine Log", lines=6)
ad_json_out = gr.Code(label="Ad Timeline Schema (JSON)", language="json")
ad_submit_btn.click(
fn=generate_ad_ui,
inputs=[
ad_url,
ad_framework,
ad_video_model,
ad_platform,
ad_voice,
gr.State("auto"),
ad_runtime,
ad_variants,
ad_use_avatar,
ad_actor,
gr.State("karaoke"),
ad_brand_name,
ad_cta,
ad_accent,
ad_allow_gen,
],
outputs=[ad_video_out, ad_summary_out, ad_json_out],
)
# -------------------------------------------------------------
# TAB 3: Model Benchmark Lab & Prompt Enhancer
# -------------------------------------------------------------
with gr.TabItem("🎨 AI Model Roster & Prompt Lab"):
gr.Markdown(
"### Supported Next-Gen Video Models\n"
"Darc Studio natively routes requests across top-tier video synthesis providers:\n\n"
"| Model | Provider / Engine | Best For | Camera Control |\n"
"| :--- | :--- | :--- | :--- |\n"
"| **ByteDance Seedance 2.5** | fal.ai (`seedance-2.5`) | Ultra-realistic 30s coherent motion & physics | Director-level Orbit/Dolly |\n"
"| **ByteDance Seedance 2.0** | fal.ai (`seedance-2.0`) | Cinematic lighting & multi-modal consistency | Dynamic FPV & Tracking |\n"
"| **Kling 2.0 Pro** | fal.ai (`kling-2.0`) | Photorealistic human figures & high-framerate action | Pan & Push Controls |\n"
"| **Wan 2.2 / 2.1** | fal.ai (`wan-2.2`) | Fast high-fidelity visual generation | Smooth Ken Burns & Orbit |\n"
"| **Minimax Hailuo-02** | fal.ai (`minimax-hailuo-02`) | Emotional character micro-expressions | Close-up & Dutch Angle |\n"
"| **Luma Ray 2** | fal.ai (`luma-ray-2`) | Smooth cinematic lighting & atmosphere | Sweeping Crane Shots |\n"
"| **Runway Gen-3 Alpha** | fal.ai (`runway-gen3`) | Blockbuster cinematic VFX & motion dynamics | Full Camera Rig |\n"
"| **Google Veo 2 / Sora** | fal.ai (`google-veo2`) | Next-gen spatial understanding & 4K fidelity | Multi-axis Movement |\n"
)
# -------------------------------------------------------------
# TAB 4: Engine Status & Telemetry
# -------------------------------------------------------------
with gr.TabItem("⚙️ Neural Engine Status"):
providers = available_providers()
status_md = "### Connected AI Providers\n\n"
for p_name, is_active in providers.items():
badge = "✅ **Online**" if is_active else "⚪ **Offline (Graceful Fallback)**"
status_md += f"- **{p_name.upper()}**: {badge}\n"
ffmpeg_ok = ffmpeg_available()
status_md += f"\n- **FFMPEG Core Compositor**: {'✅ Online' if ffmpeg_ok else '❌ Missing'}\n"
gr.Markdown(status_md)
return demo
if __name__ == "__main__":
demo = build_studio_app()
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)