feat: Enable 2.x Model Generation in Linear UI

This commit is contained in:
blessedcoolant
2023-06-18 08:27:13 +12:00
committed by psychedelicious
parent 727293d722
commit 4847212d5b
2 changed files with 29 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { Scheduler } from 'app/constants';
import { ModelLoaderTypes } from 'features/system/components/ModelSelect';
import { configChanged } from 'features/system/store/configSlice';
import { clamp, sortBy } from 'lodash-es';
import { ImageDTO } from 'services/api';
@ -49,6 +50,7 @@ export interface GenerationState {
horizontalSymmetrySteps: number;
verticalSymmetrySteps: number;
model: ModelParam;
currentModelType: ModelLoaderTypes;
shouldUseSeamless: boolean;
seamlessXAxis: boolean;
seamlessYAxis: boolean;
@ -83,6 +85,7 @@ export const initialGenerationState: GenerationState = {
horizontalSymmetrySteps: 0,
verticalSymmetrySteps: 0,
model: '',
currentModelType: 'sd1_model_loader',
shouldUseSeamless: false,
seamlessXAxis: true,
seamlessYAxis: true,
@ -218,6 +221,9 @@ export const generationSlice = createSlice({
modelSelected: (state, action: PayloadAction<string>) => {
state.model = action.payload;
},
setCurrentModelType: (state, action: PayloadAction<ModelLoaderTypes>) => {
state.currentModelType = action.payload;
},
},
extraReducers: (builder) => {
builder.addCase(getModels.fulfilled, (state, action) => {
@ -278,6 +284,7 @@ export const {
setVerticalSymmetrySteps,
initialImageChanged,
modelSelected,
setCurrentModelType,
setShouldUseNoiseSettings,
setSeamless,
setSeamlessXAxis,