lulavc commited on
Commit
ca047eb
·
1 Parent(s): a628050

fix: Gradio 6.x compat — remove info= from Image/Audio/Video, show_download_button→buttons

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -357,13 +357,13 @@ def switch_language(lang: str):
357
  # 26 outputs — must match _lang_out list order below
358
  return (
359
  # Phase 1 (16)
360
- gr.update(label=t["portrait_label"], info=t["portrait_info"]),
361
  gr.update(label=t["input_mode_label"], choices=mode_choices, value="text"),
362
  gr.update(label=t["text_label"], placeholder=t["text_ph"]),
363
  gr.update(label=t["tts_lang_label"]),
364
- gr.update(label=t["voice_ref_label"], info=t["voice_ref_info"]),
365
  gr.update(label=t["emotion_label"], info=t["emotion_info"]),
366
- gr.update(label=t["audio_label"], info=t["audio_info"]),
367
  gr.update(label=t["aspect_label"]),
368
  gr.update(label=t["advanced"]),
369
  gr.update(label=t["steps_label"], info=t["steps_info"]),
@@ -374,9 +374,9 @@ def switch_language(lang: str):
374
  gr.update(visible=False), # audio_group
375
  gr.update(label=t["output_label"]),
376
  # Phase 2 (10)
377
- gr.update(label=t["dub_video_label"], info=t["dub_video_info"]),
378
  gr.update(label=t["dub_target_label"]),
379
- gr.update(label=t["dub_voice_label"], info=t["dub_voice_info"]),
380
  gr.update(label=t["dub_emotion_label"]),
381
  gr.update(value=t["dub_btn"]),
382
  gr.update(label=t["dub_output_label"]),
@@ -426,8 +426,7 @@ with gr.Blocks(title="AnimaStudio 🎬") as demo:
426
  with gr.Row(equal_height=False):
427
  with gr.Column(scale=1, min_width=360):
428
  portrait = gr.Image(
429
- label="Portrait Photo",
430
- info="Upload a clear, front-facing face photo",
431
  type="pil",
432
  sources=["upload", "webcam"],
433
  )
@@ -446,16 +445,14 @@ with gr.Blocks(title="AnimaStudio 🎬") as demo:
446
  tts_language = gr.Dropdown(choices=TTS_LANGUAGES, value="English", label="Speech Language")
447
  with gr.Row():
448
  voice_ref = gr.Audio(
449
- label="Voice Reference",
450
- info="Optional: upload audio to clone the voice style",
451
  type="filepath", sources=["upload"],
452
  )
453
  emotion = gr.Slider(0.0, 1.0, value=0.5, step=0.05,
454
  label="Emotion Intensity", info="0 = neutral · 1 = very expressive")
455
  with gr.Group(visible=False) as audio_group:
456
  audio_upload = gr.Audio(
457
- label="Audio File",
458
- info="Upload WAV, MP3, or FLAC · max 30 seconds",
459
  type="filepath", sources=["upload", "microphone"],
460
  )
461
  aspect_ratio = gr.Dropdown(choices=list(ASPECT_PRESETS.keys()),
@@ -471,18 +468,16 @@ with gr.Blocks(title="AnimaStudio 🎬") as demo:
471
 
472
  with gr.Column(scale=1, min_width=440):
473
  output_video = gr.Video(label="Generated Video", format="mp4", autoplay=True,
474
- height=640, elem_id="output-video", show_download_button=True)
475
 
476
  # ══ Tab 2: Dub Video ═══════════════════════════════════════════════════
477
  with gr.Tab("🎙️ Dub Video", id="tab-dub"):
478
  with gr.Row(equal_height=False):
479
  with gr.Column(scale=1, min_width=360):
480
- dub_video_input = gr.Video(label="Input Video",
481
- info="Upload a video to dub (max 60 seconds)",
482
  sources=["upload"])
483
  dub_target_lang = gr.Dropdown(choices=TTS_LANGUAGES, value="English", label="Target Language")
484
- dub_voice_ref = gr.Audio(label="Voice Reference",
485
- info="Optional: upload audio to clone voice style for dubbing",
486
  type="filepath", sources=["upload"])
487
  dub_emotion = gr.Slider(0.0, 1.0, value=0.5, step=0.05, label="Emotion Intensity")
488
  dub_btn = gr.Button("🎙️ Dub Video", variant="primary", elem_id="dub-btn", size="lg")
@@ -497,7 +492,7 @@ with gr.Blocks(title="AnimaStudio 🎬") as demo:
497
 
498
  with gr.Column(scale=1, min_width=440):
499
  dub_output_video = gr.Video(label="Dubbed Video", format="mp4", autoplay=True,
500
- height=480, elem_id="dub-output-video", show_download_button=True)
501
  with gr.Accordion("Details", open=False) as dub_details_acc:
502
  dub_transcript_box = gr.Textbox(label="Detected Transcript", interactive=False, lines=4)
503
  dub_translation_box = gr.Textbox(label="Translation", interactive=False, lines=4)
 
357
  # 26 outputs — must match _lang_out list order below
358
  return (
359
  # Phase 1 (16)
360
+ gr.update(label=t["portrait_label"]),
361
  gr.update(label=t["input_mode_label"], choices=mode_choices, value="text"),
362
  gr.update(label=t["text_label"], placeholder=t["text_ph"]),
363
  gr.update(label=t["tts_lang_label"]),
364
+ gr.update(label=t["voice_ref_label"]),
365
  gr.update(label=t["emotion_label"], info=t["emotion_info"]),
366
+ gr.update(label=t["audio_label"]),
367
  gr.update(label=t["aspect_label"]),
368
  gr.update(label=t["advanced"]),
369
  gr.update(label=t["steps_label"], info=t["steps_info"]),
 
374
  gr.update(visible=False), # audio_group
375
  gr.update(label=t["output_label"]),
376
  # Phase 2 (10)
377
+ gr.update(label=t["dub_video_label"]),
378
  gr.update(label=t["dub_target_label"]),
379
+ gr.update(label=t["dub_voice_label"]),
380
  gr.update(label=t["dub_emotion_label"]),
381
  gr.update(value=t["dub_btn"]),
382
  gr.update(label=t["dub_output_label"]),
 
426
  with gr.Row(equal_height=False):
427
  with gr.Column(scale=1, min_width=360):
428
  portrait = gr.Image(
429
+ label="Portrait Photo · front-facing face",
 
430
  type="pil",
431
  sources=["upload", "webcam"],
432
  )
 
445
  tts_language = gr.Dropdown(choices=TTS_LANGUAGES, value="English", label="Speech Language")
446
  with gr.Row():
447
  voice_ref = gr.Audio(
448
+ label="Voice Reference (optional — clone voice style)",
 
449
  type="filepath", sources=["upload"],
450
  )
451
  emotion = gr.Slider(0.0, 1.0, value=0.5, step=0.05,
452
  label="Emotion Intensity", info="0 = neutral · 1 = very expressive")
453
  with gr.Group(visible=False) as audio_group:
454
  audio_upload = gr.Audio(
455
+ label="Audio File · WAV/MP3/FLAC · max 30 s",
 
456
  type="filepath", sources=["upload", "microphone"],
457
  )
458
  aspect_ratio = gr.Dropdown(choices=list(ASPECT_PRESETS.keys()),
 
468
 
469
  with gr.Column(scale=1, min_width=440):
470
  output_video = gr.Video(label="Generated Video", format="mp4", autoplay=True,
471
+ height=640, elem_id="output-video", buttons=["download"])
472
 
473
  # ══ Tab 2: Dub Video ═══════════════════════════════════════════════════
474
  with gr.Tab("🎙️ Dub Video", id="tab-dub"):
475
  with gr.Row(equal_height=False):
476
  with gr.Column(scale=1, min_width=360):
477
+ dub_video_input = gr.Video(label="Input Video · max 60 seconds",
 
478
  sources=["upload"])
479
  dub_target_lang = gr.Dropdown(choices=TTS_LANGUAGES, value="English", label="Target Language")
480
+ dub_voice_ref = gr.Audio(label="Voice Reference (optional — clone voice style)",
 
481
  type="filepath", sources=["upload"])
482
  dub_emotion = gr.Slider(0.0, 1.0, value=0.5, step=0.05, label="Emotion Intensity")
483
  dub_btn = gr.Button("🎙️ Dub Video", variant="primary", elem_id="dub-btn", size="lg")
 
492
 
493
  with gr.Column(scale=1, min_width=440):
494
  dub_output_video = gr.Video(label="Dubbed Video", format="mp4", autoplay=True,
495
+ height=480, elem_id="dub-output-video", buttons=["download"])
496
  with gr.Accordion("Details", open=False) as dub_details_acc:
497
  dub_transcript_box = gr.Textbox(label="Detected Transcript", interactive=False, lines=4)
498
  dub_translation_box = gr.Textbox(label="Translation", interactive=False, lines=4)