diff --git a/invokeai/frontend/web/src/app/types/invokeai.ts b/invokeai/frontend/web/src/app/types/invokeai.ts index be642a6435..b38790e0c9 100644 --- a/invokeai/frontend/web/src/app/types/invokeai.ts +++ b/invokeai/frontend/web/src/app/types/invokeai.ts @@ -95,7 +95,8 @@ export type AppFeature = | 'localization' | 'consoleLogging' | 'dynamicPrompting' - | 'batches'; + | 'batches' + | 'syncModels'; /** * A disable-able Stable Diffusion feature diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx index b578298149..625ce0d5ca 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx @@ -16,6 +16,7 @@ import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useGetMainModelsQuery } from 'services/api/endpoints/models'; import { FieldComponentProps } from './types'; +import { useFeatureStatus } from '../../../system/hooks/useFeatureStatus'; const ModelInputFieldComponent = ( props: FieldComponentProps @@ -24,6 +25,7 @@ const ModelInputFieldComponent = ( const dispatch = useAppDispatch(); const { t } = useTranslation(); + const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled; const { data: mainModels, isLoading } = useGetMainModelsQuery(); @@ -103,9 +105,11 @@ const ModelInputFieldComponent = ( disabled={data.length === 0} onChange={handleChangeModel} /> - - - + {isSyncModelEnabled && ( + + + + )} ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/MainModel/ParamMainModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/MainModel/ParamMainModelSelect.tsx index 75f1bc8bd9..a98d100467 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/MainModel/ParamMainModelSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/MainModel/ParamMainModelSelect.tsx @@ -15,6 +15,7 @@ import { modelIdToMainModelParam } from 'features/parameters/util/modelIdToMainM import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton'; import { forEach } from 'lodash-es'; import { useGetMainModelsQuery } from 'services/api/endpoints/models'; +import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus'; const selector = createSelector( stateSelector, @@ -29,6 +30,7 @@ const ParamMainModelSelect = () => { const { model } = useAppSelector(selector); const { data: mainModels, isLoading } = useGetMainModelsQuery(); + const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled; const data = useMemo(() => { if (!mainModels) { @@ -98,9 +100,11 @@ const ParamMainModelSelect = () => { onChange={handleChangeModel} w="100%" /> - - - + {isSyncModelEnabled && ( + + + + )} ); };