resolve conflicts with main and rebuild frontend

This commit is contained in:
Lincoln Stein
2023-02-02 11:00:33 -05:00
30 changed files with 2 additions and 784 deletions

View File

@@ -49,7 +49,6 @@ const initialCanvasState: CanvasState = {
cursorPosition: null,
doesCanvasNeedScaling: false,
futureLayerStates: [],
inpaintReplace: 0.1,
isCanvasInitialized: false,
isDrawing: false,
isMaskEnabled: true,
@@ -82,7 +81,6 @@ const initialCanvasState: CanvasState = {
shouldShowStagingImage: true,
shouldShowStagingOutline: true,
shouldSnapToGrid: true,
shouldUseInpaintReplace: false,
stageCoordinates: { x: 0, y: 0 },
stageDimensions: { width: 0, height: 0 },
stageScale: 1,
@@ -264,12 +262,6 @@ export const canvasSlice = createSlice({
state.pastLayerStates = [];
state.futureLayerStates = [];
},
setShouldUseInpaintReplace: (state, action: PayloadAction<boolean>) => {
state.shouldUseInpaintReplace = action.payload;
},
setInpaintReplace: (state, action: PayloadAction<number>) => {
state.inpaintReplace = action.payload;
},
setShouldLockBoundingBox: (state, action: PayloadAction<boolean>) => {
state.shouldLockBoundingBox = action.payload;
},
@@ -858,7 +850,6 @@ export const {
setCursorPosition,
setDoesCanvasNeedScaling,
setInitialCanvasImage,
setInpaintReplace,
setIsDrawing,
setIsMaskEnabled,
setIsMouseOverBoundingBox,
@@ -885,7 +876,6 @@ export const {
setShouldShowStagingImage,
setShouldShowStagingOutline,
setShouldSnapToGrid,
setShouldUseInpaintReplace,
setStageCoordinates,
setStageScale,
setTool,

View File

@@ -125,7 +125,6 @@ export interface CanvasState {
cursorPosition: Vector2d | null;
doesCanvasNeedScaling: boolean;
futureLayerStates: CanvasLayerState[];
inpaintReplace: number;
intermediateImage?: InvokeAI.Image;
isCanvasInitialized: boolean;
isDrawing: boolean;
@@ -159,7 +158,6 @@ export interface CanvasState {
shouldShowStagingImage: boolean;
shouldShowStagingOutline: boolean;
shouldSnapToGrid: boolean;
shouldUseInpaintReplace: boolean;
stageCoordinates: Vector2d;
stageDimensions: Dimensions;
stageScale: number;

View File

@@ -21,7 +21,6 @@ import { systemSelector } from 'features/system/store/systemSelectors';
import _ from 'lodash';
import { ChangeEvent } from 'react';
import { useTranslation } from 'react-i18next';
import InpaintReplace from './InpaintReplace';
const selector = createSelector(
[optionsSelector, systemSelector, canvasSelector],
@@ -148,7 +147,6 @@ const InfillAndScalingOptions = () => {
withReset
handleReset={handleResetScaledHeight}
/>
<InpaintReplace />
<IAISelect
label={t('options:infillMethod')}
value={infillMethod}

View File

@@ -1,67 +0,0 @@
import React, { ChangeEvent } from 'react';
import { useAppDispatch, useAppSelector } from '../../../../../app/storeHooks';
import _ from 'lodash';
import { createSelector } from '@reduxjs/toolkit';
import IAISwitch from '../../../../../common/components/IAISwitch';
import IAISlider from '../../../../../common/components/IAISlider';
import { Flex } from '@chakra-ui/react';
import {
setInpaintReplace,
setShouldUseInpaintReplace,
} from 'features/canvas/store/canvasSlice';
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import { useTranslation } from 'react-i18next';
const selector = createSelector(
canvasSelector,
(canvas) => {
const { inpaintReplace, shouldUseInpaintReplace } = canvas;
return {
inpaintReplace,
shouldUseInpaintReplace,
};
},
{
memoizeOptions: {
resultEqualityCheck: _.isEqual,
},
}
);
export default function InpaintReplace() {
const { inpaintReplace, shouldUseInpaintReplace } = useAppSelector(selector);
const dispatch = useAppDispatch();
const { t } = useTranslation();
return (
<Flex alignItems={'center'} columnGap={'0.2rem'}>
<IAISlider
label={t('options:inpaintReplace')}
value={inpaintReplace}
onChange={(v: number) => {
dispatch(setInpaintReplace(v));
}}
min={0}
max={1.0}
step={0.05}
isInteger={false}
isSliderDisabled={!shouldUseInpaintReplace}
withSliderMarks
sliderMarkRightOffset={-2}
withReset
handleReset={() => dispatch(setInpaintReplace(0.1))}
withInput
isResetDisabled={!shouldUseInpaintReplace}
/>
<IAISwitch
isChecked={shouldUseInpaintReplace}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
dispatch(setShouldUseInpaintReplace(e.target.checked))
}
marginTop="1.25rem"
/>
</Flex>
);
}