seawolf2357 commited on
Commit
4275664
ยท
verified ยท
1 Parent(s): fb6f14b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -61
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
- #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],
@@ -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๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ณต์œ  ๊ฐ€๋Šฅํ•œ ๋งํฌ ์ƒ์„ฑ