From 6bea72a2233c0131fe5932a78cbfd37e9246bcf5 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:15:17 +1000 Subject: [PATCH] fix(ui): spandrel filter infinite loop when no models installed Closes #6835 --- .../controlLayers/components/Filters/FilterSpandrel.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/components/Filters/FilterSpandrel.tsx b/invokeai/frontend/web/src/features/controlLayers/components/Filters/FilterSpandrel.tsx index 7cd64f0c08c..1c76337cc56 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/Filters/FilterSpandrel.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/Filters/FilterSpandrel.tsx @@ -70,8 +70,9 @@ export const FilterSpandrel = ({ onChange, config }: Props) => { ); useEffect(() => { - if (!config.model) { - onChangeModel(options[0] ?? null); + const firstModel = options[0]; + if (!config.model && firstModel) { + onChangeModel(firstModel); } }, [config.model, onChangeModel, options]);