Add model_type to the model state object

This commit is contained in:
Brandon Rising
2023-07-18 22:40:27 -04:00
parent e201ad2f51
commit 487455ef2e
8 changed files with 37 additions and 4 deletions

View File

@ -260,6 +260,7 @@ export const generationSlice = createSlice({
id: defaultModel,
name: model_name,
base_model,
model_type,
});
}
});

View File

@ -127,6 +127,14 @@ export const isValidHeight = (val: unknown): val is HeightParam =>
zHeight.safeParse(val).success;
const zBaseModel = z.enum(['sd-1', 'sd-2']);
const zModelType = z.enum([
'vae',
'lora',
'onnx',
'main',
'controlnet',
'embedding',
]);
export type BaseModelParam = z.infer<typeof zBaseModel>;
@ -137,6 +145,7 @@ export type BaseModelParam = z.infer<typeof zBaseModel>;
export const zMainModel = z.object({
model_name: z.string(),
base_model: zBaseModel,
model_type: zModelType,
});
/**