feat(ui): add vaePrecision setting

no UI element for it yet
This commit is contained in:
psychedelicious 2023-07-26 00:15:24 +10:00
parent 00e69d5d12
commit 016797c890
3 changed files with 11 additions and 0 deletions

View File

@ -43,6 +43,7 @@ export const buildLinearSDXLImageToImageGraph = (
clipSkip, clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
shouldUseNoiseSettings, shouldUseNoiseSettings,
vaePrecision,
} = state.generation; } = state.generation;
const { const {
@ -114,6 +115,7 @@ export const buildLinearSDXLImageToImageGraph = (
[LATENTS_TO_IMAGE]: { [LATENTS_TO_IMAGE]: {
type: 'l2i', type: 'l2i',
id: LATENTS_TO_IMAGE, id: LATENTS_TO_IMAGE,
fp32: vaePrecision === 'fp32' ? true : false,
}, },
[SDXL_LATENTS_TO_LATENTS]: { [SDXL_LATENTS_TO_LATENTS]: {
type: 'l2l_sdxl', type: 'l2l_sdxl',
@ -130,6 +132,7 @@ export const buildLinearSDXLImageToImageGraph = (
// image: { // image: {
// image_name: initialImage.image_name, // image_name: initialImage.image_name,
// }, // },
fp32: vaePrecision === 'fp32' ? true : false,
}, },
}, },
edges: [ edges: [

View File

@ -31,6 +31,7 @@ export const buildLinearSDXLTextToImageGraph = (
clipSkip, clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
shouldUseNoiseSettings, shouldUseNoiseSettings,
vaePrecision,
} = state.generation; } = state.generation;
const { const {
@ -97,6 +98,7 @@ export const buildLinearSDXLTextToImageGraph = (
[LATENTS_TO_IMAGE]: { [LATENTS_TO_IMAGE]: {
type: 'l2i', type: 'l2i',
id: LATENTS_TO_IMAGE, id: LATENTS_TO_IMAGE,
fp32: vaePrecision === 'fp32' ? true : false,
}, },
}, },
edges: [ edges: [

View File

@ -51,6 +51,7 @@ export interface GenerationState {
verticalSymmetrySteps: number; verticalSymmetrySteps: number;
model: MainModelField | null; model: MainModelField | null;
vae: VaeModelParam | null; vae: VaeModelParam | null;
vaePrecision: 'fp16' | 'fp32';
seamlessXAxis: boolean; seamlessXAxis: boolean;
seamlessYAxis: boolean; seamlessYAxis: boolean;
clipSkip: number; clipSkip: number;
@ -89,6 +90,7 @@ export const initialGenerationState: GenerationState = {
verticalSymmetrySteps: 0, verticalSymmetrySteps: 0,
model: null, model: null,
vae: null, vae: null,
vaePrecision: 'fp32',
seamlessXAxis: false, seamlessXAxis: false,
seamlessYAxis: false, seamlessYAxis: false,
clipSkip: 0, clipSkip: 0,
@ -241,6 +243,9 @@ export const generationSlice = createSlice({
// null is a valid VAE! // null is a valid VAE!
state.vae = action.payload; state.vae = action.payload;
}, },
vaePrecisionChanged: (state, action: PayloadAction<'fp16' | 'fp32'>) => {
state.vaePrecision = action.payload;
},
setClipSkip: (state, action: PayloadAction<number>) => { setClipSkip: (state, action: PayloadAction<number>) => {
state.clipSkip = action.payload; state.clipSkip = action.payload;
}, },
@ -327,6 +332,7 @@ export const {
shouldUseCpuNoiseChanged, shouldUseCpuNoiseChanged,
setShouldShowAdvancedOptions, setShouldShowAdvancedOptions,
setAspectRatio, setAspectRatio,
vaePrecisionChanged,
} = generationSlice.actions; } = generationSlice.actions;
export default generationSlice.reducer; export default generationSlice.reducer;