LipKit commited on
Commit
dace5fb
Β·
1 Parent(s): bcc25d7

Deploy LipKit v1.0 - Free AI Lip Sync Studio

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-314.pyc +0 -0
  2. app.py +176 -93
__pycache__/app.cpython-314.pyc CHANGED
Binary files a/__pycache__/app.cpython-314.pyc and b/__pycache__/app.cpython-314.pyc differ
 
app.py CHANGED
@@ -320,139 +320,207 @@ LANG_MAP = {f"{v['flag']} {k}": k for k, v in LANGUAGES.items()}
320
  CSS = """
321
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
322
  * { font-family: 'Inter', system-ui, sans-serif; }
323
- body { background: #08080e !important; background-image: radial-gradient(ellipse at 20% 50%, rgba(168,85,247,0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 50%, rgba(6,182,212,0.04) 0%, transparent 50%) !important; min-height: 100vh; }
324
- .gradio-container { max-width: 1200px !important; margin: auto; background: transparent !important; padding: 20px 0 !important; }
325
  footer { display: none !important; }
326
 
327
- /* ── Hero ── */
328
- .app-hero { text-align: center; padding: 40px 20px 30px; position: relative; }
329
- .app-hero h1 { font-size: 3.2em !important; font-weight: 900 !important; letter-spacing: -0.03em !important; line-height: 1.1 !important; margin: 0 0 8px !important; background: linear-gradient(135deg, #a855f7 0%, #06b6d4 50%, #a855f7 100%) !important; -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important; background-clip: text !important; background-size: 200% auto !important; animation: shimmer 4s ease infinite !important; }
330
- @keyframes shimmer { 0%{background-position:0% center} 50%{background-position:100% center} 100%{background-position:0% center} }
331
- .app-hero p { font-size: 1.1em; color: #71717a; margin: 0; font-weight: 400; }
332
- .app-hero .hero-badges { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
333
- .hero-badge { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; background: rgba(168,85,247,0.1); color: #a855f7; border: 1px solid rgba(168,85,247,0.2); letter-spacing: 0.02em; }
334
-
335
- /* ── Main cards ── */
336
- .gr-box, .gr-form, .panel, .card, .gr-panel { border-radius: 16px !important; border: 1px solid rgba(255,255,255,0.06) !important; background: rgba(16,16,24,0.9) !important; box-shadow: 0 8px 40px rgba(0,0,0,0.5) !important; backdrop-filter: blur(20px) !important; padding: 20px !important; }
337
- .gr-box:hover { border-color: rgba(255,255,255,0.1) !important; }
338
-
339
- /* ── Inputs ── */
340
- input, textarea, select, .gr-input { background: rgba(22,22,34,0.95) !important; border: 1.5px solid rgba(255,255,255,0.06) !important; border-radius: 12px !important; color: #f1f1f5 !important; font-size: 14px !important; padding: 12px 16px !important; transition: all 0.25s ease !important; }
341
- input:focus, textarea:focus { border-color: #a855f7 !important; box-shadow: 0 0 0 4px rgba(168,85,247,0.12) !important; outline: none !important; }
342
- label, .gr-label { font-weight: 600 !important; font-size: 12px !important; text-transform: uppercase !important; letter-spacing: 0.08em !important; color: #a1a1aa !important; margin-bottom: 8px !important; }
343
-
344
- /* ── Buttons ── */
345
- .gr-button-primary, button.gr-button.lg.primary { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important; border: none !important; border-radius: 12px !important; color: #fff !important; font-weight: 700 !important; font-size: 16px !important; padding: 14px 28px !important; box-shadow: 0 4px 24px rgba(168,85,247,0.3) !important; transition: all 0.25s ease !important; position: relative !important; overflow: hidden !important; }
346
- .gr-button-primary:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 40px rgba(168,85,247,0.45) !important; }
347
- .gr-button-primary:active { transform: translateY(0) !important; }
348
- .gr-button-primary::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(transparent, rgba(255,255,255,0.05), transparent); transform: rotate(45deg) translateX(-100%); transition: 0.5s; }
349
- .gr-button-primary:hover::after { transform: rotate(45deg) translateX(100%); }
350
-
351
- /* Secondary */
352
- button.gr-button:not(.primary):not(.lg) { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.06) !important; border-radius: 10px !important; color: #a1a1aa !important; font-weight: 500 !important; padding: 10px 18px !important; transition: all 0.2s ease !important; }
353
- button.gr-button:not(.primary):not(.lg):hover { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.12) !important; color: #f1f1f5 !important; }
354
-
355
- /* ── Tabs ── */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  .tabs { border: none !important; background: transparent !important; }
357
- .tab-nav { gap: 4px !important; background: rgba(16,16,24,0.6) !important; border-radius: 14px !important; padding: 4px !important; border: 1px solid rgba(255,255,255,0.06) !important; display: flex !important; }
358
- button.tab-nav { background: transparent !important; border-radius: 10px !important; padding: 12px 22px !important; font-weight: 600 !important; font-size: 14px !important; color: #71717a !important; transition: all 0.2s ease !important; border: none !important; flex: 1 !important; justify-content: center !important; }
359
- button.tab-nav:hover { color: #f1f1f5 !important; background: rgba(255,255,255,0.03) !important; }
360
- button.tab-nav.selected { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(6,182,212,0.1)) !important; color: #fff !important; box-shadow: 0 0 30px rgba(168,85,247,0.08) !important; }
361
-
362
- /* ── History gallery ── */
363
- .history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
364
-
365
- /* ── Markdown ── */
366
- .gr-markdown { color: #d4d4d8 !important; line-height: 1.7 !important; }
367
- .gr-markdown h3 { font-size: 1.1em !important; font-weight: 700 !important; color: #f1f1f5 !important; margin-bottom: 6px !important; }
368
- .gr-markdown p { color: #a1a1aa !important; }
369
-
370
- /* ── Misc ── */
 
 
 
371
  .gr-checkbox { accent-color: #a855f7 !important; }
372
- .gr-progress { background: rgba(255,255,255,0.05) !important; border-radius: 8px !important; height: 8px !important; }
373
- .gr-progress > div { background: linear-gradient(90deg, #a855f7, #06b6d4) !important; border-radius: 8px !important; }
374
- .gr-box img, .gr-box video { border-radius: 12px !important; }
375
- ::-webkit-scrollbar { width: 6px; }
376
- ::-webkit-scrollbar-track { background: #08080e; }
377
- ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
378
- ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
379
- select { cursor: pointer !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; padding-right: 36px !important; appearance: none !important; }
 
380
  """
381
 
382
  # ── Gradio UI ──────────────────────────────────────────────────────────────────
383
- HERO = f"""
384
- <div class="app-hero">
385
- <h1>VoiceKit Studio</h1>
386
- <p>AI Lip Sync &bull; Multi-Language TTS &bull; IVM Dress-on-Model</p>
387
- <div class="hero-badges">
388
- <span class="hero-badge">πŸŽ™οΈ V2 AI Avatar</span>
389
- <span class="hero-badge">🧠 IVM</span>
390
- <span class="hero-badge">🌍 {len(LANGUAGES)} Languages</span>
391
- <span class="hero-badge">{'βœ… Models Ready' if SETUP_OK else '⚠️ Setup Needed'}</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  </div>
393
  </div>
 
394
  """
395
 
396
- STATUS_MSG = "Models ready. All systems operational." if SETUP_OK else f"Setup error: {SETUP_ERR}"
397
-
398
  with gr.Blocks(title="VoiceKit Studio", css=CSS, theme=gr.themes.Soft(primary_hue="purple", secondary_hue="cyan", neutral_hue="slate")) as demo:
399
- gr.HTML(HERO)
400
 
401
  with gr.Tabs(selected=0):
402
  # ═══════════════ V2 AI AVATAR TAB ═══════════════
403
- with gr.TabItem("πŸŽ™οΈ V2 AI Avatar"):
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  with gr.Row(equal_height=False):
405
  with gr.Column(scale=3):
406
- gr.Markdown("### Step 1 β€” Upload Your Face Video")
 
407
  video_input = gr.Video(label="Face Video (MP4/MKV)", sources=["upload"])
 
408
 
409
- gr.Markdown("### Step 2 β€” Voice & Language")
 
410
  with gr.Row():
411
  voice_input = gr.Audio(label="Voice Sample (optional)", sources=["upload"], type="filepath")
412
  with gr.Row():
413
  lang_dropdown = gr.Dropdown(choices=LANG_CHOICES, value="πŸ‡ΊπŸ‡Έ English (US)", label="🌍 Language", interactive=True)
414
  use_clone = gr.Checkbox(label="Clone my voice", value=True)
 
415
 
416
- gr.Markdown("### Step 3 β€” Type Your Script")
 
417
  script_input = gr.Textbox(
418
  label="Script",
419
  placeholder="Hey, I've been keeping an eye on your content and honestly β€” the engagement you're getting is impressive...",
420
- lines=5, max_lines=15,
421
  )
422
-
423
  generate_btn = gr.Button("🎬 Generate Lip-Synced Video", variant="primary", size="lg")
 
424
 
 
425
  with gr.Column(scale=2):
426
- gr.Markdown("### Output")
427
  video_output = gr.Video(label="Your Lip-Synced Video")
428
  status_text = gr.Textbox(label="Status", interactive=False)
429
- gr.Markdown(f"**System:** {STATUS_MSG}")
430
 
431
- # Store selected language as plain text state
432
  lang_state = gr.State("English (US)")
433
  lang_dropdown.change(
434
  lambda v: LANG_MAP.get(v, "English (US)") if v else "English (US)",
435
  inputs=lang_dropdown, outputs=lang_state
436
  )
437
-
438
  generate_btn.click(fn=lipkit_generate,
439
  inputs=[video_input, voice_input, script_input, use_clone, lang_state],
440
  outputs=[video_output, status_text])
441
 
442
- gr.Markdown("### πŸ’‘ Script Examples")
443
  gr.Examples(examples=[
444
  [None, None, "Hey, I've been watching your content β€” the engagement is impressive. I built an AI tool that could turn one video into 50 personalized ones."],
445
  [None, None, "What's up! I help founders turn one video into a hundred personalized clips using AI. No editing needed."],
446
  ], inputs=[video_input, voice_input, script_input], label="Click to try")
447
-
448
- # ── V2 History ──
449
- gr.Markdown("### πŸ“ Previously Generated Videos")
450
- v2_history_html = gr.HTML(value=refresh_v2_history())
451
- gr.Button("πŸ”„ Refresh History", size="sm").click(fn=refresh_v2_history, outputs=v2_history_html)
452
 
453
  # ═══════════════ IVM TAB ═══════════════
454
- with gr.TabItem("🧠 IVM β€” Image + Video + Model"):
455
- gr.Markdown("### Upload Images")
 
 
 
 
 
 
 
 
 
456
  with gr.Row():
457
  with gr.Column():
458
  ivm_dress = gr.Image(label="πŸ‘— Dress Photo *", type="filepath", sources=["upload"])
@@ -460,29 +528,44 @@ with gr.Blocks(title="VoiceKit Studio", css=CSS, theme=gr.themes.Soft(primary_hu
460
  ivm_model = gr.Image(label="πŸ§‘ Model Photo (optional)", type="filepath", sources=["upload"])
461
 
462
  with gr.Row():
463
- ivm_blur = gr.Checkbox(label="πŸ”΅ Blur face in output", value=True)
464
- ivm_video = gr.Checkbox(label="🎬 Generate looping video (+2 min)", value=False)
 
465
 
466
  ivm_btn = gr.Button("🧠 Generate IVM", variant="primary", size="lg")
467
 
 
468
  with gr.Row():
469
- ivm_img_out = gr.Image(label="Result β€” Dress on Model", type="filepath")
470
  ivm_vid_out = gr.Video(label="Looping Video")
 
471
 
472
  ivm_btn.click(fn=ivm_generate, inputs=[ivm_dress, ivm_model, ivm_blur, ivm_video],
473
  outputs=[ivm_img_out, ivm_vid_out])
474
 
475
- gr.Markdown("""
476
- ### How It Works
477
- **1.** Upload a dress photo β†’ **2.** Add model (optional) β†’ **3.** AI fits the dress β†’ **4.** Face blurred β†’ **5.** Optional looping video
478
-
479
- > *"You spend Rs. 200k-500k per photoshoot. IVM generates your catalog on AI models β€” no model fees, no studio, no face needed."*
 
 
 
 
480
  """)
481
 
482
- # ── IVM History ──
483
- gr.Markdown("### πŸ“ Previously Generated Images")
 
 
 
 
484
  ivm_history_html = gr.HTML(value=refresh_ivm_history())
485
  gr.Button("πŸ”„ Refresh IVM History", size="sm").click(fn=refresh_ivm_history, outputs=ivm_history_html)
 
 
 
 
486
 
487
 
488
  if __name__ == "__main__":
 
320
  CSS = """
321
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
322
  * { font-family: 'Inter', system-ui, sans-serif; }
323
+ body { background: #0a0a10 !important; min-height: 100vh; margin: 0 !important; }
324
+ .gradio-container { max-width: 1400px !important; margin: 0 auto !important; background: transparent !important; padding: 0 !important; min-height: 100vh; }
325
  footer { display: none !important; }
326
 
327
+ /* ===== APP LAYOUT ===== */
328
+ .app-wrapper { display: flex; min-height: 100vh; }
329
+ .app-sidebar { width: 240px; min-width: 240px; background: rgba(12,12,20,0.95); border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
330
+ .app-main { flex: 1; margin-left: 240px; padding: 32px; max-width: 1100px; }
331
+
332
+ /* Sidebar */
333
+ .sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
334
+ .sidebar-logo h1 { font-size: 20px; font-weight: 800; margin: 0; background: linear-gradient(135deg, #a855f7, #06b6d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.02em; }
335
+ .sidebar-logo p { font-size: 11px; color: #52525b; margin: 4px 0 0; font-weight: 500; }
336
+ .sidebar-nav { padding: 16px 12px; flex: 1; }
337
+ .sidebar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #52525b; padding: 8px 12px 6px; }
338
+ .sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; color: #a1a1aa; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; margin-bottom: 2px; border: none; background: transparent; width: 100%; text-align: left; }
339
+ .sidebar-item:hover { background: rgba(255,255,255,0.04); color: #e4e4e7; }
340
+ .sidebar-item.active { background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(6,182,212,0.06)); color: #a855f7; font-weight: 600; }
341
+ .sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; }
342
+ .sidebar-item .badge { margin-left: auto; font-size: 9px; padding: 2px 6px; border-radius: 4px; background: rgba(168,85,247,0.15); color: #a855f7; font-weight: 700; }
343
+ .sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.06); }
344
+ .sidebar-status { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; font-size: 11px; font-weight: 500; }
345
+ .sidebar-status.online { color: #22c55e; background: rgba(34,197,94,0.06); }
346
+ .sidebar-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
347
+
348
+ /* Top Bar */
349
+ .app-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
350
+ .topbar-left h2 { font-size: 22px; font-weight: 800; margin: 0; color: #f4f4f5; letter-spacing: -0.02em; }
351
+ .topbar-left p { font-size: 13px; color: #71717a; margin: 4px 0 0; }
352
+ .topbar-right { display: flex; gap: 10px; align-items: center; }
353
+
354
+ /* Main Cards */
355
+ .gr-box, .gr-form, .panel, .card, .gr-panel { border-radius: 14px !important; border: 1px solid rgba(255,255,255,0.06) !important; background: rgba(16,16,24,0.85) !important; box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important; backdrop-filter: blur(16px) !important; padding: 20px !important; }
356
+
357
+ /* Section Cards */
358
+ .section-card { background: rgba(16,16,24,0.7); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
359
+ .section-card h3 { font-size: 13px; font-weight: 700; color: #a1a1aa; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
360
+ .section-card h3 .step { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; font-size: 11px; align-items: center; justify-content: center; }
361
+
362
+ /* Inputs */
363
+ input, textarea, select, .gr-input { background: rgba(22,22,34,0.9) !important; border: 1.5px solid rgba(255,255,255,0.06) !important; border-radius: 10px !important; color: #f4f4f5 !important; font-size: 14px !important; padding: 11px 15px !important; transition: all 0.2s ease !important; }
364
+ input:focus, textarea:focus { border-color: #a855f7 !important; box-shadow: 0 0 0 3px rgba(168,85,247,0.1) !important; outline: none !important; }
365
+ label, .gr-label { font-weight: 600 !important; font-size: 11px !important; text-transform: uppercase !important; letter-spacing: 0.08em !important; color: #71717a !important; margin-bottom: 6px !important; }
366
+
367
+ /* Buttons */
368
+ .gr-button-primary, button.gr-button.lg.primary { background: linear-gradient(135deg, #a855f7, #7c3aed) !important; border: none !important; border-radius: 10px !important; color: #fff !important; font-weight: 700 !important; font-size: 15px !important; padding: 12px 24px !important; box-shadow: 0 4px 20px rgba(168,85,247,0.25) !important; transition: all 0.2s ease !important; cursor: pointer !important; }
369
+ .gr-button-primary:hover { transform: translateY(-1px) !important; box-shadow: 0 6px 28px rgba(168,85,247,0.35) !important; }
370
+ button.gr-button:not(.primary):not(.lg) { background: rgba(255,255,255,0.03) !important; border: 1px solid rgba(255,255,255,0.06) !important; border-radius: 8px !important; color: #a1a1aa !important; font-weight: 500 !important; font-size: 13px !important; padding: 8px 16px !important; transition: all 0.15s ease !important; }
371
+ button.gr-button:not(.primary):not(.lg):hover { background: rgba(255,255,255,0.06) !important; color: #f4f4f5 !important; }
372
+
373
+ /* Tabs inside content */
374
  .tabs { border: none !important; background: transparent !important; }
375
+ .tab-nav { gap: 4px !important; background: rgba(16,16,24,0.5) !important; border-radius: 10px !important; padding: 3px !important; border: 1px solid rgba(255,255,255,0.05) !important; display: flex !important; }
376
+ button.tab-nav { background: transparent !important; border-radius: 8px !important; padding: 8px 16px !important; font-weight: 600 !important; font-size: 13px !important; color: #71717a !important; transition: all 0.15s ease !important; border: none !important; flex: 1 !important; justify-content: center !important; }
377
+ button.tab-nav:hover { color: #f4f4f5 !important; background: rgba(255,255,255,0.03) !important; }
378
+ button.tab-nav.selected { background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(6,182,212,0.06)) !important; color: #a855f7 !important; }
379
+
380
+ /* Dropdown */
381
+ select { cursor: pointer !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2371717a' d='M5 7L1 3h8z'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; padding-right: 32px !important; appearance: none !important; }
382
+
383
+ /* Gallery Grid */
384
+ .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
385
+ .gallery-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; transition: all 0.2s; }
386
+ .gallery-card:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }
387
+ .gallery-card img, .gallery-card video { width: 100%; height: 170px; object-fit: cover; display: block; }
388
+ .gallery-card-body { padding: 12px; }
389
+ .gallery-card-footer { display: flex; justify-content: space-between; align-items: center; }
390
+
391
+ /* Misc */
392
  .gr-checkbox { accent-color: #a855f7 !important; }
393
+ .gr-progress { background: rgba(255,255,255,0.04) !important; border-radius: 6px !important; height: 6px !important; }
394
+ .gr-progress > div { background: linear-gradient(90deg, #a855f7, #06b6d4) !important; border-radius: 6px !important; }
395
+ .gr-box img, .gr-box video { border-radius: 10px !important; }
396
+ .gr-markdown { color: #d4d4d8 !important; line-height: 1.6 !important; }
397
+ .gr-markdown h3 { font-size: 13px !important; font-weight: 700 !important; color: #e4e4e7 !important; text-transform: uppercase !important; letter-spacing: 0.06em !important; }
398
+ .gr-markdown p { color: #a1a1aa !important; }
399
+ ::-webkit-scrollbar { width: 5px; }
400
+ ::-webkit-scrollbar-track { background: #0a0a10; }
401
+ ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }
402
  """
403
 
404
  # ── Gradio UI ──────────────────────────────────────────────────────────────────
405
+ STATUS_MSG = "Models ready. All systems operational." if SETUP_OK else f"Setup error: {SETUP_ERR}"
406
+
407
+ SIDEBAR = f"""
408
+ <div class="app-wrapper">
409
+ <div class="app-sidebar">
410
+ <div class="sidebar-logo">
411
+ <h1>VoiceKit</h1>
412
+ <p>AI Studio</p>
413
+ </div>
414
+ <div class="sidebar-nav">
415
+ <div class="sidebar-label">Tools</div>
416
+ <button class="sidebar-item active" onclick="document.querySelectorAll('.tab-nav')[0]?.click()">
417
+ <span class="icon">πŸŽ™οΈ</span> V2 AI Avatar
418
+ </button>
419
+ <button class="sidebar-item" onclick="document.querySelectorAll('.tab-nav')[1]?.click()">
420
+ <span class="icon">🧠</span> IVM Studio
421
+ </button>
422
+ <div style="margin-top:20px">
423
+ <div class="sidebar-label">History</div>
424
+ <button class="sidebar-item" onclick="document.querySelectorAll('.tab-nav')[2]?.click()">
425
+ <span class="icon">πŸ“</span> Past Generations
426
+ <span class="badge">V2+IVM</span>
427
+ </button>
428
+ </div>
429
+ </div>
430
+ <div class="sidebar-footer">
431
+ <div class="sidebar-status online">
432
+ <span class="dot"></span>
433
+ {'All Systems Operational' if SETUP_OK else 'Setup Error'}
434
+ </div>
435
+ <div style="font-size:10px;color:#52525b;padding:8px 14px 0;margin-top:4px">
436
+ {len(LANGUAGES)} languages Β· Microsoft Neural TTS
437
+ </div>
438
  </div>
439
  </div>
440
+ <div class="app-main">
441
  """
442
 
 
 
443
  with gr.Blocks(title="VoiceKit Studio", css=CSS, theme=gr.themes.Soft(primary_hue="purple", secondary_hue="cyan", neutral_hue="slate")) as demo:
444
+ gr.HTML(SIDEBAR)
445
 
446
  with gr.Tabs(selected=0):
447
  # ═══════════════ V2 AI AVATAR TAB ═══════════════
448
+ with gr.TabItem("πŸŽ™οΈ V2"):
449
+ # Top bar
450
+ gr.HTML(f"""
451
+ <div class="app-topbar">
452
+ <div class="topbar-left">
453
+ <h2>V2 AI Avatar</h2>
454
+ <p>Generate lip-synced videos in any language with neural AI voice cloning</p>
455
+ </div>
456
+ <div class="topbar-right">
457
+ <span style="font-size:11px;padding:4px 12px;background:rgba(168,85,247,0.1);border-radius:6px;color:#a855f7;font-weight:600">🌍 {len(LANGUAGES)} Languages</span>
458
+ </div>
459
+ </div>
460
+ """)
461
+
462
  with gr.Row(equal_height=False):
463
  with gr.Column(scale=3):
464
+ # Step 1
465
+ gr.HTML("""<div class="section-card"><h3><span class="step">1</span> Upload Face Video</h3>""")
466
  video_input = gr.Video(label="Face Video (MP4/MKV)", sources=["upload"])
467
+ gr.HTML("</div>")
468
 
469
+ # Step 2
470
+ gr.HTML("""<div class="section-card"><h3><span class="step">2</span> Voice & Language</h3>""")
471
  with gr.Row():
472
  voice_input = gr.Audio(label="Voice Sample (optional)", sources=["upload"], type="filepath")
473
  with gr.Row():
474
  lang_dropdown = gr.Dropdown(choices=LANG_CHOICES, value="πŸ‡ΊπŸ‡Έ English (US)", label="🌍 Language", interactive=True)
475
  use_clone = gr.Checkbox(label="Clone my voice", value=True)
476
+ gr.HTML("</div>")
477
 
478
+ # Step 3
479
+ gr.HTML("""<div class="section-card"><h3><span class="step">3</span> Write Your Script</h3>""")
480
  script_input = gr.Textbox(
481
  label="Script",
482
  placeholder="Hey, I've been keeping an eye on your content and honestly β€” the engagement you're getting is impressive...",
483
+ lines=4, max_lines=12,
484
  )
 
485
  generate_btn = gr.Button("🎬 Generate Lip-Synced Video", variant="primary", size="lg")
486
+ gr.HTML("</div>")
487
 
488
+ # Output column
489
  with gr.Column(scale=2):
490
+ gr.HTML("""<div class="section-card"><h3>🎬 Output</h3>""")
491
  video_output = gr.Video(label="Your Lip-Synced Video")
492
  status_text = gr.Textbox(label="Status", interactive=False)
493
+ gr.HTML("</div>")
494
 
495
+ # Language state
496
  lang_state = gr.State("English (US)")
497
  lang_dropdown.change(
498
  lambda v: LANG_MAP.get(v, "English (US)") if v else "English (US)",
499
  inputs=lang_dropdown, outputs=lang_state
500
  )
 
501
  generate_btn.click(fn=lipkit_generate,
502
  inputs=[video_input, voice_input, script_input, use_clone, lang_state],
503
  outputs=[video_output, status_text])
504
 
505
+ gr.HTML("""<div class="section-card"><h3>πŸ’‘ Script Examples</h3>""")
506
  gr.Examples(examples=[
507
  [None, None, "Hey, I've been watching your content β€” the engagement is impressive. I built an AI tool that could turn one video into 50 personalized ones."],
508
  [None, None, "What's up! I help founders turn one video into a hundred personalized clips using AI. No editing needed."],
509
  ], inputs=[video_input, voice_input, script_input], label="Click to try")
510
+ gr.HTML("</div>")
 
 
 
 
511
 
512
  # ═══════════════ IVM TAB ═══════════════
513
+ with gr.TabItem("🧠 IVM"):
514
+ gr.HTML("""
515
+ <div class="app-topbar">
516
+ <div class="topbar-left">
517
+ <h2>IVM Studio</h2>
518
+ <p>Image + Video + Model β€” AI dress-on-model generator</p>
519
+ </div>
520
+ </div>
521
+ """)
522
+
523
+ gr.HTML("""<div class="section-card"><h3><span class="step">1</span> Upload Images</h3>""")
524
  with gr.Row():
525
  with gr.Column():
526
  ivm_dress = gr.Image(label="πŸ‘— Dress Photo *", type="filepath", sources=["upload"])
 
528
  ivm_model = gr.Image(label="πŸ§‘ Model Photo (optional)", type="filepath", sources=["upload"])
529
 
530
  with gr.Row():
531
+ ivm_blur = gr.Checkbox(label="πŸ”΅ Blur face", value=True)
532
+ ivm_video = gr.Checkbox(label="🎬 Looping video", value=False)
533
+ gr.HTML("</div>")
534
 
535
  ivm_btn = gr.Button("🧠 Generate IVM", variant="primary", size="lg")
536
 
537
+ gr.HTML("""<div class="section-card"><h3>🎬 Result</h3>""")
538
  with gr.Row():
539
+ ivm_img_out = gr.Image(label="Dress on Model", type="filepath")
540
  ivm_vid_out = gr.Video(label="Looping Video")
541
+ gr.HTML("</div>")
542
 
543
  ivm_btn.click(fn=ivm_generate, inputs=[ivm_dress, ivm_model, ivm_blur, ivm_video],
544
  outputs=[ivm_img_out, ivm_vid_out])
545
 
546
+ # ═══════════════ HISTORY TAB ═══════════════
547
+ with gr.TabItem("πŸ“ History"):
548
+ gr.HTML("""
549
+ <div class="app-topbar">
550
+ <div class="topbar-left">
551
+ <h2>Past Generations</h2>
552
+ <p>All your previously generated V2 videos and IVM images</p>
553
+ </div>
554
+ </div>
555
  """)
556
 
557
+ gr.HTML("""<div class="section-card"><h3>πŸŽ™οΈ V2 Videos</h3>""")
558
+ v2_history_html = gr.HTML(value=refresh_v2_history())
559
+ gr.Button("πŸ”„ Refresh V2 History", size="sm").click(fn=refresh_v2_history, outputs=v2_history_html)
560
+ gr.HTML("</div>")
561
+
562
+ gr.HTML("""<div class="section-card"><h3>🧠 IVM Images</h3>""")
563
  ivm_history_html = gr.HTML(value=refresh_ivm_history())
564
  gr.Button("πŸ”„ Refresh IVM History", size="sm").click(fn=refresh_ivm_history, outputs=ivm_history_html)
565
+ gr.HTML("</div>")
566
+
567
+ # Close app-main and app-wrapper
568
+ gr.HTML("</div></div>")
569
 
570
 
571
  if __name__ == "__main__":