diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx index 05e0b09cee..bf2782b525 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamAspectRatio.tsx @@ -15,8 +15,6 @@ const aspectRatios = [ { name: '1:1', value: 1 / 1 }, ]; -export const mappedAspectRatios = aspectRatios.map((ar) => ar.value); - export default function ParamAspectRatio() { const aspectRatio = useAppSelector( (state: RootState) => state.generation.aspectRatio diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts index 9fd2c5aace..4ffd5ca565 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -6,7 +6,6 @@ import { clamp } from 'lodash-es'; import { ImageDTO } from 'services/api/types'; import { flipBoundingBoxAxes } from 'features/canvas/store/canvasSlice'; -import { mappedAspectRatios } from '../components/Parameters/Core/ParamAspectRatio'; import { clipSkipMap } from '../types/constants'; import { CfgScaleParam, @@ -154,7 +153,7 @@ export const generationSlice = createSlice({ }, toggleSize: (state) => { const [width, height] = [state.width, state.height]; - if (!mappedAspectRatios.includes(height / width)) { + if (![null, 2 / 3, 16 / 9, 1 / 1].includes(height / width)) { state.aspectRatio = null; } state.width = height; @@ -282,7 +281,7 @@ export const generationSlice = createSlice({ setShouldLockAspectRatio: (state, action: PayloadAction) => { if ( action.payload === false && - !mappedAspectRatios.includes(state.aspectRatio) + ![null, 2 / 3, 16 / 9, 1 / 1].includes(state.aspectRatio) ) { state.aspectRatio = null; }