From 66d96907ebb5303eb6db588f9dca6e4a8f767a61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 04:46:23 +0000 Subject: [PATCH 1/2] Initial plan From 25a7640be3ef6b96e55c1ebd8bf53e7a7a6cec3e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 04:53:37 +0000 Subject: [PATCH 2/2] Hide use cache checkbox for non-admin users in multiuser mode Co-authored-by: lstein <111189+lstein@users.noreply.github.com> --- .../nodes/Invocation/UseCacheCheckbox.tsx | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx index a22bbfcc047..219418f36c4 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx @@ -1,15 +1,29 @@ import { Checkbox, FormControl, FormLabel } from '@invoke-ai/ui-library'; -import { useAppDispatch } from 'app/store/storeHooks'; +import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; +import { selectCurrentUser } from 'features/auth/store/authSlice'; import { useUseCache } from 'features/nodes/hooks/useUseCache'; import { nodeUseCacheChanged } from 'features/nodes/store/nodesSlice'; import { NO_FIT_ON_DOUBLE_CLICK_CLASS, NO_PAN_CLASS } from 'features/nodes/types/constants'; import type { ChangeEvent } from 'react'; -import { memo, useCallback } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; +import { useGetSetupStatusQuery } from 'services/api/endpoints/auth'; const UseCacheCheckbox = ({ nodeId }: { nodeId: string }) => { const dispatch = useAppDispatch(); const useCache = useUseCache(); + const currentUser = useAppSelector(selectCurrentUser); + const { data: setupStatus } = useGetSetupStatusQuery(); + + const isVisible = useMemo(() => { + // In single-user mode (multiuser disabled), always show the checkbox + if (setupStatus && !setupStatus.multiuser_enabled) { + return true; + } + // In multiuser mode, only show the checkbox to admin users + return currentUser?.is_admin ?? false; + }, [setupStatus, currentUser]); + const handleChange = useCallback( (e: ChangeEvent) => { dispatch( @@ -22,6 +36,11 @@ const UseCacheCheckbox = ({ nodeId }: { nodeId: string }) => { [dispatch, nodeId] ); const { t } = useTranslation(); + + if (!isVisible) { + return null; + } + return ( {t('invocationCache.useCache')}