fix(ui): remove sharpness param

This commit is contained in:
psychedelicious 2024-07-23 10:23:00 +10:00
parent 2e0cebb571
commit 8756a6b8c3
4 changed files with 2 additions and 64 deletions

View File

@ -27,8 +27,7 @@ import { getBoardField, getSDXLStylePrompts } from './graphBuilderUtils';
export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promise<GraphType> => {
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,
});
}

View File

@ -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 (
<FormControl>
<FormLabel>{t('upscaling.sharpness')}</FormLabel>
<CompositeSlider
value={sharpness}
defaultValue={initial}
min={sliderMin}
max={sliderMax}
step={coarseStep}
fineStep={fineStep}
onChange={onChange}
marks={marks}
/>
<CompositeNumberInput
value={sharpness}
defaultValue={initial}
min={numberInputMin}
max={numberInputMax}
step={coarseStep}
fineStep={fineStep}
onChange={onChange}
/>
</FormControl>
);
};
export default memo(ParamSharpness);

View File

@ -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<number>) => {
state.creativity = action.payload;
},
sharpnessChanged: (state, action: PayloadAction<number>) => {
state.sharpness = action.payload;
},
tileControlnetModelChanged: (state, action: PayloadAction<ControlNetModelConfig | null>) => {
state.tileControlnetModel = action.payload;
},
@ -59,7 +54,6 @@ export const {
upscaleInitialImageChanged,
structureChanged,
creativityChanged,
sharpnessChanged,
tileControlnetModelChanged,
scaleChanged,
} = upscaleSlice.actions;

View File

@ -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(() => {
</Flex>
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
<Flex gap={4} pb={4} flexDir="column">
<ParamSharpness />
<ParamCreativity />
<ParamStructure />
</Flex>