From 820ec08e9ac25f9006666354ad1248db0acbb336 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 16 Sep 2023 13:11:11 +1200 Subject: [PATCH] feat: Update Control Adapter Collapse active status to reflect IP Adapter --- .../ControlNet/ParamControlNetCollapse.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse.tsx index 22177734ad..2c40307ee3 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse.tsx @@ -26,14 +26,23 @@ import { v4 as uuidv4 } from 'uuid'; const selector = createSelector( [stateSelector], ({ controlNet }) => { - const { controlNets, isEnabled } = controlNet; + const { controlNets, isEnabled, isIPAdapterEnabled } = controlNet; const validControlNets = getValidControlNets(controlNets); - const activeLabel = - isEnabled && validControlNets.length > 0 - ? `${validControlNets.length} Active` - : undefined; + let activeLabel = undefined; + + if (isEnabled && validControlNets.length > 0) { + activeLabel = `${validControlNets.length} ControlNet`; + } + + if (isIPAdapterEnabled) { + if (activeLabel) { + activeLabel = `${activeLabel}, IP Adapter`; + } else { + activeLabel = 'IP Adapter'; + } + } return { controlNetsArray: map(controlNets), activeLabel }; },