Fabrice-TIERCELIN
commited on
Commit
•
4f1d55c
1
Parent(s):
e887663
7 min
Browse files- gradio_demo.py +5 -5
gradio_demo.py
CHANGED
@@ -79,7 +79,7 @@ def check(input_image):
|
|
79 |
def reset_feedback():
|
80 |
return 3, ''
|
81 |
|
82 |
-
@spaces.GPU(duration=
|
83 |
def stage1_process(input_image, gamma_correction):
|
84 |
print('Start stage1_process')
|
85 |
if torch.cuda.device_count() == 0:
|
@@ -101,7 +101,7 @@ def stage1_process(input_image, gamma_correction):
|
|
101 |
print('End stage1_process')
|
102 |
return LQ, gr.update(visible = True)
|
103 |
|
104 |
-
@spaces.GPU(duration=
|
105 |
def llave_process(input_image, temperature, top_p, qs=None):
|
106 |
print('Start llave_process')
|
107 |
if torch.cuda.device_count() == 0:
|
@@ -117,7 +117,7 @@ def llave_process(input_image, temperature, top_p, qs=None):
|
|
117 |
print('End llave_process')
|
118 |
return captions[0]
|
119 |
|
120 |
-
@spaces.GPU(duration=
|
121 |
def stage2_process(
|
122 |
noisy_image,
|
123 |
denoise_image,
|
@@ -292,7 +292,7 @@ title_html = """
|
|
292 |
LlaVa is not integrated in this demo. The content added by SUPIR is imagination, not real-world information.
|
293 |
The aim of SUPIR is the beauty and the illustration.
|
294 |
Most of the processes only last few minutes.
|
295 |
-
This demo can handle huge images but the process will be aborted if it lasts more than
|
296 |
|
297 |
<p><center><a href="https://arxiv.org/abs/2401.13627">Paper</a>   <a href="http://supir.xpixel.group/">Project Page</a>   <a href="https://github.com/Fanghua-Yu/SUPIR/blob/master/assets/DemoGuide.png">How to play</a>   <a href="https://huggingface.co/blog/MonsterMMORPG/supir-sota-image-upscale-better-than-magnific-ai">Local Install Guide</a></center></p>
|
298 |
"""
|
@@ -360,7 +360,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
360 |
edm_steps = gr.Slider(label="Steps", info="lower=faster, higher=more details", minimum=1, maximum=200, value=default_setting.edm_steps if torch.cuda.device_count() > 0 else 1, step=1)
|
361 |
num_samples = gr.Slider(label="Num Samples", info="Number of generated results", minimum=1, maximum=4 if not args.use_image_slider else 1
|
362 |
, value=1, step=1)
|
363 |
-
min_size = gr.Slider(label="Minimum size", info="Minimum height, minimum width", minimum=32, value=1024, step=32)
|
364 |
downscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Pre-downscale factor", info="Reducing blurred image reduce the process time", value=1, interactive=True)
|
365 |
with gr.Row():
|
366 |
with gr.Column():
|
|
|
79 |
def reset_feedback():
|
80 |
return 3, ''
|
81 |
|
82 |
+
@spaces.GPU(duration=420)
|
83 |
def stage1_process(input_image, gamma_correction):
|
84 |
print('Start stage1_process')
|
85 |
if torch.cuda.device_count() == 0:
|
|
|
101 |
print('End stage1_process')
|
102 |
return LQ, gr.update(visible = True)
|
103 |
|
104 |
+
@spaces.GPU(duration=420)
|
105 |
def llave_process(input_image, temperature, top_p, qs=None):
|
106 |
print('Start llave_process')
|
107 |
if torch.cuda.device_count() == 0:
|
|
|
117 |
print('End llave_process')
|
118 |
return captions[0]
|
119 |
|
120 |
+
@spaces.GPU(duration=420)
|
121 |
def stage2_process(
|
122 |
noisy_image,
|
123 |
denoise_image,
|
|
|
292 |
LlaVa is not integrated in this demo. The content added by SUPIR is imagination, not real-world information.
|
293 |
The aim of SUPIR is the beauty and the illustration.
|
294 |
Most of the processes only last few minutes.
|
295 |
+
This demo can handle huge images but the process will be aborted if it lasts more than 7 min.
|
296 |
|
297 |
<p><center><a href="https://arxiv.org/abs/2401.13627">Paper</a>   <a href="http://supir.xpixel.group/">Project Page</a>   <a href="https://github.com/Fanghua-Yu/SUPIR/blob/master/assets/DemoGuide.png">How to play</a>   <a href="https://huggingface.co/blog/MonsterMMORPG/supir-sota-image-upscale-better-than-magnific-ai">Local Install Guide</a></center></p>
|
298 |
"""
|
|
|
360 |
edm_steps = gr.Slider(label="Steps", info="lower=faster, higher=more details", minimum=1, maximum=200, value=default_setting.edm_steps if torch.cuda.device_count() > 0 else 1, step=1)
|
361 |
num_samples = gr.Slider(label="Num Samples", info="Number of generated results", minimum=1, maximum=4 if not args.use_image_slider else 1
|
362 |
, value=1, step=1)
|
363 |
+
min_size = gr.Slider(label="Minimum size", info="Minimum height, minimum width of the result", minimum=32, maximum=4096, value=1024, step=32)
|
364 |
downscale = gr.Radio([1, 2, 3, 4, 5, 6, 7, 8], label="Pre-downscale factor", info="Reducing blurred image reduce the process time", value=1, interactive=True)
|
365 |
with gr.Row():
|
366 |
with gr.Column():
|