From 8756a6b8c36dcf1c20376267a544b103c668fae7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:23:00 +1000 Subject: [PATCH] fix(ui): remove sharpness param --- .../graph/buildMultidiffusionUpscaleGraph.ts | 6 +-- .../components/Upscale/ParamSharpness.tsx | 52 ------------------- .../features/parameters/store/upscaleSlice.ts | 6 --- .../UpscaleSettingsAccordion.tsx | 2 - 4 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 invokeai/frontend/web/src/features/parameters/components/Upscale/ParamSharpness.tsx diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts index 2548abc809..638ebf2fb2 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/buildMultidiffusionUpscaleGraph.ts @@ -27,8 +27,7 @@ import { getBoardField, getSDXLStylePrompts } from './graphBuilderUtils'; export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promise => { const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.generation; const { positivePrompt, negativePrompt } = state.controlLayers.present; - const { upscaleModel, upscaleInitialImage, sharpness, structure, creativity, tileControlnetModel, scale } = - state.upscale; + const { upscaleModel, upscaleInitialImage, structure, creativity, tileControlnetModel, scale } = state.upscale; assert(model, 'No model found in state'); assert(upscaleModel, 'No upscale model found in state'); @@ -50,7 +49,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis id: `${UNSHARP_MASK}_2`, type: 'unsharp_mask', radius: 2, - strength: (sharpness + 10) * 3.75 + 25, + strength: 60, }); g.addEdge(upscaleNode, 'image', unsharpMaskNode2, 'image'); @@ -181,7 +180,6 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis vae: vae ?? undefined, upscale_model: Graph.getModelMetadataField(upscaleModelConfig), creativity, - sharpness, structure, }); } diff --git a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamSharpness.tsx b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamSharpness.tsx deleted file mode 100644 index 884c6ed0b6..0000000000 --- a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamSharpness.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { CompositeNumberInput, CompositeSlider, FormControl, FormLabel } from '@invoke-ai/ui-library'; -import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { sharpnessChanged } from 'features/parameters/store/upscaleSlice'; -import { memo, useCallback, useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; - -const ParamSharpness = () => { - const sharpness = useAppSelector((s) => s.upscale.sharpness); - const initial = 0; - const sliderMin = -10; - const sliderMax = 10; - const numberInputMin = -10; - const numberInputMax = 10; - const coarseStep = 1; - const fineStep = 1; - const dispatch = useAppDispatch(); - const { t } = useTranslation(); - const marks = useMemo(() => [sliderMin, 0, sliderMax], [sliderMax, sliderMin]); - const onChange = useCallback( - (v: number) => { - dispatch(sharpnessChanged(v)); - }, - [dispatch] - ); - - return ( - - {t('upscaling.sharpness')} - - - - ); -}; - -export default memo(ParamSharpness); diff --git a/invokeai/frontend/web/src/features/parameters/store/upscaleSlice.ts b/invokeai/frontend/web/src/features/parameters/store/upscaleSlice.ts index 2dbfca15a1..f0b8d81ad8 100644 --- a/invokeai/frontend/web/src/features/parameters/store/upscaleSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/upscaleSlice.ts @@ -8,7 +8,6 @@ interface UpscaleState { _version: 1; upscaleModel: ParameterSpandrelImageToImageModel | null; upscaleInitialImage: ImageDTO | null; - sharpness: number; structure: number; creativity: number; tileControlnetModel: ControlNetModelConfig | null; @@ -19,7 +18,6 @@ const initialUpscaleState: UpscaleState = { _version: 1, upscaleModel: null, upscaleInitialImage: null, - sharpness: 0, structure: 0, creativity: 0, tileControlnetModel: null, @@ -42,9 +40,6 @@ export const upscaleSlice = createSlice({ creativityChanged: (state, action: PayloadAction) => { state.creativity = action.payload; }, - sharpnessChanged: (state, action: PayloadAction) => { - state.sharpness = action.payload; - }, tileControlnetModelChanged: (state, action: PayloadAction) => { state.tileControlnetModel = action.payload; }, @@ -59,7 +54,6 @@ export const { upscaleInitialImageChanged, structureChanged, creativityChanged, - sharpnessChanged, tileControlnetModelChanged, scaleChanged, } = upscaleSlice.actions; diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleSettingsAccordion.tsx index 0e6a04f28e..c7ac339a51 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleSettingsAccordion.tsx @@ -2,7 +2,6 @@ import { Expander, Flex, StandaloneAccordion } from '@invoke-ai/ui-library'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import ParamCreativity from 'features/parameters/components/Upscale/ParamCreativity'; -import ParamSharpness from 'features/parameters/components/Upscale/ParamSharpness'; import ParamSpandrelModel from 'features/parameters/components/Upscale/ParamSpandrelModel'; import ParamStructure from 'features/parameters/components/Upscale/ParamStructure'; import { selectUpscalelice } from 'features/parameters/store/upscaleSlice'; @@ -61,7 +60,6 @@ export const UpscaleSettingsAccordion = memo(() => { -