From 3189ab68635c7d7406e5959292e7764ea9108d09 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Thu, 8 Aug 2024 15:07:23 -0400 Subject: [PATCH] get dynamic prompts working --- .../listenerMiddleware/listeners/promptChanged.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptChanged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptChanged.ts index 4633eb45a5..74e4211255 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptChanged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptChanged.ts @@ -13,13 +13,16 @@ import { import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt'; import { utilitiesApi } from 'services/api/endpoints/utilities'; import { socketConnected } from 'services/events/actions'; +import { getPresetModifiedPrompts } from '../../../../../features/nodes/util/graph/graphBuilderUtils'; +import { activeStylePresetChanged } from '../../../../../features/stylePresets/store/stylePresetSlice'; const matcher = isAnyOf( positivePromptChanged, combinatorialToggled, maxPromptsChanged, maxPromptsReset, - socketConnected + socketConnected, + activeStylePresetChanged ); export const addDynamicPromptsListener = (startAppListening: AppStartListening) => { @@ -28,7 +31,7 @@ export const addDynamicPromptsListener = (startAppListening: AppStartListening) effect: async (action, { dispatch, getState, cancelActiveListeners, delay }) => { cancelActiveListeners(); const state = getState(); - const { positivePrompt } = state.controlLayers.present; + const { positivePrompt } = getPresetModifiedPrompts(state) const { maxPrompts } = state.dynamicPrompts; if (state.config.disabledFeatures.includes('dynamicPrompting')) {