feat(ui): add default rp brush size

This commit is contained in:
psychedelicious 2024-04-19 22:29:42 +10:00 committed by Kent Keirsey
parent 9667f77c41
commit 6a5510146c
2 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { brushSizeChanged } from 'features/regionalPrompts/store/regionalPromptsSlice';
import { brushSizeChanged, initialRegionalPromptsState } from 'features/regionalPrompts/store/regionalPromptsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
@ -17,8 +17,20 @@ export const BrushSize = memo(() => {
return (
<FormControl>
<FormLabel>{t('regionalPrompts.brushSize')}</FormLabel>
<CompositeSlider min={1} max={100} value={brushSize} onChange={onChange} />
<CompositeNumberInput min={1} max={500} value={brushSize} onChange={onChange} />
<CompositeSlider
min={1}
max={300}
defaultValue={initialRegionalPromptsState.brushSize}
value={brushSize}
onChange={onChange}
/>
<CompositeNumberInput
min={1}
max={600}
defaultValue={initialRegionalPromptsState.brushSize}
value={brushSize}
onChange={onChange}
/>
</FormControl>
);
});

View File

@ -75,7 +75,7 @@ type RegionalPromptsState = {
export const initialRegionalPromptsState: RegionalPromptsState = {
_version: 1,
selectedLayerId: null,
brushSize: 40,
brushSize: 100,
layers: [],
promptLayerOpacity: 0.5, // This currently doesn't work
isEnabled: false,