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> => {
|
export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promise<GraphType> => {
|
||||||
const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.generation;
|
const { model, cfgScale: cfg_scale, scheduler, steps, vaePrecision, seed, vae } = state.generation;
|
||||||
const { positivePrompt, negativePrompt } = state.controlLayers.present;
|
const { positivePrompt, negativePrompt } = state.controlLayers.present;
|
||||||
const { upscaleModel, upscaleInitialImage, sharpness, structure, creativity, tileControlnetModel, scale } =
|
const { upscaleModel, upscaleInitialImage, structure, creativity, tileControlnetModel, scale } = state.upscale;
|
||||||
state.upscale;
|
|
||||||
|
|
||||||
assert(model, 'No model found in state');
|
assert(model, 'No model found in state');
|
||||||
assert(upscaleModel, 'No upscale 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`,
|
id: `${UNSHARP_MASK}_2`,
|
||||||
type: 'unsharp_mask',
|
type: 'unsharp_mask',
|
||||||
radius: 2,
|
radius: 2,
|
||||||
strength: (sharpness + 10) * 3.75 + 25,
|
strength: 60,
|
||||||
});
|
});
|
||||||
|
|
||||||
g.addEdge(upscaleNode, 'image', unsharpMaskNode2, 'image');
|
g.addEdge(upscaleNode, 'image', unsharpMaskNode2, 'image');
|
||||||
@ -181,7 +180,6 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
|
|||||||
vae: vae ?? undefined,
|
vae: vae ?? undefined,
|
||||||
upscale_model: Graph.getModelMetadataField(upscaleModelConfig),
|
upscale_model: Graph.getModelMetadataField(upscaleModelConfig),
|
||||||
creativity,
|
creativity,
|
||||||
sharpness,
|
|
||||||
structure,
|
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;
|
_version: 1;
|
||||||
upscaleModel: ParameterSpandrelImageToImageModel | null;
|
upscaleModel: ParameterSpandrelImageToImageModel | null;
|
||||||
upscaleInitialImage: ImageDTO | null;
|
upscaleInitialImage: ImageDTO | null;
|
||||||
sharpness: number;
|
|
||||||
structure: number;
|
structure: number;
|
||||||
creativity: number;
|
creativity: number;
|
||||||
tileControlnetModel: ControlNetModelConfig | null;
|
tileControlnetModel: ControlNetModelConfig | null;
|
||||||
@ -19,7 +18,6 @@ const initialUpscaleState: UpscaleState = {
|
|||||||
_version: 1,
|
_version: 1,
|
||||||
upscaleModel: null,
|
upscaleModel: null,
|
||||||
upscaleInitialImage: null,
|
upscaleInitialImage: null,
|
||||||
sharpness: 0,
|
|
||||||
structure: 0,
|
structure: 0,
|
||||||
creativity: 0,
|
creativity: 0,
|
||||||
tileControlnetModel: null,
|
tileControlnetModel: null,
|
||||||
@ -42,9 +40,6 @@ export const upscaleSlice = createSlice({
|
|||||||
creativityChanged: (state, action: PayloadAction<number>) => {
|
creativityChanged: (state, action: PayloadAction<number>) => {
|
||||||
state.creativity = action.payload;
|
state.creativity = action.payload;
|
||||||
},
|
},
|
||||||
sharpnessChanged: (state, action: PayloadAction<number>) => {
|
|
||||||
state.sharpness = action.payload;
|
|
||||||
},
|
|
||||||
tileControlnetModelChanged: (state, action: PayloadAction<ControlNetModelConfig | null>) => {
|
tileControlnetModelChanged: (state, action: PayloadAction<ControlNetModelConfig | null>) => {
|
||||||
state.tileControlnetModel = action.payload;
|
state.tileControlnetModel = action.payload;
|
||||||
},
|
},
|
||||||
@ -59,7 +54,6 @@ export const {
|
|||||||
upscaleInitialImageChanged,
|
upscaleInitialImageChanged,
|
||||||
structureChanged,
|
structureChanged,
|
||||||
creativityChanged,
|
creativityChanged,
|
||||||
sharpnessChanged,
|
|
||||||
tileControlnetModelChanged,
|
tileControlnetModelChanged,
|
||||||
scaleChanged,
|
scaleChanged,
|
||||||
} = upscaleSlice.actions;
|
} = upscaleSlice.actions;
|
||||||
|
@ -2,7 +2,6 @@ import { Expander, Flex, StandaloneAccordion } from '@invoke-ai/ui-library';
|
|||||||
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
|
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import ParamCreativity from 'features/parameters/components/Upscale/ParamCreativity';
|
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 ParamSpandrelModel from 'features/parameters/components/Upscale/ParamSpandrelModel';
|
||||||
import ParamStructure from 'features/parameters/components/Upscale/ParamStructure';
|
import ParamStructure from 'features/parameters/components/Upscale/ParamStructure';
|
||||||
import { selectUpscalelice } from 'features/parameters/store/upscaleSlice';
|
import { selectUpscalelice } from 'features/parameters/store/upscaleSlice';
|
||||||
@ -61,7 +60,6 @@ export const UpscaleSettingsAccordion = memo(() => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
|
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
|
||||||
<Flex gap={4} pb={4} flexDir="column">
|
<Flex gap={4} pb={4} flexDir="column">
|
||||||
<ParamSharpness />
|
|
||||||
<ParamCreativity />
|
<ParamCreativity />
|
||||||
<ParamStructure />
|
<ParamStructure />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user