Fix frontend typescript errors.

This commit is contained in:
Ryan Dick 2023-09-14 16:43:43 -04:00
parent fca60862e2
commit e02a557454
3 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import { components } from 'services/api/schema';
export const MODEL_TYPE_MAP = {
any: 'Any',
'sd-1': 'Stable Diffusion 1.x',
'sd-2': 'Stable Diffusion 2.x',
sdxl: 'Stable Diffusion XL',
@ -8,6 +9,7 @@ export const MODEL_TYPE_MAP = {
};
export const MODEL_TYPE_SHORT_MAP = {
any: 'Any',
'sd-1': 'SD1',
'sd-2': 'SD2',
sdxl: 'SDXL',
@ -15,6 +17,10 @@ export const MODEL_TYPE_SHORT_MAP = {
};
export const clipSkipMap = {
any: {
maxClip: 0,
markers: [],
},
'sd-1': {
maxClip: 12,
markers: [0, 1, 2, 3, 4, 8, 12],

View File

@ -210,7 +210,13 @@ export type HeightParam = z.infer<typeof zHeight>;
export const isValidHeight = (val: unknown): val is HeightParam =>
zHeight.safeParse(val).success;
export const zBaseModel = z.enum(['sd-1', 'sd-2', 'sdxl', 'sdxl-refiner']);
export const zBaseModel = z.enum([
'any',
'sd-1',
'sd-2',
'sdxl',
'sdxl-refiner',
]);
export type BaseModelParam = z.infer<typeof zBaseModel>;

View File

@ -74,9 +74,8 @@ export type ControlNetModelDiffusersConfig =
export type ControlNetModelConfig =
| ControlNetModelCheckpointConfig
| ControlNetModelDiffusersConfig;
export type IPAdapterModelCheckpointConfig =
s['IPAdapterModelCheckpointConfig'];
export type IPAdapterModelConfig = IPAdapterModelCheckpointConfig;
export type IPAdapterModelInvokeAIConfig = s['IPAdapterModelInvokeAIConfig'];
export type IPAdapterModelConfig = IPAdapterModelInvokeAIConfig;
export type TextualInversionModelConfig = s['TextualInversionModelConfig'];
export type DiffusersModelConfig =
| s['StableDiffusion1ModelDiffusersConfig']