File size: 844 Bytes
da73f82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)