mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add option to disable model syncing in UI
This commit is contained in:
committed by
psychedelicious
parent
7d337dccc2
commit
7f5a89f567
@ -95,7 +95,8 @@ export type AppFeature =
|
|||||||
| 'localization'
|
| 'localization'
|
||||||
| 'consoleLogging'
|
| 'consoleLogging'
|
||||||
| 'dynamicPrompting'
|
| 'dynamicPrompting'
|
||||||
| 'batches';
|
| 'batches'
|
||||||
|
| 'syncModels';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A disable-able Stable Diffusion feature
|
* A disable-able Stable Diffusion feature
|
||||||
|
@ -16,6 +16,7 @@ import { memo, useCallback, useMemo } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
|
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
|
||||||
import { FieldComponentProps } from './types';
|
import { FieldComponentProps } from './types';
|
||||||
|
import { useFeatureStatus } from '../../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const ModelInputFieldComponent = (
|
const ModelInputFieldComponent = (
|
||||||
props: FieldComponentProps<MainModelInputFieldValue, ModelInputFieldTemplate>
|
props: FieldComponentProps<MainModelInputFieldValue, ModelInputFieldTemplate>
|
||||||
@ -24,6 +25,7 @@ const ModelInputFieldComponent = (
|
|||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled;
|
||||||
|
|
||||||
const { data: mainModels, isLoading } = useGetMainModelsQuery();
|
const { data: mainModels, isLoading } = useGetMainModelsQuery();
|
||||||
|
|
||||||
@ -103,9 +105,11 @@ const ModelInputFieldComponent = (
|
|||||||
disabled={data.length === 0}
|
disabled={data.length === 0}
|
||||||
onChange={handleChangeModel}
|
onChange={handleChangeModel}
|
||||||
/>
|
/>
|
||||||
|
{isSyncModelEnabled && (
|
||||||
<Box mt={7}>
|
<Box mt={7}>
|
||||||
<SyncModelsButton iconMode />
|
<SyncModelsButton iconMode />
|
||||||
</Box>
|
</Box>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -15,6 +15,7 @@ import { modelIdToMainModelParam } from 'features/parameters/util/modelIdToMainM
|
|||||||
import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton';
|
import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton';
|
||||||
import { forEach } from 'lodash-es';
|
import { forEach } from 'lodash-es';
|
||||||
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
|
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
|
||||||
|
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -29,6 +30,7 @@ const ParamMainModelSelect = () => {
|
|||||||
const { model } = useAppSelector(selector);
|
const { model } = useAppSelector(selector);
|
||||||
|
|
||||||
const { data: mainModels, isLoading } = useGetMainModelsQuery();
|
const { data: mainModels, isLoading } = useGetMainModelsQuery();
|
||||||
|
const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled;
|
||||||
|
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
if (!mainModels) {
|
if (!mainModels) {
|
||||||
@ -98,9 +100,11 @@ const ParamMainModelSelect = () => {
|
|||||||
onChange={handleChangeModel}
|
onChange={handleChangeModel}
|
||||||
w="100%"
|
w="100%"
|
||||||
/>
|
/>
|
||||||
|
{isSyncModelEnabled && (
|
||||||
<Box mt={7}>
|
<Box mt={7}>
|
||||||
<SyncModelsButton iconMode />
|
<SyncModelsButton iconMode />
|
||||||
</Box>
|
</Box>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user