1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-24 07:30:19 +01:00
upscayl/common/check-model-scale.ts

18 lines
501 B
TypeScript
Raw Normal View History

2024-01-15 10:25:29 +01:00
/**
* 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;
}