mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): remove sharpness param
This commit is contained in:
parent
2e0cebb571
commit
8756a6b8c3
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -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);
|
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user