From 58064a1ea5dba5f87ec00e71d5feecce01d3cd52 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:41:41 +1000 Subject: [PATCH] feat(ui): use default IP adapter when creating IP adapter --- .../EntityListActionBarAddLayerMenuItems.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/components/CanvasEntityList/EntityListActionBarAddLayerMenuItems.tsx b/invokeai/frontend/web/src/features/controlLayers/components/CanvasEntityList/EntityListActionBarAddLayerMenuItems.tsx index 492b28cbdd..e48b2b30b2 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/CanvasEntityList/EntityListActionBarAddLayerMenuItems.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/CanvasEntityList/EntityListActionBarAddLayerMenuItems.tsx @@ -1,5 +1,6 @@ import { MenuItem } from '@invoke-ai/ui-library'; import { useAppDispatch } from 'app/store/storeHooks'; +import { useDefaultIPAdapter } from 'features/controlLayers/hooks/useLayerControlAdapter'; import { controlLayerAdded, inpaintMaskAdded, @@ -14,6 +15,7 @@ import { PiPlusBold } from 'react-icons/pi'; export const CanvasEntityListMenuItems = memo(() => { const { t } = useTranslation(); const dispatch = useAppDispatch(); + const defaultIPAdapter = useDefaultIPAdapter(); const addInpaintMask = useCallback(() => { dispatch(inpaintMaskAdded({ isSelected: true })); }, [dispatch]); @@ -27,8 +29,9 @@ export const CanvasEntityListMenuItems = memo(() => { dispatch(controlLayerAdded({ isSelected: true })); }, [dispatch]); const addIPAdapter = useCallback(() => { - dispatch(ipaAdded({ isSelected: true })); - }, [dispatch]); + const overrides = { ipAdapter: defaultIPAdapter }; + dispatch(ipaAdded({ isSelected: true, overrides })); + }, [defaultIPAdapter, dispatch]); return ( <>