ai-tube / src /app /api /parsers /parseVideoModelName.ts
jbilcke-hf's picture
jbilcke-hf HF staff
upgraded to @aitube/client 0.0.12
f24ad59
raw
history blame
765 Bytes
import { VideoGenerationModel } from "@/types/general"
export function parseVideoModelName(text: any, defaultToUse: VideoGenerationModel): VideoGenerationModel {
const rawModelString = `${text || ""}`.trim().toLowerCase()
let model: VideoGenerationModel = defaultToUse || "SVD"
if (
rawModelString === "stable video diffusion" ||
rawModelString === "stablevideodiffusion" ||
rawModelString === "svd"
) {
model = "SVD"
}
if (
rawModelString === "la vie" ||
rawModelString === "lavie"
) {
model = "LaVie"
}
if (
rawModelString === "hotshot" ||
rawModelString === "hotshotxl" ||
rawModelString === "hotshot xl" ||
rawModelString === "hotshot-xl"
) {
model = "HotshotXL"
}
return model
}