1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-28 01:10:52 +01:00
upscayl/common/check-model-scale.ts
2024-01-15 14:55:29 +05:30

18 lines
501 B
TypeScript

/**
* Get the scale of the model based on the model name
* @param model The model name
* @returns The initial scale of the model
*/
export default function getModelScale(model: string) {
const modelName = model.toLowerCase();
let initialScale = "4";
if (modelName.includes("x2") || modelName.includes("2x")) {
initialScale = "2";
} else if (modelName.includes("x3") || modelName.includes("3x")) {
initialScale = "3";
} else {
initialScale = "4";
}
return initialScale;
}