Fabrice-TIERCELIN commited on
Commit
39916ad
β€’
1 Parent(s): f5c4631

Little improvements

Browse files

- Explain that seed to -1 uses a different seed for each run (correct me if I'm wrong)
- Display the _"Restore your video!"_ button as the main action
- No space before an exclamation mark in English
- Tool name as the main title, short description as subtitle
- Some useful keywords for negative prompt
- Autorun the generated videos

Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -182,7 +182,9 @@ def DiffBIR_restore(input_video, prompt, sr_ratio, n_frames, n_steps, guidance_s
182
  intro = """
183
  <div style="text-align:center">
184
  <h1 style="font-weight: 1400; text-align: center; margin-bottom: 7px;">
185
- DiffIR2VR - <small>Zero-Shot Video Restoration</small>
 
 
186
  </h1>
187
  <span>[<a target="_blank" href="https://jimmycv07.github.io/DiffIR2VR_web/">Project page</a>] [<a target="_blank" href="https://huggingface.co/papers/2406.06523">arXiv</a>]</span>
188
  <div style="display:flex; justify-content: center;margin-top: 0.5em">Note that this page is a limited demo of DiffIR2VR.
@@ -202,10 +204,10 @@ with gr.Blocks(css="style.css") as demo:
202
  with gr.Tab(label="Super-resolution with DiffBIR"):
203
  with gr.Row():
204
  input_video = gr.Video(label="Input Video")
205
- output_video = gr.Video(label="Restored Video", interactive=False)
206
 
207
  with gr.Row():
208
- run_button = gr.Button("Restore your video !", visible=True)
209
 
210
  with gr.Accordion('Advanced options', open=False):
211
  prompt = gr.Textbox(
@@ -235,13 +237,14 @@ with gr.Blocks(css="style.css") as demo:
235
  value=4.0,
236
  step=0.1)
237
  seed = gr.Slider(label='Seed',
 
238
  minimum=-1,
239
  maximum=1000,
240
  step=1,
241
  randomize=True)
242
  n_prompt = gr.Textbox(
243
  label='Negative Prompt',
244
- value="low quality, blurry, low-resolution, noisy, unsharp, weird textures"
245
  )
246
  task = gr.Textbox(value="sr", visible=False)
247
  # input_video.change(
@@ -274,10 +277,10 @@ with gr.Blocks(css="style.css") as demo:
274
  with gr.Tab(label="Denoise with DiffBIR"):
275
  with gr.Row():
276
  input_video = gr.Video(label="Input Video")
277
- output_video = gr.Video(label="Restored Video", interactive=False)
278
 
279
  with gr.Row():
280
- run_button = gr.Button("Restore your video !", visible=True)
281
 
282
  with gr.Accordion('Advanced options', open=False):
283
  prompt = gr.Textbox(
@@ -302,13 +305,14 @@ with gr.Blocks(css="style.css") as demo:
302
  value=4.0,
303
  step=0.1)
304
  seed = gr.Slider(label='Seed',
 
305
  minimum=-1,
306
  maximum=1000,
307
  step=1,
308
  randomize=True)
309
  n_prompt = gr.Textbox(
310
  label='Negative Prompt',
311
- value="low quality, blurry, low-resolution, noisy, unsharp, weird textures"
312
  )
313
  task = gr.Textbox(value="dn", visible=False)
314
  sr_ratio = gr.Number(value=1, visible=False)
 
182
  intro = """
183
  <div style="text-align:center">
184
  <h1 style="font-weight: 1400; text-align: center; margin-bottom: 7px;">
185
+ DiffIR2VR
186
+ <br/>
187
+ <small>Restores/upscales your zero-shot videos</small>
188
  </h1>
189
  <span>[<a target="_blank" href="https://jimmycv07.github.io/DiffIR2VR_web/">Project page</a>] [<a target="_blank" href="https://huggingface.co/papers/2406.06523">arXiv</a>]</span>
190
  <div style="display:flex; justify-content: center;margin-top: 0.5em">Note that this page is a limited demo of DiffIR2VR.
 
204
  with gr.Tab(label="Super-resolution with DiffBIR"):
205
  with gr.Row():
206
  input_video = gr.Video(label="Input Video")
207
+ output_video = gr.Video(label="Restored Video", interactive=False, autoplay=True)
208
 
209
  with gr.Row():
210
+ run_button = gr.Button(value="Restore your video!", variant="primary")
211
 
212
  with gr.Accordion('Advanced options', open=False):
213
  prompt = gr.Textbox(
 
237
  value=4.0,
238
  step=0.1)
239
  seed = gr.Slider(label='Seed',
240
+ info="-1=result is always different",
241
  minimum=-1,
242
  maximum=1000,
243
  step=1,
244
  randomize=True)
245
  n_prompt = gr.Textbox(
246
  label='Negative Prompt',
247
+ value="low quality, blurry, spray, low-resolution, noisy, unsharp, weird textures, JPEG artifact, aliasing, over-smooth"
248
  )
249
  task = gr.Textbox(value="sr", visible=False)
250
  # input_video.change(
 
277
  with gr.Tab(label="Denoise with DiffBIR"):
278
  with gr.Row():
279
  input_video = gr.Video(label="Input Video")
280
+ output_video = gr.Video(label="Restored Video", interactive=False, autoplay=True)
281
 
282
  with gr.Row():
283
+ run_button = gr.Button(value="Restore your video!", variant="primary")
284
 
285
  with gr.Accordion('Advanced options', open=False):
286
  prompt = gr.Textbox(
 
305
  value=4.0,
306
  step=0.1)
307
  seed = gr.Slider(label='Seed',
308
+ info="-1=result is always different",
309
  minimum=-1,
310
  maximum=1000,
311
  step=1,
312
  randomize=True)
313
  n_prompt = gr.Textbox(
314
  label='Negative Prompt',
315
+ value="low quality, blurry, spray, low-resolution, noisy, unsharp, weird textures, JPEG artifact, aliasing, over-smooth"
316
  )
317
  task = gr.Textbox(value="dn", visible=False)
318
  sr_ratio = gr.Number(value=1, visible=False)