jbilcke-hf HF staff commited on
Commit
0cf8825
·
1 Parent(s): cab8fdd

trying again when upscale fails

Browse files
Files changed (1) hide show
  1. src/index.mts +9 -1
src/index.mts CHANGED
@@ -23,7 +23,15 @@ const main = async () => {
23
  console.log(`- downloaded ${rawVideo}`)
24
 
25
  console.log('- upscaling video..')
26
- const upscaledVideo = await upscaleVideo(rawVideo, caption)
 
 
 
 
 
 
 
 
27
 
28
  console.log('- enhancing video..')
29
  const enhancedVideo = await enhanceVideo(upscaledVideo)
 
23
  console.log(`- downloaded ${rawVideo}`)
24
 
25
  console.log('- upscaling video..')
26
+
27
+ let upscaledVideo = rawVideo
28
+ try {
29
+ upscaledVideo = await upscaleVideo(rawVideo, caption)
30
+ } catch (err) {
31
+ // upscaling is finicky, if it fails we try again
32
+ console.log('- trying again to upscale video..')
33
+ upscaledVideo = await upscaleVideo(rawVideo, caption)
34
+ }
35
 
36
  console.log('- enhancing video..')
37
  const enhancedVideo = await enhanceVideo(upscaledVideo)