fix(ui): only exclude flux main models from linear UI dropdown, not model manager list

This commit is contained in:
Mary Hipp 2024-08-21 13:26:08 -04:00
parent 09d1f75fe9
commit d5a55789f9
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import { modelSelected } from 'features/parameters/store/actions';
import { selectGenerationSlice } from 'features/parameters/store/generationSlice';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useMainModels } from 'services/api/hooks/modelsByType';
import { useSDMainModels } from 'services/api/hooks/modelsByType';
import type { MainModelConfig } from 'services/api/types';
const selectModel = createMemoizedSelector(selectGenerationSlice, (generation) => generation.model);
@ -17,7 +17,7 @@ const ParamMainModelSelect = () => {
const dispatch = useAppDispatch();
const { t } = useTranslation();
const selectedModel = useAppSelector(selectModel);
const [modelConfigs, { isLoading }] = useMainModels();
const [modelConfigs, { isLoading }] = useSDMainModels();
const tooltipLabel = useMemo(() => {
if (!modelConfigs.length || !selectedModel) {
return;

View File

@ -9,6 +9,7 @@ import {
isFluxMainModelModelConfig,
isIPAdapterModelConfig,
isLoRAModelConfig,
isNonRefinerMainModelConfig,
isNonRefinerNonFluxMainModelConfig,
isNonSDXLMainModelConfig,
isRefinerMainModelModelConfig,
@ -35,7 +36,8 @@ const buildModelsHook =
return [modelConfigs, result] as const;
};
export const useMainModels = buildModelsHook(isNonRefinerNonFluxMainModelConfig);
export const useSDMainModels = buildModelsHook(isNonRefinerNonFluxMainModelConfig);
export const useMainModels = buildModelsHook(isNonRefinerMainModelConfig);
export const useNonSDXLMainModels = buildModelsHook(isNonSDXLMainModelConfig);
export const useRefinerModels = buildModelsHook(isRefinerMainModelModelConfig);
export const useFluxModels = buildModelsHook(isFluxMainModelModelConfig);