From 4352341a001d5b516ab27f65efd902b29f669563 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:16:25 +1000 Subject: [PATCH] feat(ui): starter models filter matches spandrel models to "upscale" search term --- .../StarterModels/StarterModelsResults.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx index b6f3055146..ccaa29d5e2 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/StarterModels/StarterModelsResults.tsx @@ -19,12 +19,11 @@ export const StarterModelsResults = ({ results }: StarterModelsResultsProps) => const filteredResults = useMemo(() => { return results.filter((result) => { const trimmedSearchTerm = searchTerm.trim().toLowerCase(); - const name = result.name.toLowerCase(); - const type = result.type.toLowerCase(); - const description = result.description.toLowerCase(); - return ( - name.includes(trimmedSearchTerm) || type.includes(trimmedSearchTerm) || description.includes(trimmedSearchTerm) - ); + const matchStrings = [result.name.toLowerCase(), result.type.toLowerCase(), result.description.toLowerCase()]; + if (result.type === 'spandrel_image_to_image') { + matchStrings.push('upscale'); + } + return matchStrings.some((matchString) => matchString.includes(trimmedSearchTerm)); }); }, [results, searchTerm]);