Skip to content

Commit 8fc7656

Browse files
fix: Minor UI tweak to Control Net enable button (#3783)
2 parents 07a2da4 + ff74de7 commit 8fc7656

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

invokeai/frontend/web/src/features/controlNet/components/parameters/ParamControlNetFeatureToggle.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ const ParamControlNetFeatureToggle = () => {
2929
label="Enable ControlNet"
3030
isChecked={isEnabled}
3131
onChange={handleChange}
32+
formControlProps={{
33+
width: '100%',
34+
}}
3235
/>
3336
);
3437
};

invokeai/frontend/web/src/features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse.tsx

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Divider, Flex } from '@chakra-ui/react';
22
import { createSelector } from '@reduxjs/toolkit';
33
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
44
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
5-
import IAIButton from 'common/components/IAIButton';
65
import IAICollapse from 'common/components/IAICollapse';
6+
import IAIIconButton from 'common/components/IAIIconButton';
77
import ControlNet from 'features/controlNet/components/ControlNet';
88
import ParamControlNetFeatureToggle from 'features/controlNet/components/parameters/ParamControlNetFeatureToggle';
99
import {
@@ -16,6 +16,7 @@ import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
1616
import { map } from 'lodash-es';
1717
import { Fragment, memo, useCallback } from 'react';
1818
import { useTranslation } from 'react-i18next';
19+
import { FaPlus } from 'react-icons/fa';
1920
import { useGetControlNetModelsQuery } from 'services/api/endpoints/models';
2021
import { v4 as uuidv4 } from 'uuid';
2122

@@ -66,15 +67,33 @@ const ParamControlNetCollapse = () => {
6667
return (
6768
<IAICollapse label="ControlNet" activeLabel={activeLabel}>
6869
<Flex sx={{ flexDir: 'column', gap: 3 }}>
69-
<ParamControlNetFeatureToggle />
70-
<IAIButton
71-
isDisabled={!firstModel}
72-
flexGrow={1}
73-
size="sm"
74-
onClick={handleClickedAddControlNet}
75-
>
76-
Add ControlNet
77-
</IAIButton>
70+
<Flex gap={2} alignItems="center">
71+
<Flex
72+
sx={{
73+
flexDirection: 'column',
74+
w: '100%',
75+
gap: 2,
76+
px: 4,
77+
py: 2,
78+
borderRadius: 4,
79+
bg: 'base.200',
80+
_dark: {
81+
bg: 'base.850',
82+
},
83+
}}
84+
>
85+
<ParamControlNetFeatureToggle />
86+
</Flex>
87+
<IAIIconButton
88+
tooltip="Add ControlNet"
89+
aria-label="Add ControlNet"
90+
icon={<FaPlus />}
91+
isDisabled={!firstModel}
92+
flexGrow={1}
93+
size="md"
94+
onClick={handleClickedAddControlNet}
95+
/>
96+
</Flex>
7897
{controlNetsArray.map((c, i) => (
7998
<Fragment key={c.controlNetId}>
8099
{i > 0 && <Divider />}

0 commit comments

Comments
 (0)