improve image dedup function

This commit is contained in:
Sha Zhou 2025-06-13 13:44:59 +08:00
parent f48436229d
commit 6979031eac

View File

@ -134,6 +134,10 @@ export const dedupImagesWithEmbeddings = (
similarityThreshold: number = 0.86, // Default similarity threshold
): ImageObject[] => {
try {
if (newImages.length === 0) {
logWarning('No new images provided for deduplication');
return [];
}
// Quick return for single new image with no existing images
if (newImages.length === 1 && existingImages.length === 0) {
return newImages;