From ff3067476ee39cb35784efc37c53b17dd9197c9f Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 4 Mar 2024 12:10:58 -0500 Subject: [PATCH] check if lora is enabled before adding trigger phrases --- .../listeners/promptTriggerListChanged.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptTriggerListChanged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptTriggerListChanged.ts index 2654dec9fb..68f0628f16 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptTriggerListChanged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptTriggerListChanged.ts @@ -1,10 +1,10 @@ import { isAnyOf } from '@reduxjs/toolkit'; import type { AppStartListening } from 'app/store/middleware/listenerMiddleware'; -import { loraAdded, loraRemoved } from 'features/lora/store/loraSlice'; +import { loraAdded, loraIsEnabledChanged, loraRecalled, loraRemoved } from 'features/lora/store/loraSlice'; import { modelChanged, triggerPhrasesChanged } from 'features/parameters/store/generationSlice'; import { modelsApi } from 'services/api/endpoints/models'; -const matcher = isAnyOf(loraAdded, loraRemoved, modelChanged); +const matcher = isAnyOf(loraAdded, loraRemoved, loraRecalled, loraIsEnabledChanged, modelChanged); export const addPromptTriggerListChanged = (startAppListening: AppStartListening) => { startAppListening({ @@ -27,7 +27,7 @@ export const addPromptTriggerListChanged = (startAppListening: AppStartListening for (let index = 0; index < Object.values(loras).length; index++) { const lora = Object.values(loras)[index]; - if (lora) { + if (lora && lora.isEnabled) { const { data: loraData } = await dispatch(modelsApi.endpoints.getModelMetadata.initiate(lora.model.key)); triggerPhrases = [...triggerPhrases, ...(loraData?.trigger_phrases || [])]; }