Fabrice-TIERCELIN commited on
Commit
4b2a1af
1 Parent(s): 95ae6b7
Files changed (1) hide show
  1. gradio_demo.py +5 -5
gradio_demo.py CHANGED
@@ -78,7 +78,7 @@ def check(input_image):
78
  def reset_feedback():
79
  return 3, ''
80
 
81
- @spaces.GPU(duration=300)
82
  def stage1_process(input_image, gamma_correction):
83
  print('Start stage1_process')
84
  if torch.cuda.device_count() == 0:
@@ -100,7 +100,7 @@ def stage1_process(input_image, gamma_correction):
100
  print('End stage1_process')
101
  return LQ, gr.update(visible = True)
102
 
103
- @spaces.GPU(duration=300)
104
  def llave_process(input_image, temperature, top_p, qs=None):
105
  print('Start llave_process')
106
  if torch.cuda.device_count() == 0:
@@ -116,7 +116,7 @@ def llave_process(input_image, temperature, top_p, qs=None):
116
  print('End llave_process')
117
  return captions[0]
118
 
119
- @spaces.GPU(duration=300)
120
  def stage2_process(
121
  noisy_image,
122
  denoise_image,
@@ -321,7 +321,7 @@ with gr.Blocks(title="SUPIR") as interface:
321
  prompt = gr.Textbox(label="Image description for LlaVa", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3, visible=False)
322
  upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
323
  a_prompt = gr.Textbox(label="Image description (optional)",
324
- info="Help the AI to understand what the image represents; describe as much as possible",
325
  value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
326
  'camera, hyper detailed photo - realistic maximum detail, 32k, Color '
327
  'Grading, ultra HD, extreme meticulous detailing, skin pore detailing, '
@@ -357,7 +357,7 @@ with gr.Blocks(title="SUPIR") as interface:
357
  model_select = gr.Radio(["v0-Q", "v0-F"], label="Model Selection", info="Q=Quality, F=Fidelity", value="v0-Q",
358
  interactive=True)
359
  with gr.Column():
360
- color_fix_type = gr.Radio(["None", "AdaIn", "Wavelet"], label="Color-Fix Type", info="AdaIn=Adaptive Instance Normalization, Wavelet=For JPEG artifacts", value="Wavelet",
361
  interactive=True)
362
  s_cfg = gr.Slider(label="Text Guidance Scale", info="lower=follow the image, higher=follow the prompt", minimum=1.0, maximum=15.0,
363
  value=default_setting.s_cfg_Quality if torch.cuda.device_count() > 0 else 1.0, step=0.1)
 
78
  def reset_feedback():
79
  return 3, ''
80
 
81
+ @spaces.GPU(duration=1800)
82
  def stage1_process(input_image, gamma_correction):
83
  print('Start stage1_process')
84
  if torch.cuda.device_count() == 0:
 
100
  print('End stage1_process')
101
  return LQ, gr.update(visible = True)
102
 
103
+ @spaces.GPU(duration=1800)
104
  def llave_process(input_image, temperature, top_p, qs=None):
105
  print('Start llave_process')
106
  if torch.cuda.device_count() == 0:
 
116
  print('End llave_process')
117
  return captions[0]
118
 
119
+ @spaces.GPU(duration=1800)
120
  def stage2_process(
121
  noisy_image,
122
  denoise_image,
 
321
  prompt = gr.Textbox(label="Image description for LlaVa", value="", placeholder="A person, walking, in a town, Summer, photorealistic", lines=3, visible=False)
322
  upscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Upscale factor", info="Resolution x1 to x8", value=2, interactive=True)
323
  a_prompt = gr.Textbox(label="Image description (optional)",
324
+ info="Help the AI understand what the image represents; describe as much as possible",
325
  value='Cinematic, High Contrast, highly detailed, taken using a Canon EOS R '
326
  'camera, hyper detailed photo - realistic maximum detail, 32k, Color '
327
  'Grading, ultra HD, extreme meticulous detailing, skin pore detailing, '
 
357
  model_select = gr.Radio(["v0-Q", "v0-F"], label="Model Selection", info="Q=Quality, F=Fidelity", value="v0-Q",
358
  interactive=True)
359
  with gr.Column():
360
+ color_fix_type = gr.Radio(["None", "AdaIn", "Wavelet"], label="Color-Fix Type", info="AdaIn=Improve following a style, Wavelet=For JPEG artifacts", value="Wavelet",
361
  interactive=True)
362
  s_cfg = gr.Slider(label="Text Guidance Scale", info="lower=follow the image, higher=follow the prompt", minimum=1.0, maximum=15.0,
363
  value=default_setting.s_cfg_Quality if torch.cuda.device_count() > 0 else 1.0, step=0.1)