trydrama-neuralgarage commited on
Commit
9c84a71
·
verified ·
1 Parent(s): 80ddb44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -1232,10 +1232,15 @@ CSS = """
1232
  .gradio-container .dr-hint { font-size: 13px !important; color: var(--dr-faint) !important; margin: 4px 0 0 !important; }
1233
  .gradio-container .dr-media video, .gradio-container .dr-media .wrap { border-radius: 10px !important; }
1234
  /* Let the upload box grow while Gradio's trim tool (filmstrip + Trim/Cancel) is open */
1235
- .gradio-container #dr-in { height: auto !important; min-height: 320px !important; overflow: visible !important; }
1236
- .gradio-container #dr-in .video-container { height: auto !important; min-height: 318px !important; }
 
 
 
1237
  .gradio-container #dr-in .video-container:has(.edit-buttons) { min-height: 0 !important; }
1238
- .gradio-container #dr-in .video-container:has(.edit-buttons) video { max-height: 300px !important; }
 
 
1239
  .gradio-container #dr-in .controls { height: auto !important; overflow: visible !important; padding: 8px 0 4px !important; }
1240
  .gradio-container #dr-in .opaque-layer { cursor: grab !important; }
1241
  body.dr-sliding, body.dr-sliding * { cursor: grabbing !important; user-select: none !important; }
@@ -1423,6 +1428,7 @@ body.dr-sliding, body.dr-sliding * { cursor: grabbing !important; user-select: n
1423
  .gradio-container .dr-meta { gap: 4px 14px; }
1424
  .gradio-container .dr-meta span + span::before { content: none; }
1425
  .gradio-container .dr-hero-actions a.dr-btn { flex: 1 1 100%; text-align: center; }
 
1426
  .gradio-container .dr-card { padding: 16px !important; }
1427
  .gradio-container .dr-mark { height: 28px !important; } .dr-word { height: 17px !important; }
1428
  #dr-login button { font-size: 12px !important; padding: 6px 10px !important; }
@@ -1635,6 +1641,8 @@ def generate(video, mood, excited, angry, updates, preset_name, profile: gr.OAut
1635
  raise
1636
 
1637
 
 
 
1638
  with gr.Blocks(title=PAGE_TITLE) as demo:
1639
  gr.HTML('<div class="dr-glow"></div>')
1640
  with gr.Row(elem_id="dr-top"):
@@ -1659,11 +1667,11 @@ with gr.Blocks(title=PAGE_TITLE) as demo:
1659
 
1660
  with gr.Row(elem_id="dr-main", equal_height=True):
1661
  with gr.Column(scale=1, elem_classes="dr-card"):
1662
- gr.HTML('<div class="dr-label"><b>01</b>Upload a video</div>'
1663
  f'<div class="dr-hint">Upload an MP4 video up to {int(MAX_SECONDS)} seconds. Use a clip with '
1664
  'one clearly visible, front-facing person. For a longer video, select a segment with the '
1665
- 'trim tool.</div>')
1666
- video_in = gr.Video(show_label=False, sources=["upload"], height=320, elem_classes="dr-media",
1667
  elem_id="dr-in")
1668
  trim_info = gr.HTML(visible=False, elem_classes="dr-trim")
1669
  samples = [[p] for p in sorted(glob.glob("examples/*.mp4")) if "_after." not in p]
@@ -1694,8 +1702,10 @@ with gr.Blocks(title=PAGE_TITLE) as demo:
1694
  'data.</div>')
1695
 
1696
  with gr.Column(scale=1, elem_classes="dr-card"):
1697
- gr.HTML('<div class="dr-label"><b>03</b>Edited video</div>')
1698
- video_out = gr.Video(show_label=False, interactive=False, height=320, elem_classes="dr-media")
 
 
1699
  dl_btn = gr.DownloadButton("Download edited MP4", visible=False, variant="primary",
1700
  elem_id="dr-dl")
1701
  status_out = gr.HTML(IDLE)
 
1232
  .gradio-container .dr-hint { font-size: 13px !important; color: var(--dr-faint) !important; margin: 4px 0 0 !important; }
1233
  .gradio-container .dr-media video, .gradio-container .dr-media .wrap { border-radius: 10px !important; }
1234
  /* Let the upload box grow while Gradio's trim tool (filmstrip + Trim/Cancel) is open */
1235
+ .gradio-container #dr-in { height: auto !important; min-height: 360px !important; overflow: visible !important; }
1236
+ .gradio-container #dr-in .video-container { height: auto !important; min-height: 358px !important; }
1237
+ /* same visible size as the result player: fit the clip inside the same 360px box */
1238
+ .gradio-container #dr-in video, .gradio-container .dr-out video { height: 358px !important; max-height: 358px !important;
1239
+ width: 100% !important; object-fit: contain !important; background: #000; }
1240
  .gradio-container #dr-in .video-container:has(.edit-buttons) { min-height: 0 !important; }
1241
+ .gradio-container #dr-in .video-container:has(.edit-buttons) video { height: 300px !important; max-height: 300px !important; }
1242
+ /* card headers take the same height, so both boxes start on the same line */
1243
+ .gradio-container .dr-head { min-height: 64px; }
1244
  .gradio-container #dr-in .controls { height: auto !important; overflow: visible !important; padding: 8px 0 4px !important; }
1245
  .gradio-container #dr-in .opaque-layer { cursor: grab !important; }
1246
  body.dr-sliding, body.dr-sliding * { cursor: grabbing !important; user-select: none !important; }
 
1428
  .gradio-container .dr-meta { gap: 4px 14px; }
1429
  .gradio-container .dr-meta span + span::before { content: none; }
1430
  .gradio-container .dr-hero-actions a.dr-btn { flex: 1 1 100%; text-align: center; }
1431
+ .gradio-container .dr-head { min-height: 0; }
1432
  .gradio-container .dr-card { padding: 16px !important; }
1433
  .gradio-container .dr-mark { height: 28px !important; } .dr-word { height: 17px !important; }
1434
  #dr-login button { font-size: 12px !important; padding: 6px 10px !important; }
 
1641
  raise
1642
 
1643
 
1644
+ PLAYER_H = 360 # both players use the same box so original and result are the same size
1645
+
1646
  with gr.Blocks(title=PAGE_TITLE) as demo:
1647
  gr.HTML('<div class="dr-glow"></div>')
1648
  with gr.Row(elem_id="dr-top"):
 
1667
 
1668
  with gr.Row(elem_id="dr-main", equal_height=True):
1669
  with gr.Column(scale=1, elem_classes="dr-card"):
1670
+ gr.HTML('<div class="dr-head"><div class="dr-label"><b>01</b>Upload a video</div>'
1671
  f'<div class="dr-hint">Upload an MP4 video up to {int(MAX_SECONDS)} seconds. Use a clip with '
1672
  'one clearly visible, front-facing person. For a longer video, select a segment with the '
1673
+ 'trim tool.</div></div>')
1674
+ video_in = gr.Video(show_label=False, sources=["upload"], height=PLAYER_H, elem_classes="dr-media",
1675
  elem_id="dr-in")
1676
  trim_info = gr.HTML(visible=False, elem_classes="dr-trim")
1677
  samples = [[p] for p in sorted(glob.glob("examples/*.mp4")) if "_after." not in p]
 
1702
  'data.</div>')
1703
 
1704
  with gr.Column(scale=1, elem_classes="dr-card"):
1705
+ gr.HTML('<div class="dr-head"><div class="dr-label"><b>03</b>Edited video</div>'
1706
+ '<div class="dr-hint">Shown at the same size as your original, so you can compare them '
1707
+ 'side by side.</div></div>')
1708
+ video_out = gr.Video(show_label=False, interactive=False, height=PLAYER_H, elem_classes=["dr-media", "dr-out"])
1709
  dl_btn = gr.DownloadButton("Download edited MP4", visible=False, variant="primary",
1710
  elem_id="dr-dl")
1711
  status_out = gr.HTML(IDLE)