mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): get refiner model select working
This commit is contained in:
parent
e7e3045a8a
commit
e771c5f467
@ -4,15 +4,16 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
|||||||
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
|
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover';
|
||||||
import { useModelCombobox } from 'common/hooks/useModelCombobox';
|
import { useModelCombobox } from 'common/hooks/useModelCombobox';
|
||||||
import { refinerModelChanged, selectSdxlSlice } from 'features/sdxl/store/sdxlSlice';
|
import { refinerModelChanged, selectSdxlSlice } from 'features/sdxl/store/sdxlSlice';
|
||||||
|
import { pick } from 'lodash-es';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { REFINER_BASE_MODELS } from 'services/api/constants';
|
import { REFINER_BASE_MODELS } from 'services/api/constants';
|
||||||
import type { MainModelConfig } from 'services/api/endpoints/models';
|
|
||||||
import { useGetMainModelsQuery } 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 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 ParamSDXLRefinerModelSelect = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
@ -25,13 +26,7 @@ const ParamSDXLRefinerModelSelect = () => {
|
|||||||
dispatch(refinerModelChanged(null));
|
dispatch(refinerModelChanged(null));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(
|
dispatch(refinerModelChanged(pick(model, ['key', 'base'])));
|
||||||
refinerModelChanged({
|
|
||||||
base_model: 'sdxl-refiner',
|
|
||||||
model_name: model.model_name,
|
|
||||||
model_type: model.model_type,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
[dispatch]
|
[dispatch]
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user