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(() => {
|
const filteredResults = useMemo(() => {
|
||||||
return results.filter((result) => {
|
return results.filter((result) => {
|
||||||
const trimmedSearchTerm = searchTerm.trim().toLowerCase();
|
const trimmedSearchTerm = searchTerm.trim().toLowerCase();
|
||||||
const name = result.name.toLowerCase();
|
const matchStrings = [result.name.toLowerCase(), result.type.toLowerCase(), result.description.toLowerCase()];
|
||||||
const type = result.type.toLowerCase();
|
if (result.type === 'spandrel_image_to_image') {
|
||||||
const description = result.description.toLowerCase();
|
matchStrings.push('upscale');
|
||||||
return (
|
}
|
||||||
name.includes(trimmedSearchTerm) || type.includes(trimmedSearchTerm) || description.includes(trimmedSearchTerm)
|
return matchStrings.some((matchString) => matchString.includes(trimmedSearchTerm));
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}, [results, searchTerm]);
|
}, [results, searchTerm]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user