artificialguybr commited on
Commit
ec5e01d
·
verified ·
1 Parent(s): 12f2db2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -301,15 +301,18 @@ def generate_video(
301
  num_skip_start_steps,
302
  enable_riflex,
303
  riflex_k,
304
- progress=gr.Progress(track_ τότε=True)
305
  ):
306
  global pipeline, wav2vec_processor, wav2vec_model, config
307
 
308
  progress(0, desc="Starting video generation...")
309
 
310
- if image_path is None: raise gr.Error("Please upload an image")
311
- if audio_path is None: raise gr.Error("Please upload an audio file")
312
- if not models_ready or pipeline is None: raise gr.Error("Models not initialized. Please restart the space.")
 
 
 
313
 
314
  device = pipeline.device
315
 
@@ -391,7 +394,8 @@ def generate_video(
391
  int((current_partial_length - 1) // pipeline.vae.config.temporal_compression_ratio * pipeline.vae.config.temporal_compression_ratio) + 1
392
  if current_partial_length > 1 else 1
393
  )
394
- if current_partial_length <= 0: break
 
395
 
396
  input_video, input_video_mask, clip_image = get_image_to_video_latent3(
397
  ref_img_for_loop, None, video_length=current_partial_length,
@@ -574,7 +578,7 @@ def create_demo():
574
  use_un_ip_mask = gr.Checkbox(label="Use Un-IP Mask", value=False, info="Inverts the inpainting mask.")
575
 
576
  with gr.Row():
577
- with gr.Column():
578
  gr.Markdown("### Negative Guidance (Advanced CFG)")
579
  neg_scale = gr.Slider(label="Negative Scale", minimum=1.0, maximum=5.0, value=1.5, step=0.1, info="Strength of negative prompt in early steps.")
580
  neg_steps = gr.Slider(label="Negative Steps", minimum=0, maximum=10, value=2, step=1, info="How many initial steps to apply the negative scale.")
 
301
  num_skip_start_steps,
302
  enable_riflex,
303
  riflex_k,
304
+ progress=gr.Progress(track_tqdm=True)
305
  ):
306
  global pipeline, wav2vec_processor, wav2vec_model, config
307
 
308
  progress(0, desc="Starting video generation...")
309
 
310
+ if image_path is None:
311
+ raise gr.Error("Please upload an image")
312
+ if audio_path is None:
313
+ raise gr.Error("Please upload an audio file")
314
+ if not models_ready or pipeline is None:
315
+ raise gr.Error("Models not initialized. Please restart the space.")
316
 
317
  device = pipeline.device
318
 
 
394
  int((current_partial_length - 1) // pipeline.vae.config.temporal_compression_ratio * pipeline.vae.config.temporal_compression_ratio) + 1
395
  if current_partial_length > 1 else 1
396
  )
397
+ if current_partial_length <= 0:
398
+ break
399
 
400
  input_video, input_video_mask, clip_image = get_image_to_video_latent3(
401
  ref_img_for_loop, None, video_length=current_partial_length,
 
578
  use_un_ip_mask = gr.Checkbox(label="Use Un-IP Mask", value=False, info="Inverts the inpainting mask.")
579
 
580
  with gr.Row():
581
+ with gr.Column():
582
  gr.Markdown("### Negative Guidance (Advanced CFG)")
583
  neg_scale = gr.Slider(label="Negative Scale", minimum=1.0, maximum=5.0, value=1.5, step=0.1, info="Strength of negative prompt in early steps.")
584
  neg_steps = gr.Slider(label="Negative Steps", minimum=0, maximum=10, value=2, step=1, info="How many initial steps to apply the negative scale.")