mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat: Restore Model Convert Functionality
This commit is contained in:
@ -44,6 +44,11 @@ type DeleteMainModelQuery = {
|
||||
model_name: string;
|
||||
};
|
||||
|
||||
type ConvertMainModelQuery = {
|
||||
base_model: BaseModelType;
|
||||
model_name: string;
|
||||
};
|
||||
|
||||
const mainModelsAdapter = createEntityAdapter<MainModelConfigEntity>({
|
||||
sortComparer: (a, b) => a.name.localeCompare(b.name),
|
||||
});
|
||||
@ -138,6 +143,18 @@ export const modelsApi = api.injectEndpoints({
|
||||
},
|
||||
invalidatesTags: ['MainModel'],
|
||||
}),
|
||||
convertMainModel: build.mutation<
|
||||
EntityState<MainModelConfigEntity>,
|
||||
ConvertMainModelQuery
|
||||
>({
|
||||
query: ({ base_model, model_name }) => {
|
||||
return {
|
||||
url: `models/convert/${base_model}/main/${model_name}`,
|
||||
method: 'PUT',
|
||||
};
|
||||
},
|
||||
invalidatesTags: ['MainModel'],
|
||||
}),
|
||||
getLoRAModels: build.query<EntityState<LoRAModelConfigEntity>, void>({
|
||||
query: () => ({ url: 'models/', params: { model_type: 'lora' } }),
|
||||
providesTags: (result, error, arg) => {
|
||||
@ -283,4 +300,5 @@ export const {
|
||||
useGetVaeModelsQuery,
|
||||
useUpdateMainModelsMutation,
|
||||
useDeleteMainModelsMutation,
|
||||
useConvertMainModelMutation,
|
||||
} = modelsApi;
|
||||
|
Reference in New Issue
Block a user