From fe8e391aad5c12b202a619b92edda6d41205c7a8 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:55:49 +1100 Subject: [PATCH] fix(ui): display trigger phrases for loras in mm editor --- .../subpanels/ModelPanel/Metadata/TriggerPhrases.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Metadata/TriggerPhrases.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Metadata/TriggerPhrases.tsx index a03eabd46b..18db564faf 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Metadata/TriggerPhrases.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/Metadata/TriggerPhrases.tsx @@ -16,12 +16,12 @@ import { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { PiPlusBold } from 'react-icons/pi'; import { useGetModelConfigQuery, useUpdateModelMutation } from 'services/api/endpoints/models'; -import { isNonRefinerMainModelConfig } from 'services/api/types'; +import { isLoRAModelConfig, isNonRefinerMainModelConfig } from 'services/api/types'; export const TriggerPhrases = () => { const { t } = useTranslation(); const selectedModelKey = useAppSelector((s) => s.modelmanagerV2.selectedModelKey); - const { data: modelConfig } = useGetModelConfigQuery(selectedModelKey ?? skipToken); + const { currentData: modelConfig } = useGetModelConfigQuery(selectedModelKey ?? skipToken); const [phrase, setPhrase] = useState(''); const [updateModel, { isLoading }] = useUpdateModelMutation(); @@ -31,7 +31,7 @@ export const TriggerPhrases = () => { }, []); const triggerPhrases = useMemo(() => { - if (!modelConfig || !isNonRefinerMainModelConfig(modelConfig)) { + if (!modelConfig || (!isNonRefinerMainModelConfig(modelConfig) && !isLoRAModelConfig(modelConfig))) { return []; } return modelConfig?.trigger_phrases || [];