From eaca9409560715e432a36138634af56063fdd261 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 20 Jun 2024 21:35:48 +1000 Subject: [PATCH] fix(ui): models loaded handler --- .../listenerMiddleware/listeners/modelSelected.ts | 2 +- .../middleware/listenerMiddleware/listeners/modelsLoaded.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts index 38260b23a2..aa0e9a3d61 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts @@ -45,7 +45,7 @@ export const addModelSelectedListener = (startAppListening: AppStartListening) = } // handle incompatible controlnets - state.canvasV2.controlAdapters.forEach((ca) => { + state.canvasV2.controlAdapters.entities.forEach((ca) => { if (ca.model?.base !== newBaseModel) { modelsCleared += 1; if (ca.isEnabled) { diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts index 47555a0ef1..a94b0b45e3 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelsLoaded.ts @@ -172,7 +172,7 @@ const handleLoRAModels: ModelHandler = (models, state, dispatch, _log) => { const handleControlAdapterModels: ModelHandler = (models, state, dispatch, _log) => { const caModels = models.filter(isControlNetOrT2IAdapterModelConfig); - state.canvasV2.controlAdapters.forEach((ca) => { + state.canvasV2.controlAdapters.entities.forEach((ca) => { const isModelAvailable = caModels.some((m) => m.key === ca.model?.key); if (isModelAvailable) { return; @@ -183,7 +183,7 @@ const handleControlAdapterModels: ModelHandler = (models, state, dispatch, _log) const handleIPAdapterModels: ModelHandler = (models, state, dispatch, _log) => { const ipaModels = models.filter(isIPAdapterModelConfig); - state.canvasV2.controlAdapters.forEach(({ id, model }) => { + state.canvasV2.ipAdapters.entities.forEach(({ id, model }) => { const isModelAvailable = ipaModels.some((m) => m.key === model?.key); if (isModelAvailable) { return; @@ -191,7 +191,7 @@ const handleIPAdapterModels: ModelHandler = (models, state, dispatch, _log) => { dispatch(ipaModelChanged({ id, modelConfig: null })); }); - state.canvasV2.regions.forEach(({ id, ipAdapters }) => { + state.canvasV2.regions.entities.forEach(({ id, ipAdapters }) => { ipAdapters.forEach(({ id: ipAdapterId, model }) => { const isModelAvailable = ipaModels.some((m) => m.key === model?.key); if (isModelAvailable) {