edit view for model, depending on type and valid values

This commit is contained in:
Mary Hipp
2024-02-21 13:56:14 -05:00
committed by psychedelicious
parent 6b68971f38
commit 0a69779df9
15 changed files with 538 additions and 77 deletions

View File

@@ -29,6 +29,8 @@ type UpdateModelResponse = paths['/api/v2/models/i/{key}']['patch']['responses']
type GetModelResponse =
paths['/api/v2/models/i/{key}']['get']['responses']['200']['content']['application/json'];
type GetModelMetadataResponse =
paths['/api/v2/models/meta/i/{key}']['get']['responses']['200']['content']['application/json'];
type ListModelsArg = NonNullable<paths['/api/v2/models/']['get']['parameters']['query']>;
@@ -175,6 +177,12 @@ export const modelsApi = api.injectEndpoints({
},
providesTags: ['Model'],
}),
getModelMetadata: build.query<GetModelMetadataResponse, string>({
query: (key) => {
return buildModelsUrl(`meta/i/${key}`);
},
providesTags: ['Model'],
}),
updateModels: build.mutation<UpdateModelResponse, UpdateModelArg>({
query: ({ key, body }) => {
return {
@@ -330,5 +338,6 @@ export const {
useGetModelsInFolderQuery,
useGetCheckpointConfigsQuery,
useGetModelImportsQuery,
useGetModelQuery
useGetModelQuery,
useGetModelMetadataQuery
} = modelsApi;

View File

@@ -22,7 +22,7 @@ export type paths = {
"/api/v2/models/i/{key}": {
/**
* Get Model Record
* @description Get a model record and metadata
* @description Get a model record
*/
get: operations["get_model_record"];
/**
@@ -4202,13 +4202,6 @@ export type components = {
*/
type: "freeu";
};
/** GetModelResponse */
GetModelResponse: {
/** Config */
config: (components["schemas"]["MainDiffusersConfig"] | components["schemas"]["MainCheckpointConfig"]) | (components["schemas"]["ONNXSD1Config"] | components["schemas"]["ONNXSD2Config"] | components["schemas"]["ONNXSDXLConfig"]) | (components["schemas"]["VaeDiffusersConfig"] | components["schemas"]["VaeCheckpointConfig"]) | (components["schemas"]["ControlNetDiffusersConfig"] | components["schemas"]["ControlNetCheckpointConfig"]) | components["schemas"]["LoRAConfig"] | components["schemas"]["TextualInversionConfig"] | components["schemas"]["IPAdapterConfig"] | components["schemas"]["CLIPVisionDiffusersConfig"] | components["schemas"]["T2IConfig"];
/** Metadata */
metadata: (components["schemas"]["BaseMetadata"] | components["schemas"]["HuggingFaceMetadata"] | components["schemas"]["CivitaiMetadata"]) | null;
};
/** Graph */
Graph: {
/**
@@ -11176,7 +11169,7 @@ export type operations = {
};
/**
* Get Model Record
* @description Get a model record and metadata
* @description Get a model record
*/
get_model_record: {
parameters: {
@@ -11189,7 +11182,7 @@ export type operations = {
/** @description The model configuration was retrieved successfully */
200: {
content: {
"application/json": components["schemas"]["GetModelResponse"];
"application/json": (components["schemas"]["MainDiffusersConfig"] | components["schemas"]["MainCheckpointConfig"]) | (components["schemas"]["ONNXSD1Config"] | components["schemas"]["ONNXSD2Config"] | components["schemas"]["ONNXSDXLConfig"]) | (components["schemas"]["VaeDiffusersConfig"] | components["schemas"]["VaeCheckpointConfig"]) | (components["schemas"]["ControlNetDiffusersConfig"] | components["schemas"]["ControlNetCheckpointConfig"]) | components["schemas"]["LoRAConfig"] | components["schemas"]["TextualInversionConfig"] | components["schemas"]["IPAdapterConfig"] | components["schemas"]["CLIPVisionDiffusersConfig"] | components["schemas"]["T2IConfig"];
};
};
/** @description Bad request */
@@ -11346,10 +11339,6 @@ export type operations = {
400: {
content: never;
};
/** @description No metadata available */
404: {
content: never;
};
/** @description Validation Error */
422: {
content: {