mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Removed things no longer needed in main
This commit is contained in:
parent
81d8fb8762
commit
33245b37ad
@ -1,119 +0,0 @@
|
||||
import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
||||
|
||||
import { SelectItem } from '@mantine/core';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { stateSelector } from 'app/store/store';
|
||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||
import { modelIdToMainModelField } from 'features/nodes/util/modelIdToMainModelField';
|
||||
import { modelSelected } from 'features/parameters/store/actions';
|
||||
import { forEach } from 'lodash-es';
|
||||
import {
|
||||
useGetMainModelsQuery,
|
||||
useGetOnnxModelsQuery,
|
||||
} from 'services/api/endpoints/models';
|
||||
import { modelIdToOnnxModelField } from 'features/nodes/util/modelIdToOnnxModelField';
|
||||
|
||||
export const MODEL_TYPE_MAP = {
|
||||
'sd-1': 'Stable Diffusion 1.x',
|
||||
'sd-2': 'Stable Diffusion 2.x',
|
||||
};
|
||||
|
||||
const selector = createSelector(
|
||||
stateSelector,
|
||||
(state) => ({ currentModel: state.generation.model }),
|
||||
defaultSelectorOptions
|
||||
);
|
||||
|
||||
const ModelSelect = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { currentModel } = useAppSelector(selector);
|
||||
|
||||
const { data: mainModels, isLoading } = useGetMainModelsQuery();
|
||||
const { data: onnxModels, isLoading: onnxLoading } = useGetOnnxModelsQuery();
|
||||
|
||||
const data = useMemo(() => {
|
||||
if (!mainModels) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const data: SelectItem[] = [];
|
||||
|
||||
forEach(mainModels.entities, (model, id) => {
|
||||
if (!model) {
|
||||
return;
|
||||
}
|
||||
|
||||
data.push({
|
||||
value: id,
|
||||
label: model.model_name,
|
||||
group: MODEL_TYPE_MAP[model.base_model],
|
||||
});
|
||||
});
|
||||
forEach(onnxModels?.entities, (model, id) => {
|
||||
if (!model) {
|
||||
return;
|
||||
}
|
||||
|
||||
data.push({
|
||||
value: id,
|
||||
label: model.model_name,
|
||||
group: MODEL_TYPE_MAP[model.base_model],
|
||||
});
|
||||
});
|
||||
|
||||
return data;
|
||||
}, [mainModels, onnxModels]);
|
||||
|
||||
const selectedModel = useMemo(
|
||||
() =>
|
||||
mainModels?.entities[
|
||||
`${currentModel?.base_model}/main/${currentModel?.model_name}`
|
||||
] ||
|
||||
onnxModels?.entities[
|
||||
`${currentModel?.base_model}/onnx/${currentModel?.model_name}`
|
||||
],
|
||||
[mainModels?.entities, onnxModels?.entities, currentModel]
|
||||
);
|
||||
|
||||
const handleChangeModel = useCallback(
|
||||
(v: string | null) => {
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
let modelField = modelIdToMainModelField(v);
|
||||
if (v.includes('onnx')) {
|
||||
modelField = modelIdToOnnxModelField(v);
|
||||
}
|
||||
dispatch(modelSelected(modelField));
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
return isLoading || onnxLoading ? (
|
||||
<IAIMantineSelect
|
||||
label={t('modelManager.model')}
|
||||
placeholder="Loading..."
|
||||
disabled={true}
|
||||
data={[]}
|
||||
/>
|
||||
) : (
|
||||
<IAIMantineSelect
|
||||
tooltip={selectedModel?.description}
|
||||
label={t('modelManager.model')}
|
||||
value={selectedModel?.id}
|
||||
placeholder={data.length > 0 ? 'Select a model' : 'No models available'}
|
||||
data={data}
|
||||
error={data.length === 0}
|
||||
disabled={data.length === 0}
|
||||
onChange={handleChangeModel}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default memo(ModelSelect);
|
@ -1,247 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BoardChanges } from '../models/BoardChanges';
|
||||
import type { BoardDTO } from '../models/BoardDTO';
|
||||
import type { Body_create_board_image } from '../models/Body_create_board_image';
|
||||
import type { Body_remove_board_image } from '../models/Body_remove_board_image';
|
||||
import type { OffsetPaginatedResults_BoardDTO_ } from '../models/OffsetPaginatedResults_BoardDTO_';
|
||||
import type { OffsetPaginatedResults_ImageDTO_ } from '../models/OffsetPaginatedResults_ImageDTO_';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class BoardsService {
|
||||
|
||||
/**
|
||||
* List Boards
|
||||
* Gets a list of boards
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listBoards({
|
||||
all,
|
||||
offset,
|
||||
limit,
|
||||
}: {
|
||||
/**
|
||||
* Whether to list all boards
|
||||
*/
|
||||
all?: boolean,
|
||||
/**
|
||||
* The page offset
|
||||
*/
|
||||
offset?: number,
|
||||
/**
|
||||
* The number of boards per page
|
||||
*/
|
||||
limit?: number,
|
||||
}): CancelablePromise<(OffsetPaginatedResults_BoardDTO_ | Array<BoardDTO>)> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/boards/',
|
||||
query: {
|
||||
'all': all,
|
||||
'offset': offset,
|
||||
'limit': limit,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Board
|
||||
* Creates a board
|
||||
* @returns BoardDTO The board was created successfully
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createBoard({
|
||||
boardName,
|
||||
}: {
|
||||
/**
|
||||
* The name of the board to create
|
||||
*/
|
||||
boardName: string,
|
||||
}): CancelablePromise<BoardDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/boards/',
|
||||
query: {
|
||||
'board_name': boardName,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Board
|
||||
* Gets a board
|
||||
* @returns BoardDTO Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getBoard({
|
||||
boardId,
|
||||
}: {
|
||||
/**
|
||||
* The id of board to get
|
||||
*/
|
||||
boardId: string,
|
||||
}): CancelablePromise<BoardDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/boards/{board_id}',
|
||||
path: {
|
||||
'board_id': boardId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Board
|
||||
* Deletes a board
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteBoard({
|
||||
boardId,
|
||||
}: {
|
||||
/**
|
||||
* The id of board to delete
|
||||
*/
|
||||
boardId: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/boards/{board_id}',
|
||||
path: {
|
||||
'board_id': boardId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Board
|
||||
* Updates a board
|
||||
* @returns BoardDTO The board was updated successfully
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateBoard({
|
||||
boardId,
|
||||
requestBody,
|
||||
}: {
|
||||
/**
|
||||
* The id of board to update
|
||||
*/
|
||||
boardId: string,
|
||||
requestBody: BoardChanges,
|
||||
}): CancelablePromise<BoardDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PATCH',
|
||||
url: '/api/v1/boards/{board_id}',
|
||||
path: {
|
||||
'board_id': boardId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Board Image
|
||||
* Creates a board_image
|
||||
* @returns any The image was added to a board successfully
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createBoardImage({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: Body_create_board_image,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/board_images/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Board Image
|
||||
* Deletes a board_image
|
||||
* @returns any The image was removed from the board successfully
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static removeBoardImage({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: Body_remove_board_image,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/board_images/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* List Board Images
|
||||
* Gets a list of images for a board
|
||||
* @returns OffsetPaginatedResults_ImageDTO_ Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listBoardImages({
|
||||
boardId,
|
||||
offset,
|
||||
limit = 10,
|
||||
}: {
|
||||
/**
|
||||
* The id of the board
|
||||
*/
|
||||
boardId: string,
|
||||
/**
|
||||
* The page offset
|
||||
*/
|
||||
offset?: number,
|
||||
/**
|
||||
* The number of boards per page
|
||||
*/
|
||||
limit?: number,
|
||||
}): CancelablePromise<OffsetPaginatedResults_ImageDTO_> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/board_images/{board_id}',
|
||||
path: {
|
||||
'board_id': boardId,
|
||||
},
|
||||
query: {
|
||||
'offset': offset,
|
||||
'limit': limit,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,279 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Body_upload_image } from '../models/Body_upload_image';
|
||||
import type { ImageCategory } from '../models/ImageCategory';
|
||||
import type { ImageDTO } from '../models/ImageDTO';
|
||||
import type { ImageRecordChanges } from '../models/ImageRecordChanges';
|
||||
import type { ImageUrlsDTO } from '../models/ImageUrlsDTO';
|
||||
import type { OffsetPaginatedResults_ImageDTO_ } from '../models/OffsetPaginatedResults_ImageDTO_';
|
||||
import type { ResourceOrigin } from '../models/ResourceOrigin';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class ImagesService {
|
||||
|
||||
/**
|
||||
* List Images With Metadata
|
||||
* Gets a list of images
|
||||
* @returns OffsetPaginatedResults_ImageDTO_ Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listImagesWithMetadata({
|
||||
imageOrigin,
|
||||
categories,
|
||||
isIntermediate,
|
||||
boardId,
|
||||
offset,
|
||||
limit = 10,
|
||||
}: {
|
||||
/**
|
||||
* The origin of images to list
|
||||
*/
|
||||
imageOrigin?: ResourceOrigin,
|
||||
/**
|
||||
* The categories of image to include
|
||||
*/
|
||||
categories?: Array<ImageCategory>,
|
||||
/**
|
||||
* Whether to list intermediate images
|
||||
*/
|
||||
isIntermediate?: boolean,
|
||||
/**
|
||||
* The board id to filter by
|
||||
*/
|
||||
boardId?: string,
|
||||
/**
|
||||
* The page offset
|
||||
*/
|
||||
offset?: number,
|
||||
/**
|
||||
* The number of images per page
|
||||
*/
|
||||
limit?: number,
|
||||
}): CancelablePromise<OffsetPaginatedResults_ImageDTO_> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/images/',
|
||||
query: {
|
||||
'image_origin': imageOrigin,
|
||||
'categories': categories,
|
||||
'is_intermediate': isIntermediate,
|
||||
'board_id': boardId,
|
||||
'offset': offset,
|
||||
'limit': limit,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload Image
|
||||
* Uploads an image
|
||||
* @returns ImageDTO The image was uploaded successfully
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static uploadImage({
|
||||
imageCategory,
|
||||
isIntermediate,
|
||||
formData,
|
||||
sessionId,
|
||||
}: {
|
||||
/**
|
||||
* The category of the image
|
||||
*/
|
||||
imageCategory: ImageCategory,
|
||||
/**
|
||||
* Whether this is an intermediate image
|
||||
*/
|
||||
isIntermediate: boolean,
|
||||
formData: Body_upload_image,
|
||||
/**
|
||||
* The session ID associated with this upload, if any
|
||||
*/
|
||||
sessionId?: string,
|
||||
}): CancelablePromise<ImageDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/images/',
|
||||
query: {
|
||||
'image_category': imageCategory,
|
||||
'is_intermediate': isIntermediate,
|
||||
'session_id': sessionId,
|
||||
},
|
||||
formData: formData,
|
||||
mediaType: 'multipart/form-data',
|
||||
errors: {
|
||||
415: `Image upload failed`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image Full
|
||||
* Gets a full-resolution image file
|
||||
* @returns any Return the full-resolution image
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getImageFull({
|
||||
imageName,
|
||||
}: {
|
||||
/**
|
||||
* The name of full-resolution image file to get
|
||||
*/
|
||||
imageName: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/images/{image_name}',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
errors: {
|
||||
404: `Image not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Image
|
||||
* Deletes an image
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteImage({
|
||||
imageName,
|
||||
}: {
|
||||
/**
|
||||
* The name of the image to delete
|
||||
*/
|
||||
imageName: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/images/{image_name}',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Image
|
||||
* Updates an image
|
||||
* @returns ImageDTO Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateImage({
|
||||
imageName,
|
||||
requestBody,
|
||||
}: {
|
||||
/**
|
||||
* The name of the image to update
|
||||
*/
|
||||
imageName: string,
|
||||
requestBody: ImageRecordChanges,
|
||||
}): CancelablePromise<ImageDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PATCH',
|
||||
url: '/api/v1/images/{image_name}',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image Metadata
|
||||
* Gets an image's metadata
|
||||
* @returns ImageDTO Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getImageMetadata({
|
||||
imageName,
|
||||
}: {
|
||||
/**
|
||||
* The name of image to get
|
||||
*/
|
||||
imageName: string,
|
||||
}): CancelablePromise<ImageDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/images/{image_name}/metadata',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image Thumbnail
|
||||
* Gets a thumbnail image file
|
||||
* @returns any Return the image thumbnail
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getImageThumbnail({
|
||||
imageName,
|
||||
}: {
|
||||
/**
|
||||
* The name of thumbnail image file to get
|
||||
*/
|
||||
imageName: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/images/{image_name}/thumbnail',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
errors: {
|
||||
404: `Image not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image Urls
|
||||
* Gets an image and thumbnail URL
|
||||
* @returns ImageUrlsDTO Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getImageUrls({
|
||||
imageName,
|
||||
}: {
|
||||
/**
|
||||
* The name of the image whose URL to get
|
||||
*/
|
||||
imageName: string,
|
||||
}): CancelablePromise<ImageUrlsDTO> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/images/{image_name}/urls',
|
||||
path: {
|
||||
'image_name': imageName,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseModelType } from '../models/BaseModelType';
|
||||
import type { CreateModelRequest } from '../models/CreateModelRequest';
|
||||
import type { ModelsList } from '../models/ModelsList';
|
||||
import type { ModelType } from '../models/ModelType';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class ModelsService {
|
||||
|
||||
/**
|
||||
* List Models
|
||||
* Gets a list of models
|
||||
* @returns ModelsList Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listModels({
|
||||
baseModel,
|
||||
modelType,
|
||||
}: {
|
||||
/**
|
||||
* Base model
|
||||
*/
|
||||
baseModel?: BaseModelType,
|
||||
/**
|
||||
* The type of model to get
|
||||
*/
|
||||
modelType?: ModelType,
|
||||
}): CancelablePromise<ModelsList> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/models/',
|
||||
query: {
|
||||
'base_model': baseModel,
|
||||
'model_type': modelType,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Model
|
||||
* Add Model
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateModel({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: CreateModelRequest,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/models/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Model
|
||||
* Delete Model
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static delModel({
|
||||
modelName,
|
||||
}: {
|
||||
modelName: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/models/{model_name}',
|
||||
path: {
|
||||
'model_name': modelName,
|
||||
},
|
||||
errors: {
|
||||
404: `Model not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,417 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { AddInvocation } from '../models/AddInvocation';
|
||||
import type { CannyImageProcessorInvocation } from '../models/CannyImageProcessorInvocation';
|
||||
import type { CollectInvocation } from '../models/CollectInvocation';
|
||||
import type { CompelInvocation } from '../models/CompelInvocation';
|
||||
import type { ContentShuffleImageProcessorInvocation } from '../models/ContentShuffleImageProcessorInvocation';
|
||||
import type { ControlNetInvocation } from '../models/ControlNetInvocation';
|
||||
import type { CvInpaintInvocation } from '../models/CvInpaintInvocation';
|
||||
import type { DivideInvocation } from '../models/DivideInvocation';
|
||||
import type { DynamicPromptInvocation } from '../models/DynamicPromptInvocation';
|
||||
import type { Edge } from '../models/Edge';
|
||||
import type { FloatLinearRangeInvocation } from '../models/FloatLinearRangeInvocation';
|
||||
import type { Graph } from '../models/Graph';
|
||||
import type { GraphExecutionState } from '../models/GraphExecutionState';
|
||||
import type { GraphInvocation } from '../models/GraphInvocation';
|
||||
import type { HedImageProcessorInvocation } from '../models/HedImageProcessorInvocation';
|
||||
import type { ImageBlurInvocation } from '../models/ImageBlurInvocation';
|
||||
import type { ImageChannelInvocation } from '../models/ImageChannelInvocation';
|
||||
import type { ImageConvertInvocation } from '../models/ImageConvertInvocation';
|
||||
import type { ImageCropInvocation } from '../models/ImageCropInvocation';
|
||||
import type { ImageInverseLerpInvocation } from '../models/ImageInverseLerpInvocation';
|
||||
import type { ImageLerpInvocation } from '../models/ImageLerpInvocation';
|
||||
import type { ImageMultiplyInvocation } from '../models/ImageMultiplyInvocation';
|
||||
import type { ImagePasteInvocation } from '../models/ImagePasteInvocation';
|
||||
import type { ImageProcessorInvocation } from '../models/ImageProcessorInvocation';
|
||||
import type { ImageResizeInvocation } from '../models/ImageResizeInvocation';
|
||||
import type { ImageScaleInvocation } from '../models/ImageScaleInvocation';
|
||||
import type { ImageToLatentsInvocation } from '../models/ImageToLatentsInvocation';
|
||||
import type { InfillColorInvocation } from '../models/InfillColorInvocation';
|
||||
import type { InfillPatchMatchInvocation } from '../models/InfillPatchMatchInvocation';
|
||||
import type { InfillTileInvocation } from '../models/InfillTileInvocation';
|
||||
import type { InpaintInvocation } from '../models/InpaintInvocation';
|
||||
import type { IterateInvocation } from '../models/IterateInvocation';
|
||||
import type { LatentsToImageInvocation } from '../models/LatentsToImageInvocation';
|
||||
import type { LatentsToLatentsInvocation } from '../models/LatentsToLatentsInvocation';
|
||||
import type { LineartAnimeImageProcessorInvocation } from '../models/LineartAnimeImageProcessorInvocation';
|
||||
import type { LineartImageProcessorInvocation } from '../models/LineartImageProcessorInvocation';
|
||||
import type { LoadImageInvocation } from '../models/LoadImageInvocation';
|
||||
import type { LoraLoaderInvocation } from '../models/LoraLoaderInvocation';
|
||||
import type { MaskFromAlphaInvocation } from '../models/MaskFromAlphaInvocation';
|
||||
import type { MediapipeFaceProcessorInvocation } from '../models/MediapipeFaceProcessorInvocation';
|
||||
import type { MidasDepthImageProcessorInvocation } from '../models/MidasDepthImageProcessorInvocation';
|
||||
import type { MlsdImageProcessorInvocation } from '../models/MlsdImageProcessorInvocation';
|
||||
import type { MultiplyInvocation } from '../models/MultiplyInvocation';
|
||||
import type { NoiseInvocation } from '../models/NoiseInvocation';
|
||||
import type { NormalbaeImageProcessorInvocation } from '../models/NormalbaeImageProcessorInvocation';
|
||||
import type { ONNXLatentsToImageInvocation } from '../models/ONNXLatentsToImageInvocation';
|
||||
import type { ONNXPromptInvocation } from '../models/ONNXPromptInvocation';
|
||||
import type { ONNXSD1ModelLoaderInvocation } from '../models/ONNXSD1ModelLoaderInvocation';
|
||||
import type { ONNXTextToLatentsInvocation } from '../models/ONNXTextToLatentsInvocation';
|
||||
import type { OpenposeImageProcessorInvocation } from '../models/OpenposeImageProcessorInvocation';
|
||||
import type { PaginatedResults_GraphExecutionState_ } from '../models/PaginatedResults_GraphExecutionState_';
|
||||
import type { ParamFloatInvocation } from '../models/ParamFloatInvocation';
|
||||
import type { ParamIntInvocation } from '../models/ParamIntInvocation';
|
||||
import type { PidiImageProcessorInvocation } from '../models/PidiImageProcessorInvocation';
|
||||
import type { PipelineModelLoaderInvocation } from '../models/PipelineModelLoaderInvocation';
|
||||
import type { RandomIntInvocation } from '../models/RandomIntInvocation';
|
||||
import type { RandomRangeInvocation } from '../models/RandomRangeInvocation';
|
||||
import type { RangeInvocation } from '../models/RangeInvocation';
|
||||
import type { RangeOfSizeInvocation } from '../models/RangeOfSizeInvocation';
|
||||
import type { ResizeLatentsInvocation } from '../models/ResizeLatentsInvocation';
|
||||
import type { RestoreFaceInvocation } from '../models/RestoreFaceInvocation';
|
||||
import type { ScaleLatentsInvocation } from '../models/ScaleLatentsInvocation';
|
||||
import type { ShowImageInvocation } from '../models/ShowImageInvocation';
|
||||
import type { StepParamEasingInvocation } from '../models/StepParamEasingInvocation';
|
||||
import type { SubtractInvocation } from '../models/SubtractInvocation';
|
||||
import type { TextToLatentsInvocation } from '../models/TextToLatentsInvocation';
|
||||
import type { UpscaleInvocation } from '../models/UpscaleInvocation';
|
||||
import type { ZoeDepthImageProcessorInvocation } from '../models/ZoeDepthImageProcessorInvocation';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class SessionsService {
|
||||
|
||||
/**
|
||||
* List Sessions
|
||||
* Gets a list of sessions, optionally searching
|
||||
* @returns PaginatedResults_GraphExecutionState_ Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listSessions({
|
||||
page,
|
||||
perPage = 10,
|
||||
query = '',
|
||||
}: {
|
||||
/**
|
||||
* The page of results to get
|
||||
*/
|
||||
page?: number,
|
||||
/**
|
||||
* The number of results per page
|
||||
*/
|
||||
perPage?: number,
|
||||
/**
|
||||
* The query string to search for
|
||||
*/
|
||||
query?: string,
|
||||
}): CancelablePromise<PaginatedResults_GraphExecutionState_> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/sessions/',
|
||||
query: {
|
||||
'page': page,
|
||||
'per_page': perPage,
|
||||
'query': query,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Session
|
||||
* Creates a new session, optionally initializing it with an invocation graph
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createSession({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody?: Graph,
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/sessions/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Invalid json`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Session
|
||||
* Gets a session
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getSession({
|
||||
sessionId,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session to get
|
||||
*/
|
||||
sessionId: string,
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/sessions/{session_id}',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
},
|
||||
errors: {
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Node
|
||||
* Adds a node to the graph
|
||||
* @returns string Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static addNode({
|
||||
sessionId,
|
||||
requestBody,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session
|
||||
*/
|
||||
sessionId: string,
|
||||
requestBody: (RangeInvocation | RangeOfSizeInvocation | RandomRangeInvocation | PipelineModelLoaderInvocation | LoraLoaderInvocation | CompelInvocation | LoadImageInvocation | ShowImageInvocation | ImageCropInvocation | ImagePasteInvocation | MaskFromAlphaInvocation | ImageMultiplyInvocation | ImageChannelInvocation | ImageConvertInvocation | ImageBlurInvocation | ImageResizeInvocation | ImageScaleInvocation | ImageLerpInvocation | ImageInverseLerpInvocation | ControlNetInvocation | ImageProcessorInvocation | CvInpaintInvocation | NoiseInvocation | TextToLatentsInvocation | LatentsToImageInvocation | ResizeLatentsInvocation | ScaleLatentsInvocation | ImageToLatentsInvocation | InpaintInvocation | InfillColorInvocation | InfillTileInvocation | InfillPatchMatchInvocation | AddInvocation | SubtractInvocation | MultiplyInvocation | DivideInvocation | RandomIntInvocation | ONNXPromptInvocation | ONNXTextToLatentsInvocation | ONNXLatentsToImageInvocation | ONNXSD1ModelLoaderInvocation | ParamIntInvocation | ParamFloatInvocation | FloatLinearRangeInvocation | StepParamEasingInvocation | DynamicPromptInvocation | RestoreFaceInvocation | UpscaleInvocation | GraphInvocation | IterateInvocation | CollectInvocation | CannyImageProcessorInvocation | HedImageProcessorInvocation | LineartImageProcessorInvocation | LineartAnimeImageProcessorInvocation | OpenposeImageProcessorInvocation | MidasDepthImageProcessorInvocation | NormalbaeImageProcessorInvocation | MlsdImageProcessorInvocation | PidiImageProcessorInvocation | ContentShuffleImageProcessorInvocation | ZoeDepthImageProcessorInvocation | MediapipeFaceProcessorInvocation | LatentsToLatentsInvocation),
|
||||
}): CancelablePromise<string> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/sessions/{session_id}/nodes',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Invalid node or link`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Node
|
||||
* Updates a node in the graph and removes all linked edges
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateNode({
|
||||
sessionId,
|
||||
nodePath,
|
||||
requestBody,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session
|
||||
*/
|
||||
sessionId: string,
|
||||
/**
|
||||
* The path to the node in the graph
|
||||
*/
|
||||
nodePath: string,
|
||||
requestBody: (RangeInvocation | RangeOfSizeInvocation | RandomRangeInvocation | PipelineModelLoaderInvocation | LoraLoaderInvocation | CompelInvocation | LoadImageInvocation | ShowImageInvocation | ImageCropInvocation | ImagePasteInvocation | MaskFromAlphaInvocation | ImageMultiplyInvocation | ImageChannelInvocation | ImageConvertInvocation | ImageBlurInvocation | ImageResizeInvocation | ImageScaleInvocation | ImageLerpInvocation | ImageInverseLerpInvocation | ControlNetInvocation | ImageProcessorInvocation | CvInpaintInvocation | NoiseInvocation | TextToLatentsInvocation | LatentsToImageInvocation | ResizeLatentsInvocation | ScaleLatentsInvocation | ImageToLatentsInvocation | InpaintInvocation | InfillColorInvocation | InfillTileInvocation | InfillPatchMatchInvocation | AddInvocation | SubtractInvocation | MultiplyInvocation | DivideInvocation | RandomIntInvocation | ONNXPromptInvocation | ONNXTextToLatentsInvocation | ONNXLatentsToImageInvocation | ONNXSD1ModelLoaderInvocation | ParamIntInvocation | ParamFloatInvocation | FloatLinearRangeInvocation | StepParamEasingInvocation | DynamicPromptInvocation | RestoreFaceInvocation | UpscaleInvocation | GraphInvocation | IterateInvocation | CollectInvocation | CannyImageProcessorInvocation | HedImageProcessorInvocation | LineartImageProcessorInvocation | LineartAnimeImageProcessorInvocation | OpenposeImageProcessorInvocation | MidasDepthImageProcessorInvocation | NormalbaeImageProcessorInvocation | MlsdImageProcessorInvocation | PidiImageProcessorInvocation | ContentShuffleImageProcessorInvocation | ZoeDepthImageProcessorInvocation | MediapipeFaceProcessorInvocation | LatentsToLatentsInvocation),
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/api/v1/sessions/{session_id}/nodes/{node_path}',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
'node_path': nodePath,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Invalid node or link`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Node
|
||||
* Deletes a node in the graph and removes all linked edges
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteNode({
|
||||
sessionId,
|
||||
nodePath,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session
|
||||
*/
|
||||
sessionId: string,
|
||||
/**
|
||||
* The path to the node to delete
|
||||
*/
|
||||
nodePath: string,
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/sessions/{session_id}/nodes/{node_path}',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
'node_path': nodePath,
|
||||
},
|
||||
errors: {
|
||||
400: `Invalid node or link`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Edge
|
||||
* Adds an edge to the graph
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static addEdge({
|
||||
sessionId,
|
||||
requestBody,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session
|
||||
*/
|
||||
sessionId: string,
|
||||
requestBody: Edge,
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/sessions/{session_id}/edges',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Invalid node or link`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Edge
|
||||
* Deletes an edge from the graph
|
||||
* @returns GraphExecutionState Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteEdge({
|
||||
sessionId,
|
||||
fromNodeId,
|
||||
fromField,
|
||||
toNodeId,
|
||||
toField,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session
|
||||
*/
|
||||
sessionId: string,
|
||||
/**
|
||||
* The id of the node the edge is coming from
|
||||
*/
|
||||
fromNodeId: string,
|
||||
/**
|
||||
* The field of the node the edge is coming from
|
||||
*/
|
||||
fromField: string,
|
||||
/**
|
||||
* The id of the node the edge is going to
|
||||
*/
|
||||
toNodeId: string,
|
||||
/**
|
||||
* The field of the node the edge is going to
|
||||
*/
|
||||
toField: string,
|
||||
}): CancelablePromise<GraphExecutionState> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/sessions/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
'from_node_id': fromNodeId,
|
||||
'from_field': fromField,
|
||||
'to_node_id': toNodeId,
|
||||
'to_field': toField,
|
||||
},
|
||||
errors: {
|
||||
400: `Invalid node or link`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke Session
|
||||
* Invokes a session
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static invokeSession({
|
||||
sessionId,
|
||||
all = false,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session to invoke
|
||||
*/
|
||||
sessionId: string,
|
||||
/**
|
||||
* Whether or not to invoke all remaining invocations
|
||||
*/
|
||||
all?: boolean,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/api/v1/sessions/{session_id}/invoke',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
},
|
||||
query: {
|
||||
'all': all,
|
||||
},
|
||||
errors: {
|
||||
400: `The session has no invocations ready to invoke`,
|
||||
404: `Session not found`,
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel Session Invoke
|
||||
* Invokes a session
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static cancelSessionInvoke({
|
||||
sessionId,
|
||||
}: {
|
||||
/**
|
||||
* The id of the session to cancel
|
||||
*/
|
||||
sessionId: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/sessions/{session_id}/invoke',
|
||||
path: {
|
||||
'session_id': sessionId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user