Anonymous commited on
Commit
47058ed
1 Parent(s): e4e1b7e

add spaces

Browse files
Files changed (2) hide show
  1. app.py +6 -4
  2. lvdm/models/samplers/ddim_freetraj.py +0 -1
app.py CHANGED
@@ -130,7 +130,9 @@ def infer(*user_args):
130
  input_traj = input_traj,
131
  )
132
 
 
133
  video = infer_gpu_part(args)
 
134
 
135
  video = torch.clamp(video.float(), -1.0, 1.0)
136
  video = video.permute(2, 0, 1, 3, 4) # t,n,c,h,w
@@ -206,7 +208,7 @@ def infer(*user_args):
206
  return video_path, video_bbox_path
207
 
208
 
209
- @spaces.GPU(duration=270)
210
  def infer_gpu_part(args):
211
 
212
  model = instantiate_from_config(args.model_config_512)
@@ -622,7 +624,7 @@ with gr.Blocks(css=css) as demo:
622
 
623
  with gr.Row(visible=False) as row_diy:
624
  dropdown_diy = gr.Dropdown(
625
- label="Number of keyframes",
626
  choices=range(2, MAX_KEYS+1),
627
  )
628
 
@@ -699,7 +701,7 @@ with gr.Blocks(css=css) as demo:
699
  with gr.Row():
700
  ddim_steps = gr.Slider(label='DDIM Steps',
701
  minimum=5,
702
- maximum=200,
703
  step=1,
704
  value=50)
705
  unconditional_guidance_scale = gr.Slider(label='Unconditional Guidance Scale',
@@ -723,7 +725,7 @@ with gr.Blocks(css=css) as demo:
723
  submit_btn = gr.Button("Generate", variant='primary')
724
 
725
  with gr.Row():
726
- check_btn = gr.Button("Check Existing Results", variant='secondary')
727
 
728
  with gr.Row():
729
  gr.Examples(label='Sample Prompts', examples=examples, inputs=[prompt_in, target_indices, ddim_edit, seed, ddim_steps, unconditional_guidance_scale, video_fps, save_fps, height_ratio, width_ratio, radio_mode, dropdown_diy, *frame_indices, *h_positions, *w_positions])
 
130
  input_traj = input_traj,
131
  )
132
 
133
+ print('GPU starts')
134
  video = infer_gpu_part(args)
135
+ print('GPU ends')
136
 
137
  video = torch.clamp(video.float(), -1.0, 1.0)
138
  video = video.permute(2, 0, 1, 3, 4) # t,n,c,h,w
 
208
  return video_path, video_bbox_path
209
 
210
 
211
+ @spaces.GPU(duration=250)
212
  def infer_gpu_part(args):
213
 
214
  model = instantiate_from_config(args.model_config_512)
 
624
 
625
  with gr.Row(visible=False) as row_diy:
626
  dropdown_diy = gr.Dropdown(
627
+ label="Number of Keyframes",
628
  choices=range(2, MAX_KEYS+1),
629
  )
630
 
 
701
  with gr.Row():
702
  ddim_steps = gr.Slider(label='DDIM Steps',
703
  minimum=5,
704
+ maximum=50,
705
  step=1,
706
  value=50)
707
  unconditional_guidance_scale = gr.Slider(label='Unconditional Guidance Scale',
 
725
  submit_btn = gr.Button("Generate", variant='primary')
726
 
727
  with gr.Row():
728
+ check_btn = gr.Button("Check Existing Results (in case of the connection lost)", variant='secondary')
729
 
730
  with gr.Row():
731
  gr.Examples(label='Sample Prompts', examples=examples, inputs=[prompt_in, target_indices, ddim_edit, seed, ddim_steps, unconditional_guidance_scale, video_fps, save_fps, height_ratio, width_ratio, radio_mode, dropdown_diy, *frame_indices, *h_positions, *w_positions])
lvdm/models/samplers/ddim_freetraj.py CHANGED
@@ -215,7 +215,6 @@ class DDIMSampler(object):
215
  temperature=1., noise_dropout=0., score_corrector=None, corrector_kwargs=None,
216
  unconditional_guidance_scale=1., unconditional_conditioning=None,
217
  uc_type=None, conditional_guidance_scale_temporal=None, step=0, ddim_edit=0, **kwargs):
218
- print(step)
219
  b, *_, device = *x.shape, x.device
220
  if x.dim() == 5:
221
  is_video = True
 
215
  temperature=1., noise_dropout=0., score_corrector=None, corrector_kwargs=None,
216
  unconditional_guidance_scale=1., unconditional_conditioning=None,
217
  uc_type=None, conditional_guidance_scale_temporal=None, step=0, ddim_edit=0, **kwargs):
 
218
  b, *_, device = *x.shape, x.device
219
  if x.dim() == 5:
220
  is_video = True