Update app.py

#1
by linoyts HF Staff - opened
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -124,7 +124,7 @@ def generate_video(
124
  cfg_guidance_scale: float,
125
  height: int,
126
  width: int,
127
- progress=gr.Progress()
128
  ):
129
  """Generate a video based on the given parameters."""
130
  try:
@@ -155,8 +155,7 @@ def generate_video(
155
  # Format: (image_path, frame_idx, strength)
156
  images = [(str(temp_image_path), 0, 1.0)]
157
 
158
- # Run inference
159
- progress(0, desc="Generating video (2-stage)...")
160
  pipeline(
161
  prompt=prompt,
162
  negative_prompt=negative_prompt,
@@ -172,7 +171,6 @@ def generate_video(
172
  tiling_config=TilingConfig.default(),
173
  )
174
 
175
- progress(1.0, desc="Done!")
176
  return str(output_path)
177
 
178
  except Exception as e:
@@ -294,4 +292,4 @@ with gr.Blocks(title="LTX-2 Image-to-Video") as demo:
294
 
295
 
296
  if __name__ == "__main__":
297
- demo.launch()
 
124
  cfg_guidance_scale: float,
125
  height: int,
126
  width: int,
127
+ progress=gr.Progress(track_tqdm=True)
128
  ):
129
  """Generate a video based on the given parameters."""
130
  try:
 
155
  # Format: (image_path, frame_idx, strength)
156
  images = [(str(temp_image_path), 0, 1.0)]
157
 
158
+ # Run inference - progress automatically tracks tqdm from pipeline
 
159
  pipeline(
160
  prompt=prompt,
161
  negative_prompt=negative_prompt,
 
171
  tiling_config=TilingConfig.default(),
172
  )
173
 
 
174
  return str(output_path)
175
 
176
  except Exception as e:
 
292
 
293
 
294
  if __name__ == "__main__":
295
+ demo.launch()