From 9634c96020d5cec451d0d71fed87c8c7b1dfbd18 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 18 Jun 2023 19:35:46 +1200 Subject: [PATCH] revert: getModels to receivedModels --- .../listeners/socketio/socketConnected.ts | 6 +++--- .../web/src/features/parameters/store/generationSlice.ts | 4 ++-- .../features/system/store/models/sd1PipelineModelSlice.ts | 4 ++-- .../features/system/store/models/sd2PipelineModelSlice.ts | 4 ++-- .../frontend/web/src/features/system/store/systemSlice.ts | 4 ++-- invokeai/frontend/web/src/services/thunks/model.ts | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts index 14263b643b..d65f8e8ba6 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts @@ -1,7 +1,7 @@ import { log } from 'app/logging/useLogger'; import { appSocketConnected, socketConnected } from 'services/events/actions'; import { receivedPageOfImages } from 'services/thunks/image'; -import { getModels } from 'services/thunks/model'; +import { receivedModels } from 'services/thunks/model'; import { receivedOpenAPISchema } from 'services/thunks/schema'; import { startAppListening } from '../..'; @@ -25,11 +25,11 @@ export const addSocketConnectedEventListener = () => { } if (!sd1pipelinemodels.ids.length) { - dispatch(getModels({ baseModel: 'sd-1', modelType: 'pipeline' })); + dispatch(receivedModels({ baseModel: 'sd-1', modelType: 'pipeline' })); } if (!sd2pipelinemodels.ids.length) { - dispatch(getModels({ baseModel: 'sd-2', modelType: 'pipeline' })); + dispatch(receivedModels({ baseModel: 'sd-2', modelType: 'pipeline' })); } if (!nodes.schema && !disabledTabs.includes('nodes')) { diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts index 0916fc84c6..23103d11f6 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -5,7 +5,7 @@ import { configChanged } from 'features/system/store/configSlice'; import { clamp, sortBy } from 'lodash-es'; import { ImageDTO } from 'services/api'; import { imageUrlsReceived } from 'services/thunks/image'; -import { getModels } from 'services/thunks/model'; +import { receivedModels } from 'services/thunks/model'; import { CfgScaleParam, HeightParam, @@ -224,7 +224,7 @@ export const generationSlice = createSlice({ }, }, extraReducers: (builder) => { - builder.addCase(getModels.fulfilled, (state, action) => { + builder.addCase(receivedModels.fulfilled, (state, action) => { if (!state.model) { const firstModel = sortBy(action.payload, 'name')[0]; state.model = firstModel.name; 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 5755b14886..8c8fbbd4f2 100644 --- a/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/models/sd1PipelineModelSlice.ts @@ -5,7 +5,7 @@ import { StableDiffusion1ModelDiffusersConfig, } from 'services/api'; -import { getModels } from 'services/thunks/model'; +import { receivedModels } from 'services/thunks/model'; export type SD1PipelineModelType = ( | StableDiffusion1ModelCheckpointConfig @@ -35,7 +35,7 @@ export const sd1PipelineModelsSlice = createSlice({ /** * Received Models - FULFILLED */ - builder.addCase(getModels.fulfilled, (state, action) => { + builder.addCase(receivedModels.fulfilled, (state, action) => { if (action.meta.arg.baseModel !== 'sd-1') return; sd1PipelineModelsAdapter.setAll(state, action.payload); }); 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 0c307e23cc..fb94fae9d0 100644 --- a/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/models/sd2PipelineModelSlice.ts @@ -5,7 +5,7 @@ import { StableDiffusion2ModelDiffusersConfig, } from 'services/api'; -import { getModels } from 'services/thunks/model'; +import { receivedModels } from 'services/thunks/model'; export type SD2PipelineModelType = ( | StableDiffusion2ModelCheckpointConfig @@ -35,7 +35,7 @@ export const sd2PipelineModelsSlice = createSlice({ /** * Received Models - FULFILLED */ - builder.addCase(getModels.fulfilled, (state, action) => { + builder.addCase(receivedModels.fulfilled, (state, action) => { if (action.meta.arg.baseModel !== 'sd-2') return; sd2PipelineModelsAdapater.setAll(state, action.payload); }); diff --git a/invokeai/frontend/web/src/features/system/store/systemSlice.ts b/invokeai/frontend/web/src/features/system/store/systemSlice.ts index 7085099c31..c1fdc750de 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSlice.ts @@ -20,7 +20,7 @@ import { } from 'services/events/actions'; import { ProgressImage } from 'services/events/types'; import { imageUploaded } from 'services/thunks/image'; -import { getModels } from 'services/thunks/model'; +import { receivedModels } from 'services/thunks/model'; import { isAnySessionRejected, sessionCanceled } from 'services/thunks/session'; import { makeToast } from '../../../app/components/Toaster'; import { LANGUAGES } from '../components/LanguagePicker'; @@ -377,7 +377,7 @@ export const systemSlice = createSlice({ /** * Received available models from the backend */ - builder.addCase(getModels.fulfilled, (state) => { + builder.addCase(receivedModels.fulfilled, (state) => { state.wereModelsReceived = true; }); diff --git a/invokeai/frontend/web/src/services/thunks/model.ts b/invokeai/frontend/web/src/services/thunks/model.ts index 039748fa3f..05766de7b3 100644 --- a/invokeai/frontend/web/src/services/thunks/model.ts +++ b/invokeai/frontend/web/src/services/thunks/model.ts @@ -9,14 +9,14 @@ const models = log.child({ namespace: 'model' }); export const IMAGES_PER_PAGE = 20; -type getModelsArg = { +type receivedModelsArg = { baseModel: BaseModelType | undefined; modelType: ModelType | undefined; }; -export const getModels = createAppAsyncThunk( - 'models/getModels', - async (arg: getModelsArg) => { +export const receivedModels = createAppAsyncThunk( + 'models/receivedModels', + async (arg: receivedModelsArg) => { const response = await ModelsService.listModels(arg); let deserializedModels = {};