Spaces:
Sleeping
Sleeping
Update ipadapter_tab.py
Browse files- ipadapter_tab.py +56 -56
ipadapter_tab.py
CHANGED
|
@@ -1,57 +1,57 @@
|
|
| 1 |
-
from src.fal_api import fal_ipadapter_api
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
def create_ipadaptor_tab():
|
| 6 |
-
|
| 7 |
-
with gr.TabItem("Cloth IP Adapter",id="cloth_ip_adapter"):
|
| 8 |
-
with gr.Row():
|
| 9 |
-
with gr.Column():
|
| 10 |
-
api_inp = gr.Image(label="Base Image")
|
| 11 |
-
ap_prompt = gr.Textbox(label="clothe prompt")
|
| 12 |
-
with gr.Accordion("Example People", open=False):
|
| 13 |
-
human_examples = gr.Examples(
|
| 14 |
-
examples=[
|
| 15 |
-
["Test_images/Woman_1.png"],
|
| 16 |
-
["Test_images/
|
| 17 |
-
["Test_images/Woman_2.png"],
|
| 18 |
-
|
| 19 |
-
["Test_images/Woman_3.png"],
|
| 20 |
-
|
| 21 |
-
["Test_images/Woman_4.png"],
|
| 22 |
-
["Test_images/Woman_5.png"],
|
| 23 |
-
["Test_images/anime_woman_1.png"],
|
| 24 |
-
["Test_images/anime_woman_2.png"],
|
| 25 |
-
["Test_images/anime_woman_3.png"],
|
| 26 |
-
["Test_images/Jump.png"],
|
| 27 |
-
["Test_images/Walk_1.png"],
|
| 28 |
-
["Test_images/Walk_2.png"],
|
| 29 |
-
["Test_images/Walk_girl_1.png"],
|
| 30 |
-
["Test_images/Walk_girl_2.png"]
|
| 31 |
-
],
|
| 32 |
-
inputs=[api_inp]
|
| 33 |
-
)
|
| 34 |
-
|
| 35 |
-
with gr.Column():
|
| 36 |
-
ip_image = gr.Image(label="IP Adapter Image")
|
| 37 |
-
ip_btn = gr.Button("Process")
|
| 38 |
-
with gr.Accordion("Example Stles and clothes ", open=False):
|
| 39 |
-
ip_examples = gr.Examples(
|
| 40 |
-
examples=[
|
| 41 |
-
["Test_images/style_1.jpg"],
|
| 42 |
-
["Test_images/style_2.png"],
|
| 43 |
-
["Test_images/Style_3.png"],
|
| 44 |
-
["Test_images/Style_4.png"],
|
| 45 |
-
["Test_images/dress_5.png"],
|
| 46 |
-
["Test_images/Nike_RTFKT_Dunk_Void_1.jpg"],
|
| 47 |
-
["Test_images/Shoes_1.png"],
|
| 48 |
-
["Test_images/Jacket_1.png"]
|
| 49 |
-
],
|
| 50 |
-
inputs=[ip_image]
|
| 51 |
-
)
|
| 52 |
-
with gr.Row():
|
| 53 |
-
api_out = gr.Image(label="Output",type="filepath")
|
| 54 |
-
|
| 55 |
-
ip_btn.click(fal_ipadapter_api,inputs=[api_inp,ip_image,ap_prompt],outputs=api_out)
|
| 56 |
-
|
| 57 |
return api_inp,api_out
|
|
|
|
| 1 |
+
from src.fal_api import fal_ipadapter_api
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def create_ipadaptor_tab():
|
| 6 |
+
|
| 7 |
+
with gr.TabItem("Cloth IP Adapter",id="cloth_ip_adapter"):
|
| 8 |
+
with gr.Row():
|
| 9 |
+
with gr.Column():
|
| 10 |
+
api_inp = gr.Image(label="Base Image")
|
| 11 |
+
ap_prompt = gr.Textbox(label="clothe prompt")
|
| 12 |
+
with gr.Accordion("Example People", open=False):
|
| 13 |
+
human_examples = gr.Examples(
|
| 14 |
+
examples=[
|
| 15 |
+
["Test_images/Woman_1.png"],
|
| 16 |
+
["Test_images/man_1.png"],
|
| 17 |
+
["Test_images/Woman_2.png"],
|
| 18 |
+
|
| 19 |
+
["Test_images/Woman_3.png"],
|
| 20 |
+
|
| 21 |
+
["Test_images/Woman_4.png"],
|
| 22 |
+
["Test_images/Woman_5.png"],
|
| 23 |
+
["Test_images/anime_woman_1.png"],
|
| 24 |
+
["Test_images/anime_woman_2.png"],
|
| 25 |
+
["Test_images/anime_woman_3.png"],
|
| 26 |
+
["Test_images/Jump.png"],
|
| 27 |
+
["Test_images/Walk_1.png"],
|
| 28 |
+
["Test_images/Walk_2.png"],
|
| 29 |
+
["Test_images/Walk_girl_1.png"],
|
| 30 |
+
["Test_images/Walk_girl_2.png"]
|
| 31 |
+
],
|
| 32 |
+
inputs=[api_inp]
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
with gr.Column():
|
| 36 |
+
ip_image = gr.Image(label="IP Adapter Image")
|
| 37 |
+
ip_btn = gr.Button("Process")
|
| 38 |
+
with gr.Accordion("Example Stles and clothes ", open=False):
|
| 39 |
+
ip_examples = gr.Examples(
|
| 40 |
+
examples=[
|
| 41 |
+
["Test_images/style_1.jpg"],
|
| 42 |
+
["Test_images/style_2.png"],
|
| 43 |
+
["Test_images/Style_3.png"],
|
| 44 |
+
["Test_images/Style_4.png"],
|
| 45 |
+
["Test_images/dress_5.png"],
|
| 46 |
+
["Test_images/Nike_RTFKT_Dunk_Void_1.jpg"],
|
| 47 |
+
["Test_images/Shoes_1.png"],
|
| 48 |
+
["Test_images/Jacket_1.png"]
|
| 49 |
+
],
|
| 50 |
+
inputs=[ip_image]
|
| 51 |
+
)
|
| 52 |
+
with gr.Row():
|
| 53 |
+
api_out = gr.Image(label="Output",type="filepath")
|
| 54 |
+
|
| 55 |
+
ip_btn.click(fal_ipadapter_api,inputs=[api_inp,ip_image,ap_prompt],outputs=api_out)
|
| 56 |
+
|
| 57 |
return api_inp,api_out
|