From abe2055bbb4c4aa36656c4e2e1333eaadd426c50 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:16:17 +1100 Subject: [PATCH] fix(ui): get refiner model select working --- .../SDXLRefiner/ParamSDXLRefinerModelSelect.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx index 4c54251557..e5978ca21b 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx @@ -4,15 +4,16 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; import { useModelCombobox } from 'common/hooks/useModelCombobox'; import { refinerModelChanged, selectSdxlSlice } from 'features/sdxl/store/sdxlSlice'; +import { pick } from 'lodash-es'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { REFINER_BASE_MODELS } from 'services/api/constants'; -import type { MainModelConfig } from 'services/api/endpoints/models'; import { useGetMainModelsQuery } from 'services/api/endpoints/models'; +import type { MainModelConfig } from 'services/api/types'; const selectModel = createMemoizedSelector(selectSdxlSlice, (sdxl) => sdxl.refinerModel); -const optionsFilter = (model: MainModelConfig) => model.base_model === 'sdxl-refiner'; +const optionsFilter = (model: MainModelConfig) => model.base === 'sdxl-refiner'; const ParamSDXLRefinerModelSelect = () => { const dispatch = useAppDispatch(); @@ -25,13 +26,7 @@ const ParamSDXLRefinerModelSelect = () => { dispatch(refinerModelChanged(null)); return; } - dispatch( - refinerModelChanged({ - base_model: 'sdxl-refiner', - model_name: model.model_name, - model_type: model.model_type, - }) - ); + dispatch(refinerModelChanged(pick(model, ['key', 'base']))); }, [dispatch] );