Fabrice-TIERCELIN
commited on
Commit
•
7c4ec71
1
Parent(s):
d128830
Mention models
Browse files- gradio_demo.py +61 -2
gradio_demo.py
CHANGED
@@ -117,7 +117,6 @@ def llave_process(input_image, temperature, top_p, qs=None):
|
|
117 |
print('<<== llave_process')
|
118 |
return captions[0]
|
119 |
|
120 |
-
@spaces.GPU(duration=540)
|
121 |
def stage2_process(
|
122 |
noisy_image,
|
123 |
denoise_image,
|
@@ -146,6 +145,66 @@ def stage2_process(
|
|
146 |
spt_linear_s_stage2,
|
147 |
model_select,
|
148 |
output_format
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
):
|
150 |
start = time.time()
|
151 |
print('stage2_process ==>>')
|
@@ -364,7 +423,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
364 |
downscale = gr.Radio([["/1", 1], ["/2", 2], ["/3", 3], ["/4", 4], ["/5", 5], ["/6", 6], ["/7", 7], ["/8", 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():
|
367 |
-
model_select = gr.Radio([["💃 Quality", "v0-Q"], ["🎯 Fidelity", "v0-F"]], label="Model Selection", info="Pretrained model", value="v0-Q",
|
368 |
interactive=True)
|
369 |
with gr.Column():
|
370 |
color_fix_type = gr.Radio(["None", "AdaIn", "Wavelet"], label="Color-Fix Type", info="AdaIn=Improve following a style, Wavelet=For JPEG artifacts", value="Wavelet",
|
|
|
117 |
print('<<== llave_process')
|
118 |
return captions[0]
|
119 |
|
|
|
120 |
def stage2_process(
|
121 |
noisy_image,
|
122 |
denoise_image,
|
|
|
145 |
spt_linear_s_stage2,
|
146 |
model_select,
|
147 |
output_format
|
148 |
+
):
|
149 |
+
restore(
|
150 |
+
noisy_image,
|
151 |
+
denoise_image,
|
152 |
+
prompt,
|
153 |
+
a_prompt,
|
154 |
+
n_prompt,
|
155 |
+
num_samples,
|
156 |
+
min_size,
|
157 |
+
downscale,
|
158 |
+
upscale,
|
159 |
+
edm_steps,
|
160 |
+
s_stage1,
|
161 |
+
s_stage2,
|
162 |
+
s_cfg,
|
163 |
+
randomize_seed,
|
164 |
+
seed,
|
165 |
+
s_churn,
|
166 |
+
s_noise,
|
167 |
+
color_fix_type,
|
168 |
+
diff_dtype,
|
169 |
+
ae_dtype,
|
170 |
+
gamma_correction,
|
171 |
+
linear_CFG,
|
172 |
+
linear_s_stage2,
|
173 |
+
spt_linear_CFG,
|
174 |
+
spt_linear_s_stage2,
|
175 |
+
model_select,
|
176 |
+
output_format
|
177 |
+
)
|
178 |
+
|
179 |
+
@spaces.GPU(duration=540)
|
180 |
+
def restore(
|
181 |
+
noisy_image,
|
182 |
+
denoise_image,
|
183 |
+
prompt,
|
184 |
+
a_prompt,
|
185 |
+
n_prompt,
|
186 |
+
num_samples,
|
187 |
+
min_size,
|
188 |
+
downscale,
|
189 |
+
upscale,
|
190 |
+
edm_steps,
|
191 |
+
s_stage1,
|
192 |
+
s_stage2,
|
193 |
+
s_cfg,
|
194 |
+
randomize_seed,
|
195 |
+
seed,
|
196 |
+
s_churn,
|
197 |
+
s_noise,
|
198 |
+
color_fix_type,
|
199 |
+
diff_dtype,
|
200 |
+
ae_dtype,
|
201 |
+
gamma_correction,
|
202 |
+
linear_CFG,
|
203 |
+
linear_s_stage2,
|
204 |
+
spt_linear_CFG,
|
205 |
+
spt_linear_s_stage2,
|
206 |
+
model_select,
|
207 |
+
output_format
|
208 |
):
|
209 |
start = time.time()
|
210 |
print('stage2_process ==>>')
|
|
|
423 |
downscale = gr.Radio([["/1", 1], ["/2", 2], ["/3", 3], ["/4", 4], ["/5", 5], ["/6", 6], ["/7", 7], ["/8", 8]], label="Pre-downscale factor", info="Reducing blurred image reduce the process time", value=1, interactive=True)
|
424 |
with gr.Row():
|
425 |
with gr.Column():
|
426 |
+
model_select = gr.Radio([["💃 Quality (v0-Q)", "v0-Q"], ["🎯 Fidelity (v0-F)", "v0-F"]], label="Model Selection", info="Pretrained model", value="v0-Q",
|
427 |
interactive=True)
|
428 |
with gr.Column():
|
429 |
color_fix_type = gr.Radio(["None", "AdaIn", "Wavelet"], label="Color-Fix Type", info="AdaIn=Improve following a style, Wavelet=For JPEG artifacts", value="Wavelet",
|