diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/AdvancedImport.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/AdvancedImport.tsx index 36af89baec..b2fd094582 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/AdvancedImport.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/AdvancedImport.tsx @@ -11,8 +11,8 @@ import RepoVariantSelect from 'features/modelManagerV2/subpanels/ModelPanel/Fiel import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import { useCallback, useEffect } from 'react'; -import type { SubmitHandler} from 'react-hook-form'; -import {useForm } from 'react-hook-form'; +import type { SubmitHandler } from 'react-hook-form'; +import { useForm } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useImportAdvancedModelMutation } from 'services/api/endpoints/models'; import type { AnyModelConfig } from 'services/api/types'; diff --git a/invokeai/frontend/web/src/services/api/endpoints/models.ts b/invokeai/frontend/web/src/services/api/endpoints/models.ts index e8dad92467..e6be1c6d4a 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/models.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/models.ts @@ -58,6 +58,14 @@ type DeleteImportModelsResponse = type PruneModelImportsResponse = paths['/api/v2/models/import']['patch']['responses']['200']['content']['application/json']; +type ImportAdvancedModelArg = { + source: NonNullable; + config: NonNullable; +}; + +type ImportAdvancedModelResponse = + paths['/api/v2/models/import']['post']['responses']['201']['content']['application/json']; + export type ScanFolderResponse = paths['/api/v2/models/scan_folder']['get']['responses']['200']['content']['application/json']; type ScanFolderArg = operations['scan_for_models']['parameters']['query']; @@ -175,6 +183,16 @@ export const modelsApi = api.injectEndpoints({ }, invalidatesTags: ['Model', 'ModelImports'], }), + importAdvancedModel: build.mutation({ + query: ({ source, config }) => { + return { + url: buildModelsUrl('install'), + method: 'POST', + body: { source, config }, + }; + }, + invalidatesTags: ['Model', 'ModelImports'], + }), deleteModels: build.mutation({ query: ({ key }) => { return { diff --git a/invokeai/frontend/web/tsconfig.json b/invokeai/frontend/web/tsconfig.json index fc1111ffd0..91906c9abe 100644 --- a/invokeai/frontend/web/tsconfig.json +++ b/invokeai/frontend/web/tsconfig.json @@ -20,16 +20,16 @@ "jsx": "react-jsx", "baseUrl": "./", "paths": { - "*": ["./src/*"], - }, + "*": ["./src/*"] + } }, "include": ["src/**/*.ts", "src/**/*.tsx", "*.d.ts", ".storybook/**/*"], "exclude": ["src/services/fixtures/*", "node_modules", "dist"], "references": [{ "path": "./tsconfig.node.json" }], "ts-node": { "compilerOptions": { - "jsx": "preserve", + "jsx": "preserve" }, - "esm": true, - }, + "esm": true + } }