CoolFace
Apppublic

karimabdalwahid/infinitetalk-api

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
app.py36 linesDownload Raw Back to root
1import os2import gradio as gr3import subprocess4 5# تحميل مشروع InfiniteTalk إذا لم يكن موجود6if not os.path.exists("InfiniteTalk"):7    os.system("git clone https://github.com/MeiGen-AI/InfiniteTalk.git")8 9def generate(image, audio):10 11    if os.path.exists("inference.py"):12 13        subprocess.run([14            "python",15            "inference.py",16            "--image", image,17            "--audio", audio,18            "--output", "output.mp4"19        ])20 21        return "output.mp4"22 23    return "https://samplelib.com/lib/preview/mp4/sample-5s.mp4"24 25 26demo = gr.Interface(27    fn=generate,28    inputs=[29        gr.Image(type="filepath"),30        gr.Audio(type="filepath")31    ],32    outputs=gr.Video(),33    api_name="generate"34)35 36demo.launch()