Group
Browse files- gradio_demo.py +21 -19
gradio_demo.py
CHANGED
|
@@ -285,17 +285,18 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
| 285 |
""")
|
| 286 |
gr.HTML(title_html)
|
| 287 |
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
|
|
|
| 299 |
|
| 300 |
with gr.Accordion("Pre-denoising (optional)", open=False):
|
| 301 |
gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
|
|
@@ -352,17 +353,18 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
| 352 |
with gr.Group():
|
| 353 |
param_setting = gr.Radio(["Quality", "Fidelity"], interactive=True, label="Presetting", value="Quality")
|
| 354 |
restart_button = gr.Button(value="Apply presetting")
|
| 355 |
-
|
| 356 |
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
|
|
|
|
|
|
|
|
|
| 362 |
|
| 363 |
with gr.Accordion("Feedback", open=True, visible=False):
|
| 364 |
-
fb_score = gr.Slider(label="Feedback Score", minimum=1, maximum=5, value=3, step=1,
|
| 365 |
-
interactive=True)
|
| 366 |
fb_text = gr.Textbox(label="Feedback Text", value="", placeholder='Please enter your feedback here.')
|
| 367 |
submit_button = gr.Button(value="Submit Feedback")
|
| 368 |
with gr.Row():
|
|
|
|
| 285 |
""")
|
| 286 |
gr.HTML(title_html)
|
| 287 |
|
| 288 |
+
with gr.Group():
|
| 289 |
+
input_image = gr.Image(label="Input", show_label=True, type="numpy", height=600, elem_id="image-input")
|
| 290 |
+
prompt = gr.Textbox(label="Image description for LlaVa", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3, visible=False)
|
| 291 |
+
upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
|
| 292 |
+
a_prompt = gr.Textbox(label="Image description",
|
| 293 |
+
info="Help the AI to understand what the image represents",
|
| 294 |
+
value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
|
| 295 |
+
'camera, hyper detailed photo - realistic maximum detail, 32k, Color '
|
| 296 |
+
'Grading, ultra HD, extreme meticulous detailing, skin pore detailing, '
|
| 297 |
+
'hyper sharpness, perfect without deformations.',
|
| 298 |
+
lines=3)
|
| 299 |
+
a_prompt_hint = gr.HTML("You can use a <a href='"'https://huggingface.co/spaces/MaziyarPanahi/llava-llama-3-8b'"'>LlaVa space</a> to auto-generate the description of your image.")
|
| 300 |
|
| 301 |
with gr.Accordion("Pre-denoising (optional)", open=False):
|
| 302 |
gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
|
|
|
|
| 353 |
with gr.Group():
|
| 354 |
param_setting = gr.Radio(["Quality", "Fidelity"], interactive=True, label="Presetting", value="Quality")
|
| 355 |
restart_button = gr.Button(value="Apply presetting")
|
|
|
|
| 356 |
|
| 357 |
+
with gr.Group():
|
| 358 |
+
llave_button = gr.Button(value="Generate description by LlaVa (disabled)", visible=False)
|
| 359 |
+
|
| 360 |
+
diffusion_button = gr.Button(value="🚀 Upscale/Restore", variant = "primary", elem_id="process_button")
|
| 361 |
+
|
| 362 |
+
restore_information = gr.HTML(value="Restart the process to get another result.", visible=False)
|
| 363 |
+
result_slider = ImageSlider(label='Output', show_label=True, elem_id="slider1")
|
| 364 |
+
result_gallery = gr.Gallery(label='Output', show_label=True, elem_id="gallery1")
|
| 365 |
|
| 366 |
with gr.Accordion("Feedback", open=True, visible=False):
|
| 367 |
+
fb_score = gr.Slider(label="Feedback Score", minimum=1, maximum=5, value=3, step=1, interactive=True)
|
|
|
|
| 368 |
fb_text = gr.Textbox(label="Feedback Text", value="", placeholder='Please enter your feedback here.')
|
| 369 |
submit_button = gr.Button(value="Submit Feedback")
|
| 370 |
with gr.Row():
|