diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx
index cb50334c99..9b4b95be9e 100644
--- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx
+++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx
@@ -1,15 +1,18 @@
-import { Button, ButtonGroup, Flex } from '@invoke-ai/ui-library';
+import { Button, ButtonGroup, Flex, Text } from '@invoke-ai/ui-library';
import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
import AdvancedAddModels from './AdvancedAddModels';
import SimpleAddModels from './SimpleAddModels';
+import { useGetModelImportsQuery } from '../../../../services/api/endpoints/models';
const AddModels = () => {
const { t } = useTranslation();
const [addModelMode, setAddModelMode] = useState<'simple' | 'advanced'>('simple');
const handleAddModelSimple = useCallback(() => setAddModelMode('simple'), []);
const handleAddModelAdvanced = useCallback(() => setAddModelMode('advanced'), []);
+ const { data } = useGetModelImportsQuery({});
+ console.log({ data });
return (
@@ -24,6 +27,7 @@ const AddModels = () => {
{addModelMode === 'simple' && }
{addModelMode === 'advanced' && }
+ {data?.map((model) => {model.status})}
);
};
diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx
index d7f705aedc..0124d6d570 100644
--- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx
+++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx
@@ -36,11 +36,10 @@ const SimpleAddModels = () => {
const handleAddModelSubmit = (values: ExtendedImportModelConfig) => {
const importModelResponseBody = {
- location: values.location,
- prediction_type: values.prediction_type === 'none' ? undefined : values.prediction_type,
+ config: values.prediction_type === 'none' ? undefined : values.prediction_type,
};
- importMainModel({ body: importModelResponseBody })
+ importMainModel({ source: values.location, config: importModelResponseBody })
.unwrap()
.then((_) => {
dispatch(
diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx
index 15149b339b..dab4e0b872 100644
--- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx
+++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx
@@ -2,13 +2,13 @@ import { Flex, Text } from '@invoke-ai/ui-library';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ALL_BASE_MODELS } from 'services/api/constants';
-import type { DiffusersModelConfig, LoRAConfig, MainModelConfig } from 'services/api/endpoints/models';
import { useGetLoRAModelsQuery, useGetMainModelsQuery } from 'services/api/endpoints/models';
import CheckpointModelEdit from './ModelManagerPanel/CheckpointModelEdit';
import DiffusersModelEdit from './ModelManagerPanel/DiffusersModelEdit';
import LoRAModelEdit from './ModelManagerPanel/LoRAModelEdit';
import ModelList from './ModelManagerPanel/ModelList';
+import { DiffusersModelConfig, LoRAConfig, MainModelConfig } from '../../../services/api/types';
const ModelManagerPanel = () => {
const [selectedModelId, setSelectedModelId] = useState();
@@ -41,16 +41,16 @@ const ModelEdit = (props: ModelEditProps) => {
const { t } = useTranslation();
const { model } = props;
- if (model?.model_format === 'checkpoint') {
- return ;
+ if (model?.format === 'checkpoint') {
+ return ;
}
- if (model?.model_format === 'diffusers') {
- return ;
+ if (model?.format === 'diffusers') {
+ return ;
}
- if (model?.model_type === 'lora') {
- return ;
+ if (model?.type === 'lora') {
+ return ;
}
return (
diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx
index 43707308e0..0dd8a7add6 100644
--- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx
+++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx
@@ -21,11 +21,9 @@ import { memo, useCallback, useEffect, useState } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
-import type { CheckpointModelConfig } from 'services/api/endpoints/models';
-import { useGetCheckpointConfigsQuery, useUpdateMainModelsMutation } from 'services/api/endpoints/models';
-import type { CheckpointModelConfig } from 'services/api/types';
-
+import { useGetCheckpointConfigsQuery, useUpdateModelsMutation } from 'services/api/endpoints/models';
import ModelConvert from './ModelConvert';
+import { CheckpointModelConfig } from '../../../../services/api/types';
type CheckpointModelEditProps = {
model: CheckpointModelConfig;
@@ -34,7 +32,7 @@ type CheckpointModelEditProps = {
const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
const { model } = props;
- const [updateMainModel, { isLoading }] = useUpdateMainModelsMutation();
+ const [updateModel, { isLoading }] = useUpdateModelsMutation();
const { data: availableCheckpointConfigs } = useGetCheckpointConfigsQuery();
const [useCustomConfig, setUseCustomConfig] = useState(false);
@@ -56,12 +54,12 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
reset,
} = useForm({
defaultValues: {
- model_name: model.model_name ? model.model_name : '',
- base_model: model.base_model,
- model_type: 'main',
+ name: model.name ? model.name : '',
+ base: model.base,
+ type: 'main',
path: model.path ? model.path : '',
description: model.description ? model.description : '',
- model_format: 'checkpoint',
+ format: 'checkpoint',
vae: model.vae ? model.vae : '',
config: model.config ? model.config : '',
variant: model.variant,
@@ -74,11 +72,10 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
const onSubmit = useCallback>(
(values) => {
const responseBody = {
- base_model: model.base_model,
- model_name: model.model_name,
+ key: model.key,
body: values,
};
- updateMainModel(responseBody)
+ updateModel(responseBody)
.unwrap()
.then((payload) => {
reset(payload as CheckpointModelConfig, { keepDefaultValues: true });
@@ -103,7 +100,7 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
);
});
},
- [dispatch, model.base_model, model.model_name, reset, t, updateMainModel]
+ [dispatch, model.key, reset, t, updateModel]
);
return (
@@ -111,13 +108,13 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
- {model.model_name}
+ {model.name}
- {MODEL_TYPE_MAP[model.base_model]} {t('modelManager.model')}
+ {MODEL_TYPE_MAP[model.base]} {t('modelManager.model')}
- {![''].includes(model.base_model) ? (
+ {![''].includes(model.base) ? (
) : (
@@ -130,20 +127,20 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {