Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -239,74 +239,75 @@ def load_prerendered_examples(prompt, cond_image_path, cond_audio_path_spk1, con
|
|
239 |
|
240 |
return output_video
|
241 |
|
242 |
-
|
243 |
-
gr.
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
<
|
250 |
-
<
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
<
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
with gr.
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
image_input = gr.Image(
|
269 |
-
type="filepath",
|
270 |
-
label="Conditioning Image"
|
271 |
-
)
|
272 |
-
|
273 |
-
audio_input_spk1 = gr.Audio(
|
274 |
-
type="filepath",
|
275 |
-
label="Conditioning Audio for speaker 1(.wav)"
|
276 |
-
)
|
277 |
-
|
278 |
-
audio_input_spk2 = gr.Audio(
|
279 |
-
type="filepath",
|
280 |
-
label="Conditioning Audio for speaker 2(.wav) (Optional)"
|
281 |
-
)
|
282 |
-
|
283 |
-
with gr.Accordion("Advanced settings", open=False):
|
284 |
-
sample_steps = gr.Slider(
|
285 |
-
label="sample steps",
|
286 |
-
value=12,
|
287 |
-
minimum=2,
|
288 |
-
maximum=25,
|
289 |
-
step=1,
|
290 |
-
interactive=False if is_shared_ui else True
|
291 |
)
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
|
240 |
return output_video
|
241 |
|
242 |
+
def create_demo():
|
243 |
+
with gr.Blocks(title="MultiTalk Inference") as demo:
|
244 |
+
gr.Markdown("## 🎤 Meigen MultiTalk Inference Demo")
|
245 |
+
gr.Markdown("Let Them Talk: Audio-Driven Multi-Person Conversational Video Generation")
|
246 |
+
if is_shared_ui:
|
247 |
+
gr.Markdown("Audio will be trimmed to max 5 seconds on fffiloni's shared UI. Sample steps are limited to 12. Gradio queue size is set to 4. Generating a 5 seconds video will take approximatively 20 minutes. Duplicate to skip the queue and work with longer audio inference. ")
|
248 |
+
gr.HTML("""
|
249 |
+
<div style="display:flex;column-gap:4px;">
|
250 |
+
<a href="https://github.com/MeiGen-AI/MultiTalk">
|
251 |
+
<img src='https://img.shields.io/badge/GitHub-Repo-blue'>
|
252 |
+
</a>
|
253 |
+
<a href='https://meigen-ai.github.io/multi-talk/'><img src='https://img.shields.io/badge/Project-Page-blue'></a>
|
254 |
+
<a href='https://huggingface.co/MeiGen-AI/MeiGen-MultiTalk'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Model-yellow'></a>
|
255 |
+
<a href='https://arxiv.org/abs/2505.22647'><img src='https://img.shields.io/badge/Paper-Arxiv-red'></a>
|
256 |
+
<a href="https://huggingface.co/spaces/fffiloni/KDTalker?duplicate=true">
|
257 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
258 |
+
</a>
|
259 |
+
</div>
|
260 |
+
""")
|
261 |
+
|
262 |
+
with gr.Row():
|
263 |
+
with gr.Column(scale=1):
|
264 |
+
prompt_input = gr.Textbox(
|
265 |
+
label="Text Prompt",
|
266 |
+
placeholder="Describe the scene...",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
)
|
268 |
+
|
269 |
+
image_input = gr.Image(
|
270 |
+
type="filepath",
|
271 |
+
label="Conditioning Image"
|
272 |
+
)
|
273 |
+
|
274 |
+
audio_input_spk1 = gr.Audio(
|
275 |
+
type="filepath",
|
276 |
+
label="Conditioning Audio for speaker 1(.wav)"
|
277 |
+
)
|
278 |
+
|
279 |
+
audio_input_spk2 = gr.Audio(
|
280 |
+
type="filepath",
|
281 |
+
label="Conditioning Audio for speaker 2(.wav) (Optional)"
|
282 |
+
)
|
283 |
+
|
284 |
+
with gr.Accordion("Advanced settings", open=False):
|
285 |
+
sample_steps = gr.Slider(
|
286 |
+
label="sample steps",
|
287 |
+
value=12,
|
288 |
+
minimum=2,
|
289 |
+
maximum=25,
|
290 |
+
step=1,
|
291 |
+
interactive=False if is_shared_ui else True
|
292 |
+
)
|
293 |
+
|
294 |
+
submit_btn = gr.Button("Generate")
|
295 |
+
|
296 |
+
with gr.Column(scale=3):
|
297 |
+
output_video = gr.Video(label="Generated Video", interactive=False)
|
298 |
+
|
299 |
+
gr.Examples(
|
300 |
+
examples = [
|
301 |
+
["A woman sings passionately in a dimly lit studio.", "examples/single/single1.png", "examples/single/1.wav", None, 12, "examples/results/multitalk_single_example_1.mp4"],
|
302 |
+
["In a cozy recording studio, a man and a woman are singing together. The man, with tousled brown hair, stands to the left, wearing a light green button-down shirt. His gaze is directed towards the woman, who is smiling warmly. She, with wavy dark hair, is dressed in a black floral dress and stands to the right, her eyes closed in enjoyment. Between them is a professional microphone, capturing their harmonious voices. The background features wooden panels and various audio equipment, creating an intimate and focused atmosphere. The lighting is soft and warm, highlighting their expressions and the intimate setting. A medium shot captures their interaction closely.", "examples/multi/3/multi3.png", "examples/multi/3/1-man.WAV", "examples/multi/3/1-woman.WAV", 12, "examples/results/multitalk_multi_example_2.mp4"],
|
303 |
+
],
|
304 |
+
inputs = [prompt_input, image_input, audio_input_spk1, audio_input_spk2, sample_steps, output_video],
|
305 |
+
)
|
306 |
+
|
307 |
+
submit_btn.click(
|
308 |
+
fn=infer,
|
309 |
+
inputs=[prompt_input, image_input, audio_input_spk1, audio_input_spk2, sample_steps],
|
310 |
+
outputs=output_video
|
311 |
+
)
|
312 |
+
|
313 |
+
demo.queue(max_size=4).launch(ssr_mode=False, show_error=True, show_api=False)
|