Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -334,21 +334,80 @@ def process_video(video_url, audio_url, progress=gr.Progress()):
|
|
334 |
return None, f"All methods failed. Error: {str(fallback_error)}"
|
335 |
|
336 |
def create_interface():
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
css = """
|
338 |
#component-0 > :not(.prose) {display: none !important;}
|
339 |
footer {display: none !important;}
|
|
|
|
|
|
|
|
|
|
|
340 |
"""
|
341 |
-
|
342 |
-
|
343 |
-
with gr.
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
generate_btn.click(
|
353 |
fn=process_video,
|
354 |
inputs=[video_url_input, audio_url_input],
|
|
|
334 |
return None, f"All methods failed. Error: {str(fallback_error)}"
|
335 |
|
336 |
def create_interface():
|
337 |
+
# ํ
๋ง์ ์คํ์ผ ์ ์
|
338 |
+
theme = gr.themes.Soft(
|
339 |
+
primary_hue="blue",
|
340 |
+
secondary_hue="gray",
|
341 |
+
)
|
342 |
+
|
343 |
css = """
|
344 |
#component-0 > :not(.prose) {display: none !important;}
|
345 |
footer {display: none !important;}
|
346 |
+
.container {max-width: 1000px; margin: auto;}
|
347 |
+
.header {text-align: center; margin-bottom: 2rem;}
|
348 |
+
.input-section {background: #f7f7f7; padding: 2rem; border-radius: 10px;}
|
349 |
+
.output-section {background: #f0f0f0; padding: 2rem; border-radius: 10px;}
|
350 |
+
.button-primary {background: #2196F3 !important;}
|
351 |
"""
|
352 |
+
|
353 |
+
with gr.Blocks(theme=theme, css=css) as app:
|
354 |
+
with gr.Column(elem_classes="container"):
|
355 |
+
# ํค๋ ์น์
|
356 |
+
with gr.Column(elem_classes="header"):
|
357 |
+
gr.Markdown("# ๐ฌ AI Lipsync Video Generator")
|
358 |
+
gr.Markdown("Upload a video/image and audio to create a lip-synced video")
|
359 |
+
|
360 |
+
# ๋ฉ์ธ ์ปจํ
์ธ
|
361 |
+
with gr.Row(equal_height=True):
|
362 |
+
# ์
๋ ฅ ์น์
|
363 |
+
with gr.Column(elem_classes="input-section"):
|
364 |
+
gr.Markdown("### ๐ฅ Input")
|
365 |
+
video_url_input = gr.Textbox(
|
366 |
+
label="Video or Image URL",
|
367 |
+
placeholder="Enter URL of video or image...",
|
368 |
+
info="Supported formats: MP4, JPG, PNG, etc."
|
369 |
+
)
|
370 |
+
audio_url_input = gr.Textbox(
|
371 |
+
label="Audio URL",
|
372 |
+
placeholder="Enter URL of audio file...",
|
373 |
+
info="Supported formats: MP3, WAV, etc."
|
374 |
+
)
|
375 |
+
generate_btn = gr.Button(
|
376 |
+
"๐ Generate Video",
|
377 |
+
variant="primary",
|
378 |
+
elem_classes="button-primary"
|
379 |
+
)
|
380 |
+
|
381 |
+
# ์ถ๋ ฅ ์น์
|
382 |
+
with gr.Column(elem_classes="output-section"):
|
383 |
+
gr.Markdown("### ๐ค Output")
|
384 |
+
video_output = gr.Video(
|
385 |
+
label="Generated Video",
|
386 |
+
height=400
|
387 |
+
)
|
388 |
+
status_output = gr.Textbox(
|
389 |
+
label="Status",
|
390 |
+
interactive=False,
|
391 |
+
placeholder="Processing status will appear here..."
|
392 |
+
)
|
393 |
+
|
394 |
+
# ์ค๋ช
์น์
|
395 |
+
with gr.Accordion("โน๏ธ Instructions", open=False):
|
396 |
+
gr.Markdown("""
|
397 |
+
### How to use:
|
398 |
+
1. Paste the URL of your video or image in the first input box
|
399 |
+
2. Paste the URL of your audio file in the second input box
|
400 |
+
3. Click 'Generate Video' and wait for processing
|
401 |
+
4. The generated video will appear in the output section
|
402 |
+
|
403 |
+
### Notes:
|
404 |
+
- Processing may take several minutes
|
405 |
+
- For best results, use high-quality input files
|
406 |
+
- Supported video formats: MP4
|
407 |
+
- Supported image formats: JPG, PNG
|
408 |
+
- Supported audio formats: MP3, WAV
|
409 |
+
""")
|
410 |
+
|
411 |
generate_btn.click(
|
412 |
fn=process_video,
|
413 |
inputs=[video_url_input, audio_url_input],
|