diff --git a/app/page.tsx b/app/page.tsx index f7b8bd2..5f1810c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -58,6 +58,7 @@ export default function UpscalerBattleground() { const result: Record = await fal.subscribe(firstModel.model, { input: { image_url: resizedImage, + ...(firstModel.meta || {}), }, logs: true, onQueueUpdate: (update) => { @@ -89,6 +90,7 @@ export default function UpscalerBattleground() { const result: Record = await fal.subscribe(secondModel.model, { input: { image_url: resizedImage, + ...(secondModel.meta || {}), }, logs: true, onQueueUpdate: (update) => { @@ -204,7 +206,7 @@ export default function UpscalerBattleground() {
setFirstModel(model)} value={firstModel} /> @@ -212,7 +214,7 @@ export default function UpscalerBattleground() {
setSecondModel(model)} value={secondModel} /> diff --git a/components/model-dropdown.tsx b/components/model-dropdown.tsx index 5d51344..210d90f 100644 --- a/components/model-dropdown.tsx +++ b/components/model-dropdown.tsx @@ -16,6 +16,7 @@ export interface Model { name: string; model: string; link: string; + meta?: Record; } export const UPSCALE_MODELS: Model[] = [ @@ -27,9 +28,57 @@ export const UPSCALE_MODELS: Model[] = [ }, { shortname: "ESRGAN", - name: "ESRGAN Upscaler", + name: "ESRGAN x4 Plus", model: "fal-ai/esrgan", link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x4plus", + }, + }, + { + shortname: "ESRGAN", + name: "ESRGAN x2 Plus", + model: "fal-ai/esrgan", + link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x2plus", + }, + }, + { + shortname: "ESRGAN", + name: "ESRGAN x4 Plus Anime 6B", + model: "fal-ai/esrgan", + link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x4plus_anime_6B", + }, + }, + { + shortname: "ESRGAN", + name: "ESRGAN x4 v3", + model: "fal-ai/esrgan", + link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x4_v3", + }, + }, + { + shortname: "ESRGAN", + name: "ESRGAN x4 Wdn v3", + model: "fal-ai/esrgan", + link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x4_wdn_v3", + }, + }, + { + shortname: "ESRGAN", + name: "ESRGAN x4 Anime v3", + model: "fal-ai/esrgan", + link: "https://fal.ai/models/esrgan", + meta: { + model: "RealESRGAN_x4_anime_v3", + }, }, { shortname: "SUPIR", @@ -66,7 +115,7 @@ export function ModelDropdown({ {UPSCALE_MODELS.map((model) => ( onSelect(model)} > {model.name} diff --git a/lib/utils.ts b/lib/utils.ts index a9bc054..013e3a0 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -6,6 +6,6 @@ export function cn(...inputs: ClassValue[]) { } export function formatTime(ms: number) { - if (ms < 1000) return `${ms}ms`; + if (ms < 1000) return `${Math.floor(ms)}ms`; return `${(ms / 1000).toFixed(1)}s`; }