jbilcke-hf HF staff commited on
Commit
cfe4602
1 Parent(s): b5d7f4c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +7 -1
handler.py CHANGED
@@ -139,6 +139,12 @@ class EndpointHandler:
139
  try:
140
  # Create video clip and write to file
141
  clip = ImageSequenceClip(list(video_np), fps=fps)
 
 
 
 
 
 
142
  clip.write_videofile(output_path, codec="libx264", audio=False)
143
 
144
  # Read the video file
@@ -207,7 +213,7 @@ class EndpointHandler:
207
 
208
  random.seed(seed)
209
  np.random.seed(seed)
210
- generator.manual_seed(args.seed)
211
 
212
  generation_kwargs = {
213
  "prompt": prompt,
 
139
  try:
140
  # Create video clip and write to file
141
  clip = ImageSequenceClip(list(video_np), fps=fps)
142
+
143
+ # potential speed optimizations:
144
+ # there is a preset= field, to trade encoding speed with file size (but not quality)
145
+ # values are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo
146
+ #
147
+ # there is a threads= field, by default None, which can be set to 2, 3, 4 etc..
148
  clip.write_videofile(output_path, codec="libx264", audio=False)
149
 
150
  # Read the video file
 
213
 
214
  random.seed(seed)
215
  np.random.seed(seed)
216
+ generator.manual_seed(seed)
217
 
218
  generation_kwargs = {
219
  "prompt": prompt,