feat(ui): regional prompts default layer opacity

This commit is contained in:
psychedelicious 2024-04-18 18:36:19 +10:00 committed by Kent Keirsey
parent dcb4a40741
commit 9e1a4a4a07
2 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,9 @@
import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { promptLayerOpacityChanged } from 'features/regionalPrompts/store/regionalPromptsSlice';
import {
initialRegionalPromptsState,
promptLayerOpacityChanged,
} from 'features/regionalPrompts/store/regionalPromptsSlice';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
@ -17,8 +20,22 @@ export const PromptLayerOpacity = memo(() => {
return (
<FormControl>
<FormLabel>Layer Opacity</FormLabel>
<CompositeSlider min={0.25} max={1} step={0.01} value={promptLayerOpacity} onChange={onChange} />
<CompositeNumberInput min={0.25} max={1} step={0.01} value={promptLayerOpacity} onChange={onChange} />
<CompositeSlider
min={0.25}
max={1}
step={0.01}
value={promptLayerOpacity}
defaultValue={initialRegionalPromptsState.promptLayerOpacity}
onChange={onChange}
/>
<CompositeNumberInput
min={0.25}
max={1}
step={0.01}
value={promptLayerOpacity}
defaultValue={initialRegionalPromptsState.promptLayerOpacity}
onChange={onChange}
/>
</FormControl>
);
});

View File

@ -69,7 +69,7 @@ type RegionalPromptsState = {
autoNegative: ParameterAutoNegative;
};
const initialRegionalPromptsState: RegionalPromptsState = {
export const initialRegionalPromptsState: RegionalPromptsState = {
_version: 1,
tool: 'brush',
selectedLayer: null,