jbilcke-hf's picture
jbilcke-hf HF staff
switching to a cheaper interpolation engine
1cf03f7
raw
history blame contribute delete
No virus
757 Bytes
"use server"
import { interpolateGradio } from "./interpolateGradio"
import { interpolateReplicate } from "./interpolateReplicate"
const interpolationEngine = `${process.env.INTERPOLATION_ENGINE || ""}`
export async function interpolateVideo(inputVideo: string): Promise<string> {
if (!inputVideo?.length) {
throw new Error(`missing input video`)
}
try {
if (interpolationEngine === "STMFNET_REPLICATE") {
return interpolateReplicate(inputVideo)
} else if (interpolationEngine === "FILM_GRADIO") {
return interpolateGradio(inputVideo)
} else {
throw new Error(`unsupported interpolation engine "${interpolationEngine}"`)
}
} catch (err) {
throw new Error(`failed to interpolate the video ${err}`)
}
}