mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-14 11:55:19 -05:00
Change feature to disable apiModels to chatGPT4oModels only (#7996)
* display credit column in queue list if shouldShowCredits is true * change apiModels feature to chatGPT4oModels feature * empty --------- Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
This commit is contained in:
@@ -29,7 +29,7 @@ export type AppFeature =
|
||||
| 'hfToken'
|
||||
| 'retryQueueItem'
|
||||
| 'cancelAndClearAll'
|
||||
| 'apiModels';
|
||||
| 'chatGPT4oModels';
|
||||
/**
|
||||
* A disable-able Stable Diffusion feature
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Flex, Link, Text } from '@invoke-ai/ui-library';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { $accountSettingsLink } from 'app/store/nanostores/accountSettingsLink';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { selectIsChatGTP4o, selectIsImagen3, selectModel } from 'features/controlLayers/store/paramsSlice';
|
||||
import { selectIsChatGTP4o, selectModel } from 'features/controlLayers/store/paramsSlice';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
import { useMemo } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
@@ -10,14 +10,13 @@ import { Trans, useTranslation } from 'react-i18next';
|
||||
export const DisabledModelWarning = () => {
|
||||
const { t } = useTranslation();
|
||||
const model = useAppSelector(selectModel);
|
||||
const isImagen3 = useAppSelector(selectIsImagen3);
|
||||
const isChatGPT4o = useAppSelector(selectIsChatGTP4o);
|
||||
const areApiModelsEnabled = useFeatureStatus('apiModels');
|
||||
const areChatGPT4oModelsEnabled = useFeatureStatus('chatGPT4oModels');
|
||||
const accountSettingsLink = useStore($accountSettingsLink);
|
||||
|
||||
const isModelDisabled = useMemo(() => {
|
||||
return (isImagen3 || isChatGPT4o) && !areApiModelsEnabled;
|
||||
}, [isImagen3, isChatGPT4o, areApiModelsEnabled]);
|
||||
return isChatGPT4o && !areChatGPT4oModelsEnabled;
|
||||
}, [isChatGPT4o, areChatGPT4oModelsEnabled]);
|
||||
|
||||
if (!isModelDisabled) {
|
||||
return null;
|
||||
|
||||
@@ -89,7 +89,7 @@ const debouncedUpdateReasons = debounce(
|
||||
config: AppConfig,
|
||||
store: AppStore,
|
||||
isInPublishFlow: boolean,
|
||||
areApiModelsEnabled: boolean
|
||||
areChatGPT4oModelsEnabled: boolean
|
||||
) => {
|
||||
if (tab === 'canvas') {
|
||||
const model = selectMainModelConfig(store.getState());
|
||||
@@ -104,7 +104,7 @@ const debouncedUpdateReasons = debounce(
|
||||
canvasIsRasterizing,
|
||||
canvasIsCompositing,
|
||||
canvasIsSelectingObject,
|
||||
areApiModelsEnabled,
|
||||
areChatGPT4oModelsEnabled,
|
||||
});
|
||||
$reasonsWhyCannotEnqueue.set(reasons);
|
||||
} else if (tab === 'workflows') {
|
||||
@@ -152,7 +152,7 @@ export const useReadinessWatcher = () => {
|
||||
const canvasIsSelectingObject = useStore(canvasManager?.stateApi.$isSegmenting ?? $true);
|
||||
const canvasIsCompositing = useStore(canvasManager?.compositor.$isBusy ?? $true);
|
||||
const isInPublishFlow = useStore($isInPublishFlow);
|
||||
const areApiModelsEnabled = useFeatureStatus('apiModels');
|
||||
const areChatGPT4oModelsEnabled = useFeatureStatus('chatGPT4oModels');
|
||||
|
||||
useEffect(() => {
|
||||
debouncedUpdateReasons(
|
||||
@@ -173,7 +173,7 @@ export const useReadinessWatcher = () => {
|
||||
config,
|
||||
store,
|
||||
isInPublishFlow,
|
||||
areApiModelsEnabled
|
||||
areChatGPT4oModelsEnabled
|
||||
);
|
||||
}, [
|
||||
store,
|
||||
@@ -193,7 +193,7 @@ export const useReadinessWatcher = () => {
|
||||
upscale,
|
||||
workflowSettings,
|
||||
isInPublishFlow,
|
||||
areApiModelsEnabled,
|
||||
areChatGPT4oModelsEnabled,
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
|
||||
canvasIsRasterizing: boolean;
|
||||
canvasIsCompositing: boolean;
|
||||
canvasIsSelectingObject: boolean;
|
||||
areApiModelsEnabled: boolean;
|
||||
areChatGPT4oModelsEnabled: boolean;
|
||||
}) => {
|
||||
const {
|
||||
isConnected,
|
||||
@@ -354,7 +354,7 @@ const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
|
||||
canvasIsRasterizing,
|
||||
canvasIsCompositing,
|
||||
canvasIsSelectingObject,
|
||||
areApiModelsEnabled,
|
||||
areChatGPT4oModelsEnabled,
|
||||
} = arg;
|
||||
const { positivePrompt } = params;
|
||||
const reasons: Reason[] = [];
|
||||
@@ -487,7 +487,7 @@ const getReasonsWhyCannotEnqueueCanvasTab = (arg: {
|
||||
}
|
||||
}
|
||||
|
||||
if ((model?.base === 'imagen3' || model?.base === 'chatgpt-4o') && !areApiModelsEnabled) {
|
||||
if (model?.base === 'chatgpt-4o' && !areChatGPT4oModelsEnabled) {
|
||||
reasons.push({ content: i18n.t('parameters.invoke.modelDisabledForTrial', { modelName: model.name }) });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user