Spaces:
Running
Running
| import gradio as gr | |
| import os | |
| from huggingface_hub import InferenceClient | |
| client = InferenceClient("akhaliq/animate-anyone") | |
| os.makedirs("outputs", exist_ok=True) | |
| def animate(image, video): | |
| output_path = "outputs/result.mp4" | |
| result = client.text_to_video( | |
| prompt="person moving naturally", | |
| image=image, | |
| video=video | |
| ) | |
| with open(output_path, "wb") as f: | |
| f.write(result) | |
| return output_path | |
| app = gr.Interface( | |
| fn=animate, | |
| inputs=[ | |
| gr.Image(type="filepath", label="Upload Image"), | |
| gr.Video(label="Upload Motion Reference Video") | |
| ], | |
| outputs=gr.Video(label="Generated Motion Video"), | |
| title="Motion Control AI", | |
| description="Animate image using motion reference video" | |
| ) | |
| app.launch() |