Omnibus commited on
Commit
4ff1ee9
1 Parent(s): 3a89838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -237,22 +237,22 @@ def new_media(inp):
237
  vid_box = gr.update(visible=False)
238
  gif_row = gr.update(visible=False)
239
  vid_row = gr.update(visible=False)
240
- qual = gr.update(value=True,interactive=False)
241
- return (im_box,vid_box,gif_row,vid_row,qual)
242
  if inp == "Video":
243
  im_box = gr.update(visible=False)
244
  vid_box = gr.update(visible=True)
245
  gif_row = gr.update(visible=False)
246
  vid_row = gr.update(visible=True)
247
- qual = gr.update(value=False,interactive=True)
248
- return (im_box,vid_box,gif_row,vid_row,qual)
249
  if inp == "GIF":
250
  im_box = gr.update(visible=False)
251
  vid_box = gr.update(visible=True)
252
  gif_row = gr.update(visible=True)
253
  vid_row = gr.update(visible=False)
254
- qual = gr.update(value=False,interactive=True)
255
- return (im_box,vid_box,gif_row,vid_row,qual)
256
 
257
 
258
 
@@ -289,8 +289,7 @@ with gr.Blocks(css=css) as app:
289
  with gr.Column():
290
  with gr.Group():
291
  choose_media = gr.Radio(label="Media Type",choices=["Image","Video","GIF"],value="Image")
292
- with gr.Row():
293
- qual=gr.Checkbox(label="Improve Quality",value=True,interactive=False)
294
  with gr.Accordion("Quality Options", open=False):
295
 
296
  with gr.Row():
@@ -331,10 +330,11 @@ with gr.Blocks(css=css) as app:
331
  trim_count = gr.Textbox(label="Trimmed Frames")
332
  trim_btn=gr.Button("Trim")
333
  out_trim=gr.Video(format="mp4")
334
- hid_box = gr.Textbox(visible=True)
335
- hid_fps = gr.Textbox(visible=True)
336
-
337
 
 
 
338
  with gr.Accordion("Sample Frame",open=False):
339
  with gr.Row():
340
  frame_targ=gr.Number(label="Frame",value=1)
@@ -367,7 +367,7 @@ with gr.Blocks(css=css) as app:
367
 
368
  load_im_btn.click(load_im_fn,inp_img_url,inp_img)
369
  proc_im_btn.click(improve_img,[inp_img,model_name,denoise_strength,face_enhance,outscale],[outp_img,im_stat])
370
- choose_media.change(new_media,choose_media,[im_box,vid_box,gif_row,vid_row,qual])
371
  samp_btn.click(run_samp,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale,frame_targ],[samp_im,gif_stat,vid_stat])
372
  speed_btn.click(update_speed,[hid_box,clip_speed,hid_fps],[outp_vid,hid_box,outp_file])
373
  gif_btn.click(gif_clip,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale],[gif_show,gif_file,gif_stat])
 
237
  vid_box = gr.update(visible=False)
238
  gif_row = gr.update(visible=False)
239
  vid_row = gr.update(visible=False)
240
+ #qual = gr.update(value=True,interactive=False)
241
+ return (im_box,vid_box,gif_row,vid_row)
242
  if inp == "Video":
243
  im_box = gr.update(visible=False)
244
  vid_box = gr.update(visible=True)
245
  gif_row = gr.update(visible=False)
246
  vid_row = gr.update(visible=True)
247
+ #qual = gr.update(value=False,interactive=True)
248
+ return (im_box,vid_box,gif_row,vid_row)
249
  if inp == "GIF":
250
  im_box = gr.update(visible=False)
251
  vid_box = gr.update(visible=True)
252
  gif_row = gr.update(visible=True)
253
  vid_row = gr.update(visible=False)
254
+ #qual = gr.update(value=False,interactive=True)
255
+ return (im_box,vid_box,gif_row,vid_row)
256
 
257
 
258
 
 
289
  with gr.Column():
290
  with gr.Group():
291
  choose_media = gr.Radio(label="Media Type",choices=["Image","Video","GIF"],value="Image")
292
+
 
293
  with gr.Accordion("Quality Options", open=False):
294
 
295
  with gr.Row():
 
330
  trim_count = gr.Textbox(label="Trimmed Frames")
331
  trim_btn=gr.Button("Trim")
332
  out_trim=gr.Video(format="mp4")
333
+ hid_box = gr.Textbox(visible=False)
334
+ hid_fps = gr.Textbox(visible=False)
 
335
 
336
+ with gr.Row():
337
+ qual=gr.Checkbox(label="Improve Quality",value=False)
338
  with gr.Accordion("Sample Frame",open=False):
339
  with gr.Row():
340
  frame_targ=gr.Number(label="Frame",value=1)
 
367
 
368
  load_im_btn.click(load_im_fn,inp_img_url,inp_img)
369
  proc_im_btn.click(improve_img,[inp_img,model_name,denoise_strength,face_enhance,outscale],[outp_img,im_stat])
370
+ choose_media.change(new_media,choose_media,[im_box,vid_box,gif_row,vid_row])
371
  samp_btn.click(run_samp,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale,frame_targ],[samp_im,gif_stat,vid_stat])
372
  speed_btn.click(update_speed,[hid_box,clip_speed,hid_fps],[outp_vid,hid_box,outp_file])
373
  gif_btn.click(gif_clip,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale],[gif_show,gif_file,gif_stat])