Update app.py
Browse files
app.py
CHANGED
@@ -200,18 +200,17 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
200 |
# Bind the button to the query function with the added width and height inputs
|
201 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
202 |
|
203 |
-
with gr.
|
204 |
-
with gr.
|
205 |
-
with gr.
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
clr_button.click(lambda: gr.Textbox(value=""), None, output_text)
|
213 |
|
214 |
-
|
215 |
|
216 |
|
217 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
|
|
200 |
# Bind the button to the query function with the added width and height inputs
|
201 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
202 |
|
203 |
+
with gr.TabItem(label="Image To Prompt"):
|
204 |
+
with gr.Row():
|
205 |
+
with gr.Column():
|
206 |
+
input_img = gr.Image(label="Input Picture",height=320,type="filepath")
|
207 |
+
submit_btn = gr.Button(value="Submit", variant='primary')
|
208 |
+
with gr.Column():
|
209 |
+
output_text = gr.Textbox(label="Flux Prompt", show_copy_button = True)
|
210 |
+
clr_button =gr.Button("Clear",variant="primary", elem_id="clear_button")
|
211 |
+
clr_button.click(lambda: gr.Textbox(value=""), None, output_text)
|
|
|
212 |
|
213 |
+
submit_btn.click(feifeichat, [input_img], [output_text])
|
214 |
|
215 |
|
216 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|