Lisandro commited on
Commit
78cb566
1 Parent(s): 5a0fea4

Update gradio_process_image to use uploaded image instead of fixed URL

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
  import gradio as gr
3
  from gradio_client import Client, handle_file
4
- # from gradio_imageslider import ImageSlider
5
 
6
  tile_upscaler_url = "https://gokaygokay-tileupscalerv2.hf.space"
7
 
@@ -29,8 +29,8 @@ with gr.Blocks() as demo:
29
  input_image = gr.Image(label="Input Image", type="filepath")
30
  run_button = gr.Button("Enhance Image")
31
  with gr.Column():
32
- output_image = gr.Image(label="Output Image")
33
- # output_slider = ImageSlider(label="Before / After", type="numpy")
34
 
35
  with gr.Accordion("Advanced Options", open=False):
36
  resolution = gr.Slider(minimum=128, maximum=2048, value=1024, step=128, label="Resolution")
@@ -49,7 +49,7 @@ with gr.Blocks() as demo:
49
  run_button.click(
50
  fn=gradio_process_image,
51
  inputs=[input_image, resolution, num_inference_steps, strength, hdr, guidance_scale, controlnet_strength, scheduler_name],
52
- outputs=output_image
53
  )
54
 
55
  demo.launch()
 
1
  import os
2
  import gradio as gr
3
  from gradio_client import Client, handle_file
4
+ from gradio_imageslider import ImageSlider
5
 
6
  tile_upscaler_url = "https://gokaygokay-tileupscalerv2.hf.space"
7
 
 
29
  input_image = gr.Image(label="Input Image", type="filepath")
30
  run_button = gr.Button("Enhance Image")
31
  with gr.Column():
32
+ # output_image = gr.Image(label="Output Image")
33
+ output_slider = ImageSlider(label="Before / After")
34
 
35
  with gr.Accordion("Advanced Options", open=False):
36
  resolution = gr.Slider(minimum=128, maximum=2048, value=1024, step=128, label="Resolution")
 
49
  run_button.click(
50
  fn=gradio_process_image,
51
  inputs=[input_image, resolution, num_inference_steps, strength, hdr, guidance_scale, controlnet_strength, scheduler_name],
52
+ outputs=output_slider
53
  )
54
 
55
  demo.launch()