File size: 2,213 Bytes
5ef5fba
 
 
 
 
885bd73
 
 
5ef5fba
f299797
 
 
 
cd55f63
f299797
e380042
f299797
 
 
 
 
 
e380042
f299797
 
 
 
 
 
 
 
 
14db4bc
 
716cfe6
f299797
 
5ef5fba
 
 
 
 
 
 
 
f203b8d
 
5ef5fba
885bd73
 
 
 
 
 
 
5ef5fba
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
import gradio as gr

from feifeilib.feifeichat import feifeichat
from feifeilib.feifeiflorence import feifeiflorence

def florence_send(output_text):
    return output_text

def create_ui():
    with gr.Blocks() as FeiFei:
        with gr.Row():
            with gr.Column(scale=1):
                feifei_chat_text1 = gr.Textbox(
                    label="่พ“ๅ…ฅๆ‚จ็š„้—ฎ้ข˜1๏ผš", show_label=False, container=False, lines=3, value="A young sexy j-pop Beautiful female model, nature, feifei, j-pop idol style, masterpiece, ่Œ่Œๅ“’", max_lines=10)
                feifei_chat_text2 = gr.Textbox(
                    label="่พ“ๅ…ฅๆ‚จ็š„้—ฎ้ข˜2๏ผš", show_label=False, container=False, lines=5, value="bikini at sea", max_lines=30)
                feifei_chat_btn = gr.Button(value="Gen Prompt")                       
                prompt = gr.Text(
                    label="Prompt",
                    show_label=False,
                    placeholder="Enter your prompt",
                    value="",
                    max_lines=50,
                    container=False,
                )
            with gr.Column(scale=1):
                input_img = gr.Image(
                    label="Input Picture",
                    show_label=False,
                    height=320,
                    type="filepath",
                )
                florence_btn = gr.Button(value="GenPrompt")
                output_text = gr.Textbox(
                    label="Output Text", show_label=False, container=False, max_lines=99
                )
                florence_send_btn = gr.Button(value="Send To Text")
        florence_btn.click(
            fn=feifeiflorence,  # Function to run when the button is clicked
            inputs=[input_img],  # Input components for the function
            outputs=[output_text],  # Output component for the function
        )

        feifei_chat_btn.click(
            fn=feifeichat,
            inputs=[feifei_chat_text1, feifei_chat_text2],
            outputs=[prompt]
        )
        
        florence_send_btn.click(
            fn=florence_send,
            inputs=[output_text],
            outputs=[feifei_chat_text2]
        )
        
    return FeiFei