remove tiledVAE option and make it true

This commit is contained in:
Mary Hipp 2024-07-22 16:13:17 -04:00 committed by psychedelicious
parent 582f384fff
commit 54eda9163c
5 changed files with 12 additions and 45 deletions

View File

@ -1647,7 +1647,6 @@
"outputImageSize": "Output Image Size",
"sharpness": "Sharpness",
"structure": "Structure",
"tiledVAE": "Tiled VAE",
"toInstall": "to install",
"upscaleModel": "Upcale Model",
"visit": "Visit",

View File

@ -38,8 +38,7 @@ export const getOutputImageSize = (initialImage: ImageDTO) => {
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, tiledVAE, tileControlnetModel } =
state.upscale;
const { upscaleModel, upscaleInitialImage, sharpness, structure, creativity, tileControlnetModel } = state.upscale;
assert(model, 'No model found in state');
assert(upscaleModel, 'No upscale model found in state');
@ -50,22 +49,23 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
const g = new Graph();
// const unsharpMaskNode1 = g.addNode({
// id: `${UNSHARP_MASK}_1`,
// type: 'unsharp_mask',
// image: upscaleInitialImage,
// radius: 2,
// strength: (sharpness + 10) * 3.75 + 25,
// });
const unsharpMaskNode1 = g.addNode({
id: `${UNSHARP_MASK}_1`,
type: 'unsharp_mask',
image: upscaleInitialImage,
radius: 2,
strength: (sharpness + 10) * 3.75 + 25,
});
const upscaleNode = g.addNode({
id: SPANDREL,
type: 'spandrel_image_to_image',
image_to_image_model: upscaleModel,
tile_size: 500,
image: upscaleInitialImage,
});
g.addEdge(unsharpMaskNode1, 'image', upscaleNode, 'image');
const unsharpMaskNode2 = g.addNode({
id: `${UNSHARP_MASK}_2`,
type: 'unsharp_mask',
@ -98,7 +98,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
id: IMAGE_TO_LATENTS,
type: 'i2l',
fp32: vaePrecision === 'fp32',
tiled: tiledVAE,
tiled: true,
});
g.addEdge(resizeNode, 'image', i2lNode, 'image');
@ -107,7 +107,7 @@ export const buildMultidiffusionUpscsaleGraph = async (state: RootState): Promis
type: 'l2i',
id: LATENTS_TO_IMAGE,
fp32: vaePrecision === 'fp32',
tiled: tiledVAE,
tiled: true,
board: getBoardField(state),
is_intermediate: false,
});

View File

@ -1,24 +0,0 @@
import { FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { tiledVAEChanged } from 'features/parameters/store/upscaleSlice';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
export const ParamTiledVAEToggle = () => {
const { t } = useTranslation();
const tiledVAE = useAppSelector((s) => s.upscale.tiledVAE);
const dispatch = useAppDispatch();
const handleChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
dispatch(tiledVAEChanged(event.target.checked));
},
[dispatch]
);
return (
<FormControl>
<Switch isChecked={tiledVAE} onChange={handleChange} />
<FormLabel>{t('upscaling.tiledVAE')}</FormLabel>
</FormControl>
);
};

View File

@ -11,7 +11,6 @@ interface UpscaleState {
sharpness: number;
structure: number;
creativity: number;
tiledVAE: boolean;
tileControlnetModel: ControlNetModelConfig | null;
}
@ -22,7 +21,6 @@ const initialUpscaleState: UpscaleState = {
sharpness: 0,
structure: 0,
creativity: 0,
tiledVAE: false,
tileControlnetModel: null,
};
@ -36,9 +34,6 @@ export const upscaleSlice = createSlice({
upscaleInitialImageChanged: (state, action: PayloadAction<ImageDTO | null>) => {
state.upscaleInitialImage = action.payload;
},
tiledVAEChanged: (state, action: PayloadAction<boolean>) => {
state.tiledVAE = action.payload;
},
structureChanged: (state, action: PayloadAction<number>) => {
state.structure = action.payload;
},
@ -57,7 +52,6 @@ export const upscaleSlice = createSlice({
export const {
upscaleModelChanged,
upscaleInitialImageChanged,
tiledVAEChanged,
structureChanged,
creativityChanged,
sharpnessChanged,

View File

@ -5,7 +5,6 @@ import ParamCreativity from 'features/parameters/components/Upscale/ParamCreativ
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 { ParamTiledVAEToggle } from 'features/parameters/components/Upscale/ParamTiledVAEToggle';
import { selectUpscalelice } from 'features/parameters/store/upscaleSlice';
import { useExpanderToggle } from 'features/settingsAccordions/hooks/useExpanderToggle';
import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle';
@ -55,7 +54,6 @@ export const UpscaleSettingsAccordion = memo(() => {
<ParamSharpness />
<ParamCreativity />
<ParamStructure />
<ParamTiledVAEToggle />
</Flex>
</Expander>
</Flex>