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

View File

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