tweak(ui): simplify layout of inplace install form elements

This commit is contained in:
psychedelicious 2024-03-08 14:25:58 +11:00
parent a28547b3dd
commit d0fcdbe8a3
2 changed files with 28 additions and 20 deletions

View File

@ -766,8 +766,8 @@
"importModels": "Import Models",
"importQueue": "Import Queue",
"inpainting": "v1 Inpainting",
"inplaceInstall": "Inplace install",
"inplaceInstallTooltip": "If inplace installs are enabled, Invoke will reference your model files from where they are now. If disabled, your model files will be cloned into your invokeai directory and referenced from there.",
"inplaceInstall": "In-place install",
"inplaceInstallDesc": "Install models without copying the files. When using the model, it will be loaded from its this location. If disabled, the model file(s) will be copied into the Invoke-managed models directory during installation.",
"interpolationType": "Interpolation Type",
"inverseSigmoid": "Inverse Sigmoid",
"invokeAIFolder": "Invoke AI Folder",

View File

@ -1,4 +1,4 @@
import { Button, Checkbox, Flex, FormControl, FormLabel, Input, Tooltip } from '@invoke-ai/ui-library';
import { Button, Checkbox, Flex, FormControl, FormHelperText, FormLabel, Input } from '@invoke-ai/ui-library';
import { useAppDispatch } from 'app/store/storeHooks';
import { addToast } from 'features/system/store/systemSlice';
import { makeToast } from 'features/system/util/makeToast';
@ -64,28 +64,36 @@ export const InstallModelForm = () => {
return (
<form onSubmit={handleSubmit(onSubmit)}>
<Flex flexDir="column" gap={4}>
<Flex gap={2} alignItems="flex-end" justifyContent="space-between">
<FormControl>
<Flex direction="column" w="full">
<FormControl orientation="vertical">
<FormLabel>{t('modelManager.modelLocation')}</FormLabel>
<Input {...register('location')} />
</Flex>
</FormControl>
<Button onClick={handleSubmit(onSubmit)} isDisabled={!formState.isDirty} isLoading={isLoading} type="submit">
<Button
onClick={handleSubmit(onSubmit)}
isDisabled={!formState.isDirty}
isLoading={isLoading}
type="submit"
size="sm"
mb={1}
>
{t('modelManager.addModel')}
</Button>
</Flex>
<FormControl flexDir="column" gap="1" alignItems="flex-start" mt={3}>
<Tooltip label={t('modelManager.inplaceInstallTooltip')}>
<Flex gap={3}>
<FormControl>
<Flex flexDir="column" gap={2}>
<Flex gap={4}>
<Checkbox {...register('inplace')} />
<FormLabel>
{t('modelManager.inplaceInstall')} ({t('modelManager.localOnly')})
</FormLabel>
</Flex>
</Tooltip>
<FormHelperText>{t('modelManager.inplaceInstallDesc')}</FormHelperText>
</Flex>
</FormControl>
</Flex>
</form>
);
};