feat(ui): spruce up control adapter ui

This commit is contained in:
psychedelicious 2023-10-06 19:10:50 +11:00
parent 3e93159bce
commit 1a9d2f1701
3 changed files with 16 additions and 7 deletions

View File

@ -131,6 +131,10 @@
"upload": "Upload"
},
"controlnet": {
"controlAdapter": "Control Adapter",
"controlnet": "$t(controlnet.controlAdapter) #{{number}} (Control Net)",
"ip_adapter": "$t(controlnet.controlAdapter) #{{number}} (IP Adapter)",
"t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} (T2I Adapter)",
"amult": "a_mult",
"autoConfigure": "Auto configure processor",
"balanced": "Balanced",

View File

@ -27,8 +27,8 @@ import ParamControlAdapterControlMode from './parameters/ParamControlAdapterCont
import ParamControlAdapterProcessorSelect from './parameters/ParamControlAdapterProcessorSelect';
import ParamControlAdapterResizeMode from './parameters/ParamControlAdapterResizeMode';
const ControlAdapterConfig = (props: { id: string }) => {
const { id } = props;
const ControlAdapterConfig = (props: { id: string; number: number }) => {
const { id, number } = props;
const controlAdapterType = useControlAdapterType(id);
const dispatch = useAppDispatch();
const { t } = useTranslation();
@ -75,13 +75,19 @@ const ControlAdapterConfig = (props: { id: string }) => {
},
}}
>
<Flex sx={{ gap: 2, alignItems: 'center' }}>
<Flex
sx={{ gap: 2, alignItems: 'center', justifyContent: 'space-between' }}
>
<IAISwitch
tooltip={t('controlnet.toggleControlNet')}
label={t(`controlnet.${controlAdapterType}`, { number })}
aria-label={t('controlnet.toggleControlNet')}
isChecked={isEnabled}
onChange={handleToggleIsEnabled}
formControlProps={{ w: 'full' }}
formLabelProps={{ fontWeight: 600 }}
/>
</Flex>
<Flex sx={{ gap: 2, alignItems: 'center' }}>
<Box
sx={{
w: 'full',

View File

@ -90,11 +90,10 @@ const ParamControlAdaptersCollapse = () => {
T2I Adapter
</IAIButton>
</ButtonGroup>
<Divider />
{controlAdapterIds.map((id, i) => (
<Fragment key={id}>
{i > 0 && <Divider />}
<ControlAdapterConfig id={id} />
<Divider />
<ControlAdapterConfig id={id} number={i + 1} />
</Fragment>
))}
</Flex>