File size: 583 Bytes
898f827
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from roop import run_face_swap

def swap(source_img, target_file):
    output_path = run_face_swap(source_img, target_file)
    return output_path

iface = gr.Interface(
    fn=swap,
    inputs=[
        gr.Image(label="Upload Face Image (face.png)"),
        gr.File(label="Upload Target Image/Video (target.jpg / target.mp4)")
    ],
    outputs=gr.Video(label="Swapped Output"),
    title="AI Face Swap (Image + Video)",
    description="Upload your face and a target (image or video) to get a realistic face swapped result. Powered by Roop."
)
iface.launch()