alexnasa commited on
Commit
d843a55
·
verified ·
1 Parent(s): a548497

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import sys
2
  from pathlib import Path
3
  import uuid
 
4
 
5
  # Add packages to Python path
6
  current_dir = Path(__file__).parent
@@ -366,12 +367,8 @@ def generate_video(
366
  frame_rate = 24.0
367
  num_frames = int(duration * frame_rate) + 1 # +1 to ensure we meet the duration
368
 
369
- # Create output directory if it doesn't exist
370
- output_dir = Path("outputs")
371
- output_dir.mkdir(exist_ok=True)
372
-
373
- run_id = uuid.uuid4().hex
374
- output_path = output_dir / f"video_{current_seed}_{run_id}.mp4"
375
 
376
  # Handle image input
377
  images = []
 
1
  import sys
2
  from pathlib import Path
3
  import uuid
4
+ import tempfile
5
 
6
  # Add packages to Python path
7
  current_dir = Path(__file__).parent
 
367
  frame_rate = 24.0
368
  num_frames = int(duration * frame_rate) + 1 # +1 to ensure we meet the duration
369
 
370
+ with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmpfile:
371
+ output_path = tmpfile.name
 
 
 
 
372
 
373
  # Handle image input
374
  images = []