File size: 2,581 Bytes
bd172ac
 
 
 
 
 
 
 
 
 
 
5258d3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bd172ac
5258d3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bd172ac
 
 
5258d3d
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from src.fal_api import fal_ipadapter_api
import gradio as gr


def create_ipadaptor_tab():
    
    with gr.TabItem("Cloth IP Adapter",id="cloth_ip_adapter"):
      with gr.Row():
        with gr.Column():
          api_inp = gr.Image(label="Base Image")
          ap_prompt = gr.Textbox(label="clothe prompt")
          with gr.Accordion("Example People", open=False):
                    human_examples = gr.Examples(
                         examples=[
                            ["Test_images/Woman_1.png"],
                            ["Test_images/person_1.jpg"],
                            ["Test_images/Woman_2.png"],
                            ["Test_images/person_2.jpg"],
                            ["Test_images/Woman_3.png"],
                            ["Test_images/man_1.png"],
                            ["Test_images/Woman_4.png"],
                             ["Test_images/Woman_5.png"],
                            ["Test_images/anime_woman_1.png"],
                             ["Test_images/anime_woman_2.png"],
                            ["Test_images/anime_woman_3.png"],
                            ["Test_images/Jump.png"],
                            ["Test_images/Walk_1.png"],
                            ["Test_images/Walk_2.png"],
                            ["Test_images/Walk_girl_1.png"],
                            ["Test_images/Walk_girl_2.png"]
                        ],
                        inputs=[api_inp]
                    )
        
        with gr.Column():
          ip_image = gr.Image(label="IP Adapter Image")
          ip_btn = gr.Button("Process")
          with gr.Accordion("Example Stles and clothes ", open=False):
                    ip_examples = gr.Examples(
                        examples=[
                            ["Test_images/style_1.jpg"],
                            ["Test_images/style_2.png"],
                            ["Test_images/Style_3.png"],
                            ["Test_images/Style_4.png"],
                            ["Test_images/dress_5.png"],
                            ["Test_images/Nike_RTFKT_Dunk_Void_1.jpg"],
                            ["Test_images/Shoes_1.png"],
                            ["Test_images/Jacket_1.png"]
                        ],
                        inputs=[ip_image]
                    )
      with gr.Row():
          api_out = gr.Image(label="Output",type="filepath")

    ip_btn.click(fal_ipadapter_api,inputs=[api_inp,ip_image,ap_prompt],outputs=api_out)

    return api_inp,api_out