From 96670cb678b6da4b1eb538ce26f1f243cca0316b Mon Sep 17 00:00:00 2001 From: SysVis AI Date: Sun, 28 Dec 2025 21:14:07 +0700 Subject: [PATCH] fix: wrap image in array for processor batch input --- src/lib/visionService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/visionService.ts b/src/lib/visionService.ts index 32765c6..80ac214 100644 --- a/src/lib/visionService.ts +++ b/src/lib/visionService.ts @@ -95,9 +95,10 @@ export class VisionService { // Construct prompts using the processor's method (required for Florence-2) const prompts = this.processor.construct_prompts(task); - // Pre-process the image and text inputs (image first, prompts second) + // Pre-process the image and text inputs + // Processor expects batch input, so wrap single image in array if (!this.processor) throw new Error('Processor is undefined'); - const inputs = await this.processor(image, prompts); + const inputs = await this.processor([image], prompts); const generatedIds = await this.model.generate({ ...inputs,