Fabrice-TIERCELIN commited on
Commit
b0e514f
1 Parent(s): ef92c97

Gather the Pre-denoising section

Browse files
Files changed (1) hide show
  1. gradio_demo.py +8 -12
gradio_demo.py CHANGED
@@ -290,15 +290,14 @@ with gr.Blocks(title="SUPIR") as interface:
290
  with gr.Column():
291
  with gr.Row(equal_height=True):
292
  with gr.Column():
293
- gr.Markdown("<center>Input</center>")
294
- input_image = gr.Image(type="numpy", elem_id="image-input", height=400, width=400)
295
- with gr.Column():
296
- gr.Markdown("<center>Pre-denoising Output</center>")
297
- denoise_image = gr.Image(type="numpy", elem_id="image-s1", height=400, width=400)
298
  prompt = gr.Textbox(label="Image description", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3)
299
 
300
- with gr.Accordion("Pre-denoising options", open=False):
301
  gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
 
 
 
302
 
303
  with gr.Accordion("LLaVA options", open=False, visible=False):
304
  temperature = gr.Slider(label="Temperature", info = "lower=Always similar, higher=More creative", minimum=0., maximum=1.0, value=0.2, step=0.1)
@@ -306,7 +305,7 @@ with gr.Blocks(title="SUPIR") as interface:
306
  qs = gr.Textbox(label="Question", info="Ask LLaVa what description you want", value="Describe the image and its style in a very detailed manner. The image is a realistic photography, not an art painting.", lines=3)
307
 
308
  with gr.Accordion("Restoring options", open=False):
309
- upscale = gr.Slider(label="Upscale factor", info="Resolution x1, x2, x3, x4, x5, x6, x7 or x8", minimum=1, maximum=8, value=2, step=1)
310
  a_prompt = gr.Textbox(label="Default Positive Prompt",
311
  info="Describe what the image represents",
312
  value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
@@ -361,12 +360,9 @@ with gr.Blocks(title="SUPIR") as interface:
361
 
362
 
363
  with gr.Column():
364
- gr.Markdown("<center>Restoring Output</center>")
365
- result_slider = ImageSlider(label='Output', show_label=False, elem_id="slider1")
366
- result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery1")
367
  with gr.Row():
368
- with gr.Column():
369
- denoise_button = gr.Button(value="Pre-denoise")
370
  with gr.Column(visible=False):
371
  llave_button = gr.Button(value="Generate description by LlaVa (disabled)")
372
  with gr.Column():
 
290
  with gr.Column():
291
  with gr.Row(equal_height=True):
292
  with gr.Column():
293
+ input_image = gr.Image(label="Input", show_label=True, type="numpy", height=600, elem_id="image-input")
 
 
 
 
294
  prompt = gr.Textbox(label="Image description", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3)
295
 
296
+ with gr.Accordion("Pre-denoising", open=False):
297
  gamma_correction = gr.Slider(label="Gamma Correction", minimum=0.1, maximum=2.0, value=1.0, step=0.1)
298
+ denoise_button = gr.Button(value="Pre-denoise")
299
+ denoise_image = gr.Image(label="Denoised image", show_label=True, type="numpy", height=600, elem_id="image-s1")
300
+ denoise_information = gr.HTML(value="If present, the denoised image will be used for the restoration instead of the input image.")
301
 
302
  with gr.Accordion("LLaVA options", open=False, visible=False):
303
  temperature = gr.Slider(label="Temperature", info = "lower=Always similar, higher=More creative", minimum=0., maximum=1.0, value=0.2, step=0.1)
 
305
  qs = gr.Textbox(label="Question", info="Ask LLaVa what description you want", value="Describe the image and its style in a very detailed manner. The image is a realistic photography, not an art painting.", lines=3)
306
 
307
  with gr.Accordion("Restoring options", open=False):
308
+ upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
309
  a_prompt = gr.Textbox(label="Default Positive Prompt",
310
  info="Describe what the image represents",
311
  value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
 
360
 
361
 
362
  with gr.Column():
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
  with gr.Row():
 
 
366
  with gr.Column(visible=False):
367
  llave_button = gr.Button(value="Generate description by LlaVa (disabled)")
368
  with gr.Column():