disable submodels that have incompatible base models

This commit is contained in:
Mary Hipp
2023-07-06 14:40:51 -04:00
committed by psychedelicious
parent 6356dc335f
commit b9a1aa38e3
7 changed files with 94 additions and 79 deletions

View File

@ -49,7 +49,7 @@ export interface GenerationState {
horizontalSymmetrySteps: number;
verticalSymmetrySteps: number;
model: ModelParam;
vae: ModelParam;
vae: VAEParam;
seamlessXAxis: boolean;
seamlessYAxis: boolean;
clipSkip: number;
@ -84,7 +84,7 @@ export const initialGenerationState: GenerationState = {
horizontalSymmetrySteps: 0,
verticalSymmetrySteps: 0,
model: null,
vae: null,
vae: '',
seamlessXAxis: false,
seamlessYAxis: false,
clipSkip: 0,
@ -224,8 +224,7 @@ export const generationSlice = createSlice({
state.model = { id: action.payload, base_model, name, type };
},
vaeSelected: (state, action: PayloadAction<string>) => {
const [base_model, type, name] = action.payload.split('/');
state.vae = { id: action.payload, base_model, name, type };
state.vae = action.payload;
},
setClipSkip: (state, action: PayloadAction<number>) => {
state.clipSkip = action.payload;

View File

@ -141,10 +141,15 @@ const zModel = z.object({
* Type alias for model parameter, inferred from its zod schema
*/
export type ModelParam = z.infer<typeof zModel> | null;
/**
* Zod schema for VAE parameter
* TODO: Make this a dynamically generated enum?
*/
export const zVAE = z.string();
/**
* Type alias for model parameter, inferred from its zod schema
*/
export type VAEParam = z.infer<typeof zModel> | null;
export type VAEParam = z.infer<typeof zVAE>;
/**
* Validates/type-guards a value as a model parameter
*/