mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add defaultModel
to config
This commit is contained in:
parent
9687fe7bac
commit
e1ae7842ff
@ -351,6 +351,7 @@ export type AppConfig = {
|
||||
disabledSDFeatures: SDFeature[];
|
||||
canRestoreDeletedImagesFromBin: boolean;
|
||||
sd: {
|
||||
defaultModel?: string;
|
||||
iterations: {
|
||||
initial: number;
|
||||
min: number;
|
||||
|
@ -2,11 +2,12 @@ import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import * as InvokeAI from 'app/types/invokeai';
|
||||
import promptToString from 'common/util/promptToString';
|
||||
import { clamp, sample, sortBy } from 'lodash-es';
|
||||
import { clamp, sortBy } from 'lodash-es';
|
||||
import { setAllParametersReducer } from './setAllParametersReducer';
|
||||
import { receivedModels } from 'services/thunks/model';
|
||||
import { Scheduler } from 'app/constants';
|
||||
import { ImageDTO } from 'services/api';
|
||||
import { configChanged } from 'features/system/store/configSlice';
|
||||
|
||||
export interface GenerationState {
|
||||
cfgScale: number;
|
||||
@ -231,6 +232,13 @@ export const generationSlice = createSlice({
|
||||
state.model = firstModel.name;
|
||||
}
|
||||
});
|
||||
|
||||
builder.addCase(configChanged, (state, action) => {
|
||||
const defaultModel = action.payload.sd?.defaultModel;
|
||||
if (defaultModel && !state.model) {
|
||||
state.model = defaultModel;
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user