diff --git a/packages/node/src/schema.ts b/packages/node/src/schema.ts index 8120f4c..6841170 100644 --- a/packages/node/src/schema.ts +++ b/packages/node/src/schema.ts @@ -46,18 +46,27 @@ const ConfigSchema = z .describe('Progress callback.') .optional(), model: z - .preprocess((val) => { - switch (val) { - case 'large': - return 'isnet'; - case 'small': - return 'isnet_quint8'; - case 'medium': - return 'isnet_fp16'; - default: - return val; - } - }, z.enum(['isnet', 'isnet_fp16', 'isnet_quint8', 'modnet', 'modnet_fp16' /*, 'modnet_quint8'*/])) + .preprocess( + (val) => { + switch (val) { + case 'large': + return 'isnet'; + case 'small': + return 'isnet_quint8'; + case 'medium': + return 'isnet_fp16'; + default: + return val; + } + }, + z.enum([ + 'isnet', + 'isnet_fp16', + 'isnet_quint8', + 'modnet', + 'modnet_fp16' /*, 'modnet_quint8'*/ + ]) + ) .default('medium'), output: z .object({ diff --git a/packages/web-examples/vite-project/index.html b/packages/web-examples/vite-project/index.html index 143557b..dde16aa 100644 --- a/packages/web-examples/vite-project/index.html +++ b/packages/web-examples/vite-project/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/web/src/schema.ts b/packages/web/src/schema.ts index a5624f2..af847cf 100644 --- a/packages/web/src/schema.ts +++ b/packages/web/src/schema.ts @@ -41,18 +41,27 @@ const ConfigSchema = z .describe('Progress callback.') .optional(), model: z - .preprocess((val) => { - switch (val) { - case 'large': - return 'isnet'; - case 'small': - return 'isnet_quint8'; - case 'medium': - return 'isnet_fp16'; - default: - return val; - } - }, z.enum(['isnet', 'isnet_fp16', 'isnet_quint8', 'modnet', 'modnet_fp16' /*, 'modnet_quint8'*/])) + .preprocess( + (val) => { + switch (val) { + case 'large': + return 'isnet'; + case 'small': + return 'isnet_quint8'; + case 'medium': + return 'isnet_fp16'; + default: + return val; + } + }, + z.enum([ + 'isnet', + 'isnet_fp16', + 'isnet_quint8', + 'modnet', + 'modnet_fp16' /*, 'modnet_quint8'*/ + ]) + ) .default('medium'), output: z .object({