LPX55 commited on
Commit
9e6d3df
·
verified ·
1 Parent(s): 210c4c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -136,10 +136,11 @@ def generate_video(prompt: str, frame1: Image.Image, frame2: Image.Image, resolu
136
  ).frames[0]
137
  # Export to video
138
  video_path = "output.mp4"
139
- export_to_video(video, video_path, fps=24)
140
- with open(video_path, "rb") as video_file:
141
- video_bytes = video_file.read()
142
  return video_bytes
 
143
  @torch.inference_mode()
144
  def call_pipe(
145
  pipe,
 
136
  ).frames[0]
137
  # Export to video
138
  video_path = "output.mp4"
139
+ video_bytes = io.BytesIO()
140
+ export_to_video(video, video_bytes, fps=24)
141
+ video_bytes.seek(0) # Reset the file pointer to the beginning
142
  return video_bytes
143
+
144
  @torch.inference_mode()
145
  def call_pipe(
146
  pipe,