mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): starter models filter matches spandrel models to "upscale" search term
This commit is contained in:
parent
d7e0ec52ff
commit
4352341a00
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user