Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -334,80 +334,48 @@ 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 |
-
#
|
338 |
theme = gr.themes.Soft(
|
339 |
primary_hue="blue",
|
340 |
secondary_hue="gray",
|
341 |
)
|
342 |
|
|
|
343 |
css = """
|
344 |
-
|
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 |
-
|
355 |
-
|
356 |
-
|
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 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
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 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
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],
|
@@ -419,4 +387,4 @@ def create_interface():
|
|
419 |
if __name__ == "__main__":
|
420 |
print("[DEBUG] Starting application")
|
421 |
app = create_interface()
|
422 |
-
app.launch()
|
|
|
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 |
css = """
|
345 |
+
.container {max-width: 1000px; margin: auto; padding: 20px;}
|
|
|
|
|
346 |
.header {text-align: center; margin-bottom: 2rem;}
|
347 |
+
.input-section {background: #f7f7f7; padding: 2rem; border-radius: 10px; margin-bottom: 1rem;}
|
348 |
.output-section {background: #f0f0f0; padding: 2rem; border-radius: 10px;}
|
349 |
+
.button-primary {background: #2196F3 !important; color: white !important;}
|
350 |
"""
|
351 |
|
352 |
with gr.Blocks(theme=theme, css=css) as app:
|
353 |
+
# ํค๋
|
354 |
+
gr.Markdown("# ๐ฌ AI Lipsync Video Generator")
|
355 |
+
gr.Markdown("Upload a video/image and audio to create a lip-synced video")
|
|
|
|
|
356 |
|
357 |
+
# ์
๋ ฅ ์น์
|
358 |
+
with gr.Row():
|
359 |
+
with gr.Column():
|
360 |
+
video_url_input = gr.Textbox(
|
361 |
+
label="Video or Image URL",
|
362 |
+
placeholder="Enter URL of video or image..."
|
363 |
+
)
|
364 |
+
audio_url_input = gr.Textbox(
|
365 |
+
label="Audio URL",
|
366 |
+
placeholder="Enter URL of audio file..."
|
367 |
+
)
|
368 |
+
generate_btn = gr.Button("Generate Video", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
|
370 |
+
# ์ถ๋ ฅ ์น์
|
371 |
+
with gr.Column():
|
372 |
+
video_output = gr.Video(label="Generated Video")
|
373 |
+
status_output = gr.Textbox(
|
374 |
+
label="Status",
|
375 |
+
interactive=False
|
376 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
+
# ์ด๋ฒคํธ ์ฐ๊ฒฐ
|
379 |
generate_btn.click(
|
380 |
fn=process_video,
|
381 |
inputs=[video_url_input, audio_url_input],
|
|
|
387 |
if __name__ == "__main__":
|
388 |
print("[DEBUG] Starting application")
|
389 |
app = create_interface()
|
390 |
+
app.launch(share=True) # share=True๋ฅผ ์ถ๊ฐํ์ฌ ๊ณต์ ๊ฐ๋ฅํ ๋งํฌ ์์ฑ
|