From cffcf809774a1ebc6e07e4fa155d85f88bfd84df Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 30 May 2023 16:55:10 +1000 Subject: [PATCH] fix(ui): remove w/h from canvas params, add bbox w/h --- invokeai/frontend/web/public/locales/en.json | 2 ++ .../Canvas/BoundingBox/ParamBoundingBoxHeight.tsx | 15 ++++++++++----- .../Canvas/BoundingBox/ParamBoundingBoxWidth.tsx | 15 ++++++++++----- .../UnifiedCanvas/UnifiedCanvasCoreParameters.tsx | 12 ++++++------ .../UnifiedCanvas/UnifiedCanvasParameters.tsx | 2 -- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 4bd1e5aab3..de11352233 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -454,6 +454,8 @@ "height": "Height", "scheduler": "Scheduler", "seed": "Seed", + "boundingBoxWidth": "Bounding Box Width", + "boundingBoxHeight": "Bounding Box Height", "imageToImage": "Image to Image", "randomizeSeed": "Randomize Seed", "shuffle": "Shuffle Seed", diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx index 75ec70f257..dc83ba8907 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx @@ -2,18 +2,22 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions'; import IAISlider from 'common/components/IAISlider'; -import { canvasSelector } from 'features/canvas/store/canvasSelectors'; +import { + canvasSelector, + isStagingSelector, +} from 'features/canvas/store/canvasSelectors'; import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; const selector = createSelector( - canvasSelector, - (canvas) => { + [canvasSelector, isStagingSelector], + (canvas, isStaging) => { const { boundingBoxDimensions } = canvas; return { boundingBoxDimensions, + isStaging, }; }, defaultSelectorOptions @@ -21,7 +25,7 @@ const selector = createSelector( const ParamBoundingBoxWidth = () => { const dispatch = useAppDispatch(); - const { boundingBoxDimensions } = useAppSelector(selector); + const { boundingBoxDimensions, isStaging } = useAppSelector(selector); const { t } = useTranslation(); @@ -45,12 +49,13 @@ const ParamBoundingBoxWidth = () => { return ( { + [canvasSelector, isStagingSelector], + (canvas, isStaging) => { const { boundingBoxDimensions } = canvas; return { boundingBoxDimensions, + isStaging, }; }, defaultSelectorOptions @@ -21,7 +25,7 @@ const selector = createSelector( const ParamBoundingBoxWidth = () => { const dispatch = useAppDispatch(); - const { boundingBoxDimensions } = useAppSelector(selector); + const { boundingBoxDimensions, isStaging } = useAppSelector(selector); const { t } = useTranslation(); @@ -45,12 +49,13 @@ const ParamBoundingBoxWidth = () => { return ( { - - + + @@ -55,8 +55,8 @@ const UnifiedCanvasCoreParameters = () => { - - + + )} diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx index 4aa68ad56a..c4501ffc44 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx @@ -2,7 +2,6 @@ import ProcessButtons from 'features/parameters/components/ProcessButtons/Proces import ParamSeedCollapse from 'features/parameters/components/Parameters/Seed/ParamSeedCollapse'; import ParamVariationCollapse from 'features/parameters/components/Parameters/Variations/ParamVariationCollapse'; import ParamSymmetryCollapse from 'features/parameters/components/Parameters/Symmetry/ParamSymmetryCollapse'; -import ParamBoundingBoxCollapse from 'features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxCollapse'; import ParamInfillAndScalingCollapse from 'features/parameters/components/Parameters/Canvas/InfillAndScaling/ParamInfillAndScalingCollapse'; import ParamSeamCorrectionCollapse from 'features/parameters/components/Parameters/Canvas/SeamCorrection/ParamSeamCorrectionCollapse'; import UnifiedCanvasCoreParameters from './UnifiedCanvasCoreParameters'; @@ -20,7 +19,6 @@ const UnifiedCanvasParameters = () => { -