fix(ui): get refiner model select working

This commit is contained in:
psychedelicious 2024-02-20 11:16:17 +11:00 committed by Brandon Rising
parent 7dab32138c
commit abe2055bbb

View File

@ -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]
);