mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): show placeholder in refiner collapse instead of hiding it, if no refiner models installed
This commit is contained in:
parent
3d32ce2b58
commit
5b420653f9
@ -722,7 +722,9 @@
|
||||
"noMatchingModels": "No matching Models",
|
||||
"noModelsAvailable": "No models available",
|
||||
"selectLoRA": "Select a LoRA",
|
||||
"selectModel": "Select a Model"
|
||||
"selectModel": "Select a Model",
|
||||
"noLoRAsInstalled": "No LoRAs installed",
|
||||
"noRefinerModelsInstalled": "No SDXL Refiner models installed"
|
||||
},
|
||||
"nodes": {
|
||||
"addNode": "Add Node",
|
||||
|
@ -10,6 +10,7 @@ import { loraAdded } from 'features/lora/store/loraSlice';
|
||||
import { MODEL_TYPE_MAP } from 'features/parameters/types/constants';
|
||||
import { forEach } from 'lodash-es';
|
||||
import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useGetLoRAModelsQuery } from 'services/api/endpoints/models';
|
||||
|
||||
const selector = createSelector(
|
||||
@ -24,7 +25,7 @@ const ParamLoRASelect = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const { loras } = useAppSelector(selector);
|
||||
const { data: loraModels } = useGetLoRAModelsQuery();
|
||||
|
||||
const { t } = useTranslation();
|
||||
const currentMainModel = useAppSelector(
|
||||
(state: RootState) => state.generation.model
|
||||
);
|
||||
@ -79,7 +80,7 @@ const ParamLoRASelect = () => {
|
||||
return (
|
||||
<Flex sx={{ justifyContent: 'center', p: 2 }}>
|
||||
<Text sx={{ fontSize: 'sm', color: 'base.500', _dark: 'base.700' }}>
|
||||
No LoRAs Loaded
|
||||
{t('models.noLoRAsInstalled')}
|
||||
</Text>
|
||||
</Flex>
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import { Flex, Text } from '@chakra-ui/react';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { stateSelector } from 'app/store/store';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
@ -35,7 +35,15 @@ const ParamSDXLRefinerCollapse = () => {
|
||||
const isRefinerAvailable = useIsRefinerAvailable();
|
||||
|
||||
if (!isRefinerAvailable) {
|
||||
return null;
|
||||
return (
|
||||
<IAICollapse label={t('sdxl.refiner')} activeLabel={activeLabel}>
|
||||
<Flex sx={{ justifyContent: 'center', p: 2 }}>
|
||||
<Text sx={{ fontSize: 'sm', color: 'base.500', _dark: 'base.700' }}>
|
||||
{t('models.noRefinerModelsInstalled')}
|
||||
</Text>
|
||||
</Flex>
|
||||
</IAICollapse>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user