feat(ui): improved model node ui

This commit is contained in:
psychedelicious 2023-08-30 22:36:40 +10:00
parent adfdb02c1b
commit 667d4deeb7
5 changed files with 12 additions and 9 deletions

View File

@ -92,6 +92,7 @@ const ControlNetModelInputFieldComponent = (
error={!selectedModel}
data={data}
onChange={handleValueChanged}
sx={{ width: '100%' }}
/>
);
};

View File

@ -101,8 +101,10 @@ const LoRAModelInputFieldComponent = (
item.label?.toLowerCase().includes(value.toLowerCase().trim()) ||
item.value.toLowerCase().includes(value.toLowerCase().trim())
}
error={!selectedLoRAModel}
onChange={handleChange}
sx={{
width: '100%',
'.mantine-Select-dropdown': {
width: '16rem !important',
},

View File

@ -1,12 +1,12 @@
import { Box, Flex } from '@chakra-ui/react';
import { Flex } from '@chakra-ui/react';
import { SelectItem } from '@mantine/core';
import { useAppDispatch } from 'app/store/storeHooks';
import IAIMantineSearchableSelect from 'common/components/IAIMantineSearchableSelect';
import { fieldRefinerModelValueChanged } from 'features/nodes/store/nodesSlice';
import {
FieldComponentProps,
SDXLRefinerModelInputFieldTemplate,
SDXLRefinerModelInputFieldValue,
FieldComponentProps,
} from 'features/nodes/types/types';
import { MODEL_TYPE_MAP } from 'features/parameters/types/constants';
import { modelIdToMainModelParam } from 'features/parameters/util/modelIdToMainModelParam';
@ -101,20 +101,17 @@ const RefinerModelInputFieldComponent = (
value={selectedModel?.id}
placeholder={data.length > 0 ? 'Select a model' : 'No models available'}
data={data}
error={data.length === 0}
error={!selectedModel}
disabled={data.length === 0}
onChange={handleChangeModel}
sx={{
width: '100%',
'.mantine-Select-dropdown': {
width: '16rem !important',
},
}}
/>
{isSyncModelEnabled && (
<Box mt={7}>
<SyncModelsButton className="nodrag" iconMode />
</Box>
)}
{isSyncModelEnabled && <SyncModelsButton className="nodrag" iconMode />}
</Flex>
);
};

View File

@ -128,10 +128,11 @@ const ModelInputFieldComponent = (
value={selectedModel?.id}
placeholder={data.length > 0 ? 'Select a model' : 'No models available'}
data={data}
error={data.length === 0}
error={!selectedModel}
disabled={data.length === 0}
onChange={handleChangeModel}
sx={{
width: '100%',
'.mantine-Select-dropdown': {
width: '16rem !important',
},

View File

@ -93,8 +93,10 @@ const VaeModelInputFieldComponent = (
data={data}
onChange={handleChangeModel}
disabled={data.length === 0}
error={!selectedVaeModel}
clearable
sx={{
width: '100%',
'.mantine-Select-dropdown': {
width: '16rem !important',
},