Update app.py
Browse files
app.py
CHANGED
|
@@ -251,6 +251,19 @@ height: 100% !important;
|
|
| 251 |
"""
|
| 252 |
|
| 253 |
with gr.Blocks(css=css, theme=theme) as app:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
with gr.Tab("Basic Settings"):
|
| 255 |
with gr.Row():
|
| 256 |
prompt = gr.Textbox(placeholder="Enter the image description...", show_label=True, label='Image Prompt ✍️', lines=3, show_copy_button = True)
|
|
@@ -274,6 +287,8 @@ with gr.Blocks(css=css, theme=theme) as app:
|
|
| 274 |
width = gr.Slider(label="Width", minimum=512, maximum=2048, step=8, value=896, interactive=True,)
|
| 275 |
with gr.Row():
|
| 276 |
height = gr.Slider(label="Height", minimum=512, maximum=2048, step=8, value=1152,interactive=True,)
|
|
|
|
|
|
|
| 277 |
|
| 278 |
with gr.Tab("Upscaling Settings"):
|
| 279 |
with gr.Column():
|
|
@@ -287,8 +302,7 @@ with gr.Blocks(css=css, theme=theme) as app:
|
|
| 287 |
with gr.Row():
|
| 288 |
codeformer = gr.Slider(show_label=True, label="Effect CodeFormer (Improve the face)", minimum=0, maximum=1, value=0, step=0.1)
|
| 289 |
|
| 290 |
-
|
| 291 |
-
text_button = gr.Button("Generate image", variant="primary", interactive=True, elem_id="generate")
|
| 292 |
with gr.Column():
|
| 293 |
image_output = gr.Image(show_download_button=True, interactive=False, label='Generated Image 🌄', show_share_button=False, format="png", type="filepath", elem_id="gallery")
|
| 294 |
|
|
@@ -299,18 +313,7 @@ with gr.Blocks(css=css, theme=theme) as app:
|
|
| 299 |
img2img_b = gr.Button("Increase the image", variant='secondary')
|
| 300 |
image_i2i = gr.Image(show_label=True, label='Increased image:')
|
| 301 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
|
| 302 |
-
with gr.Tab(label="Image To Prompt"):
|
| 303 |
-
with gr.Row():
|
| 304 |
-
with gr.Column(scale=4, min_width=300):
|
| 305 |
-
input_img = gr.Image(label="Input Picture", type="filepath")
|
| 306 |
-
|
| 307 |
-
with gr.Column(scale=3):
|
| 308 |
-
output_text = gr.Textbox(label="Flux Prompt", lines=2, scale=6, show_copy_button = True)
|
| 309 |
-
submit_btn = gr.Button(value="Generate Pompt", scale=4, variant='primary')
|
| 310 |
-
clear_prompt =gr.Button("Clear 🗑️",variant="primary", elem_id="clear_button")
|
| 311 |
-
clear_prompt.click(lambda: (None, None), None, [input_img, output_text], queue=False, show_api=False)
|
| 312 |
|
| 313 |
-
submit_btn.click(feifeichat, [input_img], [output_text])
|
| 314 |
|
| 315 |
#app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
| 316 |
if __name__ == "__main__":
|
|
|
|
| 251 |
"""
|
| 252 |
|
| 253 |
with gr.Blocks(css=css, theme=theme) as app:
|
| 254 |
+
with gr.Tab(label="Image To Prompt"):
|
| 255 |
+
with gr.Row():
|
| 256 |
+
with gr.Column(scale=4, min_width=300):
|
| 257 |
+
input_img = gr.Image(label="Input Picture", type="filepath")
|
| 258 |
+
|
| 259 |
+
with gr.Column(scale=3):
|
| 260 |
+
output_text = gr.Textbox(label="Flux Prompt", lines=2, scale=6, show_copy_button = True)
|
| 261 |
+
submit_btn = gr.Button(value="Generate Pompt", scale=4, variant='primary')
|
| 262 |
+
clear_prompt =gr.Button("Clear 🗑️",variant="primary", elem_id="clear_button")
|
| 263 |
+
clear_prompt.click(lambda: (None, None), None, [input_img, output_text], queue=False, show_api=False)
|
| 264 |
+
|
| 265 |
+
submit_btn.click(feifeichat, [input_img], [output_text])
|
| 266 |
+
|
| 267 |
with gr.Tab("Basic Settings"):
|
| 268 |
with gr.Row():
|
| 269 |
prompt = gr.Textbox(placeholder="Enter the image description...", show_label=True, label='Image Prompt ✍️', lines=3, show_copy_button = True)
|
|
|
|
| 287 |
width = gr.Slider(label="Width", minimum=512, maximum=2048, step=8, value=896, interactive=True,)
|
| 288 |
with gr.Row():
|
| 289 |
height = gr.Slider(label="Height", minimum=512, maximum=2048, step=8, value=1152,interactive=True,)
|
| 290 |
+
with gr.Column():
|
| 291 |
+
text_button = gr.Button("Generate image", variant="primary", interactive=True, elem_id="generate")
|
| 292 |
|
| 293 |
with gr.Tab("Upscaling Settings"):
|
| 294 |
with gr.Column():
|
|
|
|
| 302 |
with gr.Row():
|
| 303 |
codeformer = gr.Slider(show_label=True, label="Effect CodeFormer (Improve the face)", minimum=0, maximum=1, value=0, step=0.1)
|
| 304 |
|
| 305 |
+
|
|
|
|
| 306 |
with gr.Column():
|
| 307 |
image_output = gr.Image(show_download_button=True, interactive=False, label='Generated Image 🌄', show_share_button=False, format="png", type="filepath", elem_id="gallery")
|
| 308 |
|
|
|
|
| 313 |
img2img_b = gr.Button("Increase the image", variant='secondary')
|
| 314 |
image_i2i = gr.Image(show_label=True, label='Increased image:')
|
| 315 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
|
|
|
|
| 317 |
|
| 318 |
#app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
| 319 |
if __name__ == "__main__":
|