Spaces:
Sleeping
Sleeping
import gradio as gr | |
from src.fal_api import fal_faceswap_api | |
def create_faceswap_tab(): | |
with gr.TabItem("Face Swap",id="face_swap"): | |
with gr.Row(): | |
with gr.Column(): | |
fs_base_inp = gr.Image(label="Base Image") | |
with gr.Column(): | |
face_image = gr.Image(label="Face Image") | |
with gr.Row(): | |
face_btn = gr.Button("Process") | |
with gr.Row(): | |
face_out = gr.Image(label="Output",type="filepath") | |
with gr.Row(): | |
examples = gr.Examples( | |
examples=[ | |
[ "Test_images/person_2.jpg", "Test_images/person_1.jpg"], | |
], | |
inputs=[ fs_base_inp,face_image] | |
) | |
face_btn.click(fal_faceswap_api,inputs=[fs_base_inp,face_image],outputs=face_out) | |