From 809ec7163e7dd12c1d6b682a4c79e76f34cd3804 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 18 Jun 2023 19:41:30 +1200 Subject: [PATCH] fix: Remove type from Model type name --- .../system/store/models/sd1PipelineModelSlice.ts | 11 +++++------ .../system/store/models/sd2PipelineModelSlice.ts | 11 +++++------ invokeai/frontend/web/src/services/thunks/model.ts | 8 ++++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts b/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts index a59c29d87a..99f1514e6c 100644 --- a/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts @@ -7,18 +7,17 @@ import { import { receivedModels } from 'services/thunks/model'; -export type SD1PipelineModelType = ( +export type SD1PipelineModel = ( | StableDiffusion1ModelCheckpointConfig | StableDiffusion1ModelDiffusersConfig ) & { name: string; }; -export const sd1PipelineModelsAdapter = - createEntityAdapter({ - selectId: (model) => model.name, - sortComparer: (a, b) => a.name.localeCompare(b.name), - }); +export const sd1PipelineModelsAdapter = createEntityAdapter({ + selectId: (model) => model.name, + sortComparer: (a, b) => a.name.localeCompare(b.name), +}); export const sd1InitialPipelineModelsState = sd1PipelineModelsAdapter.getInitialState(); diff --git a/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts b/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts index 8e10767a7c..69ff772222 100644 --- a/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts @@ -7,18 +7,17 @@ import { import { receivedModels } from 'services/thunks/model'; -export type SD2PipelineModelType = ( +export type SD2PipelineModel = ( | StableDiffusion2ModelCheckpointConfig | StableDiffusion2ModelDiffusersConfig ) & { name: string; }; -export const sd2PipelineModelsAdapater = - createEntityAdapter({ - selectId: (model) => model.name, - sortComparer: (a, b) => a.name.localeCompare(b.name), - }); +export const sd2PipelineModelsAdapater = createEntityAdapter({ + selectId: (model) => model.name, + sortComparer: (a, b) => a.name.localeCompare(b.name), +}); export const sd2InitialPipelineModelsState = sd2PipelineModelsAdapater.getInitialState(); diff --git a/invokeai/frontend/web/src/services/thunks/model.ts b/invokeai/frontend/web/src/services/thunks/model.ts index 05766de7b3..619aa4b7b2 100644 --- a/invokeai/frontend/web/src/services/thunks/model.ts +++ b/invokeai/frontend/web/src/services/thunks/model.ts @@ -1,7 +1,7 @@ import { log } from 'app/logging/useLogger'; import { createAppAsyncThunk } from 'app/store/storeUtils'; -import { SD1PipelineModelType } from 'features/system/store/models/sd1PipelineModelSlice'; -import { SD2PipelineModelType } from 'features/system/store/models/sd2PipelineModelSlice'; +import { SD1PipelineModel } from 'features/system/store/models/sd1PipelineModelSlice'; +import { SD2PipelineModel } from 'features/system/store/models/sd2PipelineModelSlice'; import { reduce, size } from 'lodash-es'; import { BaseModelType, ModelType, ModelsService } from 'services/api'; @@ -31,7 +31,7 @@ export const receivedModels = createAppAsyncThunk( modelsAccumulator[modelName] = { ...model, name: modelName }; return modelsAccumulator; }, - {} as Record + {} as Record ); } @@ -42,7 +42,7 @@ export const receivedModels = createAppAsyncThunk( modelsAccumulator[modelName] = { ...model, name: modelName }; return modelsAccumulator; }, - {} as Record + {} as Record ); }