PKUWilliamYang commited on
Commit
0053aa3
1 Parent(s): 826f0e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -246,7 +246,7 @@ def process1(input_path, prompt, sd_model, seed, image_resolution, control_stren
246
  use_constraints, bg_smooth,
247
  b1, b2, s1, s2):
248
  image_resolution = min(image_resolution, 512)
249
- frame_count = min(frame_count, 8)
250
  global_state = GlobalState()
251
  global_state.update_controlnet_model(control_type)
252
  global_state.update_sd_model(sd_model)
@@ -271,6 +271,7 @@ def process1(input_path, prompt, sd_model, seed, image_resolution, control_stren
271
  mininterv = maxinterv
272
 
273
  keys = get_keyframe_ind(input_path, frame_num, mininterv, maxinterv)
 
274
  if len(keys) < 3:
275
  raise gr.Error('Too few (%d) keyframes detected!' % (len(keys)))
276
  global_state.keys = keys
@@ -288,6 +289,8 @@ def process1(input_path, prompt, sd_model, seed, image_resolution, control_stren
288
  sublists[-1] = sublists[-2][-add_num:] + sublists[-1]
289
  sublists[-2] = sublists[-2][:-add_num]
290
 
 
 
291
  batch_ind = 0
292
  propagation_mode = batch_ind > 0
293
  imgs = []
 
246
  use_constraints, bg_smooth,
247
  b1, b2, s1, s2):
248
  image_resolution = min(image_resolution, 512)
249
+ #frame_count = min(frame_count, 8)
250
  global_state = GlobalState()
251
  global_state.update_controlnet_model(control_type)
252
  global_state.update_sd_model(sd_model)
 
271
  mininterv = maxinterv
272
 
273
  keys = get_keyframe_ind(input_path, frame_num, mininterv, maxinterv)
274
+ keys = keys[:8] # for huggingface web demo to avoid timeout
275
  if len(keys) < 3:
276
  raise gr.Error('Too few (%d) keyframes detected!' % (len(keys)))
277
  global_state.keys = keys
 
289
  sublists[-1] = sublists[-2][-add_num:] + sublists[-1]
290
  sublists[-2] = sublists[-2][:-add_num]
291
 
292
+ print('processing %d batches:\nkeyframe indexes'%(len(sublists)), sublists)
293
+
294
  batch_ind = 0
295
  propagation_mode = batch_ind > 0
296
  imgs = []