FAW-test-app / ipadapter_tab.py
JarvisLabs's picture
Update ipadapter_tab.py
6ff9f3e verified
raw
history blame contribute delete
No virus
2.33 kB
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/man_1.png"],
["Test_images/Woman_2.png"],
["Test_images/Woman_3.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/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