From e386b5dc539dc6d95dd564c4a1f3112fcce0584d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:14:13 +1000 Subject: [PATCH] feat(ui): api layer refactor *migrate from `openapi-typescript-codegen` to `openapi-typescript` and `openapi-fetch`* `openapi-typescript-codegen` is not very actively maintained - it's been over a year since the last update. `openapi-typescript` and `openapi-fetch` are part of the actively maintained repo. key differences: - provides a `fetch` client instead of `axios`, which means we need to be a bit more verbose with typing thunks - fetch client is created at runtime and has a very nice typescript DX - generates a single file with all types in it, from which we then extract individual types. i don't like how verbose this is, but i do like how it is more explicit. - removed npm api generation scripts - now we have a single `typegen` script overall i have more confidence in this new library. *use nanostores for api base and token* very simple reactive store for api base url and token. this was suggested in the `openapi-fetch` docs and i quite like the strategy. *organise rtk-query api* split out each endpoint (models, images, boards, boardImages) into their own api extensions. tidy! --- invokeai/frontend/web/package.json | 6 +- .../frontend/web/src/app/components/App.tsx | 2 +- .../components/ImageDnd/ImageDndContext.tsx | 4 +- .../components/ImageDnd/OverlayDragImage.tsx | 2 +- .../web/src/app/components/InvokeAIUI.tsx | 13 +- .../app/contexts/AddImageToBoardContext.tsx | 4 +- .../src/app/contexts/DeleteImageContext.tsx | 2 +- .../middleware/devtools/actionSanitizer.ts | 2 +- .../addCommitStagingAreaImageListener.ts | 10 +- .../listeners/boardIdSelected.ts | 33 +- .../listeners/canvasMerged.ts | 18 +- .../listeners/canvasSavedToGallery.ts | 14 +- .../listeners/controlNetImageProcessed.ts | 9 +- .../listeners/imageAddedToBoard.ts | 10 +- .../listeners/imageCategoriesChanged.ts | 4 +- .../listeners/imageDeleted.ts | 6 +- .../listeners/imageMetadataReceived.ts | 2 +- .../listeners/imageRemovedFromBoard.ts | 10 +- .../listeners/imageUpdated.ts | 2 +- .../listeners/imageUploaded.ts | 2 +- .../listeners/imageUrlsReceived.ts | 2 +- .../listeners/initialImageSelected.ts | 2 +- .../listeners/receivedPageOfImages.ts | 2 +- .../listeners/sessionCanceled.ts | 8 +- .../listeners/sessionCreated.ts | 2 +- .../listeners/sessionInvoked.ts | 8 +- .../listeners/sessionReadyToInvoke.ts | 12 +- .../listeners/socketio/socketConnected.ts | 6 +- .../socketio/socketInvocationComplete.ts | 16 +- .../listeners/stagingAreaImageSaved.ts | 2 +- .../listeners/updateImageUrlsOnConnect.ts | 5 +- .../listeners/userInvokedCanvas.ts | 38 +- .../listeners/userInvokedImageToImage.ts | 2 +- .../listeners/userInvokedNodes.ts | 2 +- .../listeners/userInvokedTextToImage.ts | 2 +- invokeai/frontend/web/src/app/store/store.ts | 2 +- .../web/src/common/components/IAIDndImage.tsx | 10 +- .../components/ImageMetadataOverlay.tsx | 2 +- .../src/common/components/ImageUploader.tsx | 8 +- .../canvas/components/IAICanvasImage.tsx | 4 +- .../web/src/features/canvas/store/actions.ts | 2 +- .../src/features/canvas/store/canvasSlice.ts | 6 +- .../src/features/canvas/store/canvasTypes.ts | 2 +- .../components/ControlNetImagePreview.tsx | 8 +- .../controlNet/store/controlNetSlice.ts | 12 +- .../src/features/controlNet/store/types.ts | 2 +- .../components/Boards/AddBoardButton.tsx | 2 +- .../components/Boards/AllImagesBoard.tsx | 4 +- .../gallery/components/Boards/BoardsList.tsx | 2 +- .../components/Boards/HoverableBoard.tsx | 11 +- .../Boards/UpdateImageBoardModal.tsx | 2 +- .../components/CurrentImagePreview.tsx | 12 +- .../gallery/components/HoverableImage.tsx | 4 +- .../components/ImageGalleryContent.tsx | 6 +- .../ImageMetadataViewer.tsx | 2 +- .../web/src/features/gallery/store/actions.ts | 2 +- .../src/features/gallery/store/boardSlice.ts | 2 +- .../src/features/gallery/store/imagesSlice.ts | 12 +- .../lightbox/components/ReactPanZoomImage.tsx | 2 +- .../fields/ImageInputFieldComponent.tsx | 6 +- .../fields/ModelInputFieldComponent.tsx | 2 +- .../components/panels/TopCenterPanel.tsx | 2 +- .../web/src/features/nodes/store/actions.ts | 2 +- .../src/features/nodes/store/nodesSlice.ts | 6 +- .../web/src/features/nodes/types/types.ts | 2 +- .../nodes/util/addControlNetToLinearGraph.ts | 2 +- .../nodes/util/edgeBuilders/buildEdges.ts | 2 +- .../util/graphBuilders/buildCanvasGraph.ts | 2 +- .../buildCanvasImageToImageGraph.ts | 2 +- .../graphBuilders/buildCanvasInpaintGraph.ts | 2 +- .../buildCanvasTextToImageGraph.ts | 2 +- .../buildLinearImageToImageGraph.ts | 2 +- .../buildLinearTextToImageGraph.ts | 2 +- .../util/graphBuilders/buildNodesGraph.ts | 2 +- .../nodes/util/modelIdToPipelineModelField.ts | 2 +- .../util/nodeBuilders/buildCompelNode.ts | 2 +- .../nodeBuilders/buildImageToImageNode.ts | 2 +- .../util/nodeBuilders/buildInpaintNode.ts | 2 +- .../util/nodeBuilders/buildIterateNode.ts | 2 +- .../nodes/util/nodeBuilders/buildRangeNode.ts | 2 +- .../util/nodeBuilders/buildTextToImageNode.ts | 2 +- .../ImageToImage/InitialImagePreview.tsx | 6 +- .../ProcessButtons/CancelButton.tsx | 4 +- .../parameters/hooks/useRecallParameters.ts | 4 +- .../src/features/parameters/store/actions.ts | 2 +- .../parameters/store/generationSlice.ts | 2 +- .../system/components/ModelSelect.tsx | 2 +- .../src/features/system/store/systemSlice.ts | 9 +- .../UnifiedCanvas/UnifiedCanvasContent.tsx | 2 +- .../frontend/web/src/services/api/client.ts | 33 + .../web/src/services/api/core/ApiError.ts | 24 - .../services/api/core/ApiRequestOptions.ts | 16 - .../web/src/services/api/core/ApiResult.ts | 10 - .../services/api/core/CancelablePromise.ts | 130 - .../web/src/services/api/core/OpenAPI.ts | 31 - .../web/src/services/api/core/request.ts | 353 -- .../src/services/api/endpoints/boardImages.ts | 66 + .../web/src/services/api/endpoints/boards.ts | 99 + .../web/src/services/api/endpoints/images.ts | 22 + .../web/src/services/api/endpoints/models.ts | 52 + .../web/src/services/{types => api}/guards.ts | 16 +- .../frontend/web/src/services/api/index.ts | 185 +- .../src/services/api/models/AddInvocation.ts | 27 - .../src/services/api/models/BaseModelType.ts | 8 - .../src/services/api/models/BoardChanges.ts | 15 - .../web/src/services/api/models/BoardDTO.ts | 38 - .../api/models/Body_create_board_image.ts | 15 - .../api/models/Body_remove_board_image.ts | 15 - .../services/api/models/Body_upload_image.ts | 8 - .../models/CannyImageProcessorInvocation.ts | 33 - .../src/services/api/models/CkptModelInfo.ts | 40 - .../web/src/services/api/models/ClipField.ts | 22 - .../services/api/models/CollectInvocation.ts | 27 - .../api/models/CollectInvocationOutput.ts | 15 - .../web/src/services/api/models/ColorField.ts | 23 - .../services/api/models/CompelInvocation.ts | 29 - .../src/services/api/models/CompelOutput.ts | 17 - .../services/api/models/ConditioningField.ts | 11 - .../ContentShuffleImageProcessorInvocation.ts | 45 - .../src/services/api/models/ControlField.ts | 29 - .../api/models/ControlNetInvocation.ts | 41 - .../api/models/ControlNetModelConfig.ts | 18 - .../api/models/ControlNetModelFormat.ts | 8 - .../src/services/api/models/ControlOutput.ts | 17 - .../services/api/models/CreateModelRequest.ts | 18 - .../api/models/CvInpaintInvocation.ts | 29 - .../services/api/models/DiffusersModelInfo.ts | 34 - .../services/api/models/DivideInvocation.ts | 27 - .../api/models/DynamicPromptInvocation.ts | 31 - .../web/src/services/api/models/Edge.ts | 17 - .../src/services/api/models/EdgeConnection.ts | 15 - .../api/models/FloatCollectionOutput.ts | 15 - .../api/models/FloatLinearRangeInvocation.ts | 31 - .../src/services/api/models/FloatOutput.ts | 15 - .../web/src/services/api/models/Graph.ts | 81 - .../api/models/GraphExecutionState.ts | 65 - .../services/api/models/GraphInvocation.ts | 25 - .../api/models/GraphInvocationOutput.ts | 11 - .../api/models/HTTPValidationError.ts | 10 - .../api/models/HedImageProcessorInvocation.ts | 37 - .../api/models/ImageBlurInvocation.ts | 33 - .../src/services/api/models/ImageCategory.ts | 14 - .../api/models/ImageChannelInvocation.ts | 29 - .../api/models/ImageConvertInvocation.ts | 29 - .../api/models/ImageCropInvocation.ts | 41 - .../web/src/services/api/models/ImageDTO.ts | 74 - .../web/src/services/api/models/ImageField.ts | 14 - .../api/models/ImageInverseLerpInvocation.ts | 33 - .../api/models/ImageLerpInvocation.ts | 33 - .../src/services/api/models/ImageMetadata.ts | 81 - .../api/models/ImageMultiplyInvocation.ts | 29 - .../src/services/api/models/ImageOutput.ts | 25 - .../api/models/ImagePasteInvocation.ts | 41 - .../api/models/ImageProcessorInvocation.ts | 25 - .../services/api/models/ImageRecordChanges.ts | 29 - .../api/models/ImageResizeInvocation.ts | 37 - .../api/models/ImageScaleInvocation.ts | 33 - .../api/models/ImageToLatentsInvocation.ts | 34 - .../src/services/api/models/ImageUrlsDTO.ts | 22 - .../api/models/InfillColorInvocation.ts | 30 - .../api/models/InfillPatchMatchInvocation.ts | 25 - .../api/models/InfillTileInvocation.ts | 33 - .../services/api/models/InpaintInvocation.ts | 121 - .../api/models/IntCollectionOutput.ts | 15 - .../web/src/services/api/models/IntOutput.ts | 15 - .../services/api/models/IterateInvocation.ts | 27 - .../api/models/IterateInvocationOutput.ts | 15 - .../src/services/api/models/LatentsField.ts | 14 - .../src/services/api/models/LatentsOutput.ts | 25 - .../api/models/LatentsToImageInvocation.ts | 34 - .../api/models/LatentsToLatentsInvocation.ts | 64 - .../LineartAnimeImageProcessorInvocation.ts | 33 - .../models/LineartImageProcessorInvocation.ts | 37 - .../services/api/models/LoRAModelConfig.ts | 18 - .../services/api/models/LoRAModelFormat.ts | 8 - .../api/models/LoadImageInvocation.ts | 25 - .../web/src/services/api/models/LoraInfo.ts | 31 - .../api/models/LoraLoaderInvocation.ts | 38 - .../services/api/models/LoraLoaderOutput.ts | 22 - .../api/models/MaskFromAlphaInvocation.ts | 29 - .../web/src/services/api/models/MaskOutput.ts | 25 - .../MediapipeFaceProcessorInvocation.ts | 33 - .../MidasDepthImageProcessorInvocation.ts | 33 - .../models/MlsdImageProcessorInvocation.ts | 41 - .../web/src/services/api/models/ModelError.ts | 8 - .../web/src/services/api/models/ModelInfo.ts | 27 - .../services/api/models/ModelLoaderOutput.ts | 27 - .../web/src/services/api/models/ModelType.ts | 8 - .../services/api/models/ModelVariantType.ts | 8 - .../web/src/services/api/models/ModelsList.ts | 17 - .../services/api/models/MultiplyInvocation.ts | 27 - .../services/api/models/NoiseInvocation.ts | 31 - .../src/services/api/models/NoiseOutput.ts | 25 - .../NormalbaeImageProcessorInvocation.ts | 33 - .../OffsetPaginatedResults_BoardDTO_.ts | 28 - .../OffsetPaginatedResults_ImageDTO_.ts | 28 - .../OpenposeImageProcessorInvocation.ts | 37 - .../PaginatedResults_GraphExecutionState_.ts | 32 - .../api/models/ParamFloatInvocation.ts | 23 - .../services/api/models/ParamIntInvocation.ts | 23 - .../models/PidiImageProcessorInvocation.ts | 41 - .../services/api/models/PipelineModelField.ts | 20 - .../models/PipelineModelLoaderInvocation.ts | 25 - .../api/models/PromptCollectionOutput.ts | 19 - .../src/services/api/models/PromptOutput.ts | 15 - .../api/models/RandomIntInvocation.ts | 27 - .../api/models/RandomRangeInvocation.ts | 35 - .../services/api/models/RangeInvocation.ts | 31 - .../api/models/RangeOfSizeInvocation.ts | 31 - .../api/models/ResizeLatentsInvocation.ts | 41 - .../src/services/api/models/ResourceOrigin.ts | 12 - .../api/models/RestoreFaceInvocation.ts | 29 - .../api/models/ScaleLatentsInvocation.ts | 37 - .../api/models/SchedulerPredictionType.ts | 8 - .../api/models/ShowImageInvocation.ts | 25 - .../StableDiffusion1ModelCheckpointConfig.ts | 21 - .../StableDiffusion1ModelDiffusersConfig.ts | 20 - .../api/models/StableDiffusion1ModelFormat.ts | 8 - .../StableDiffusion2ModelCheckpointConfig.ts | 24 - .../StableDiffusion2ModelDiffusersConfig.ts | 23 - .../api/models/StableDiffusion2ModelFormat.ts | 8 - .../api/models/StepParamEasingInvocation.ts | 59 - .../src/services/api/models/SubModelType.ts | 8 - .../services/api/models/SubtractInvocation.ts | 27 - .../api/models/TextToLatentsInvocation.ts | 56 - .../api/models/TextualInversionModelConfig.ts | 17 - .../web/src/services/api/models/UNetField.ts | 22 - .../services/api/models/UpscaleInvocation.ts | 33 - .../web/src/services/api/models/VaeField.ts | 13 - .../src/services/api/models/VaeModelConfig.ts | 18 - .../src/services/api/models/VaeModelFormat.ts | 8 - .../web/src/services/api/models/VaeRepo.ts | 19 - .../services/api/models/ValidationError.ts | 10 - .../ZoeDepthImageProcessorInvocation.ts | 25 - .../frontend/web/src/services/api/schema.d.ts | 5057 +++++++++++++++++ .../schemas/$CannyImageProcessorInvocation.ts | 31 - ...$ContentShuffleImageProcessorInvocation.ts | 43 - .../src/services/api/schemas/$ControlField.ts | 37 - .../api/schemas/$ControlNetInvocation.ts | 41 - .../services/api/schemas/$ControlOutput.ts | 28 - .../schemas/$HedImageprocessorInvocation.ts | 35 - .../api/schemas/$ImageProcessorInvocation.ts | 23 - .../$LineartAnimeImageProcessorInvocation.ts | 31 - .../$LineartImageProcessorInvocation.ts | 35 - .../$MidasDepthImageProcessorInvocation.ts | 31 - .../schemas/$MlsdImageProcessorInvocation.ts | 39 - .../$NormalbaeImageProcessorInvocation.ts | 31 - .../$OpenposeImageProcessorInvocation.ts | 35 - .../schemas/$PidiImageProcessorInvocation.ts | 39 - .../api/schemas/$RandomIntInvocation.ts | 16 - .../services/api/services/BoardsService.ts | 247 - .../services/api/services/ImagesService.ts | 279 - .../services/api/services/ModelsService.ts | 93 - .../services/api/services/SessionsService.ts | 413 -- .../web/src/services/api/thunks/image.ts | 320 ++ .../src/services/{ => api}/thunks/schema.ts | 0 .../web/src/services/api/thunks/session.ts | 170 + .../frontend/web/src/services/api/types.d.ts | 81 + .../frontend/web/src/services/apiSlice.ts | 246 - .../web/src/services/events/middleware.ts | 15 +- .../frontend/web/src/services/events/types.ts | 16 +- .../web/src/services/fixtures/openapi.json | 1 - .../web/src/services/fixtures/request.ts | 353 -- .../frontend/web/src/services/thunks/image.ts | 182 - .../web/src/services/thunks/session.ts | 123 - .../web/src/services/util/getHeaders.ts | 12 - invokeai/frontend/web/yarn.lock | 51 + 267 files changed, 6257 insertions(+), 7008 deletions(-) create mode 100644 invokeai/frontend/web/src/services/api/client.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/ApiError.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/ApiRequestOptions.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/ApiResult.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/CancelablePromise.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/OpenAPI.ts delete mode 100644 invokeai/frontend/web/src/services/api/core/request.ts create mode 100644 invokeai/frontend/web/src/services/api/endpoints/boardImages.ts create mode 100644 invokeai/frontend/web/src/services/api/endpoints/boards.ts create mode 100644 invokeai/frontend/web/src/services/api/endpoints/images.ts create mode 100644 invokeai/frontend/web/src/services/api/endpoints/models.ts rename invokeai/frontend/web/src/services/{types => api}/guards.ts (78%) delete mode 100644 invokeai/frontend/web/src/services/api/models/AddInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/BaseModelType.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/BoardChanges.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/BoardDTO.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/Body_create_board_image.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/Body_remove_board_image.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/Body_upload_image.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CannyImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CkptModelInfo.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ClipField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CollectInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CollectInvocationOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ColorField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CompelInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CompelOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ConditioningField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ContentShuffleImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ControlField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ControlNetInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ControlNetModelConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ControlNetModelFormat.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ControlOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CreateModelRequest.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/CvInpaintInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/DiffusersModelInfo.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/DivideInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/DynamicPromptInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/Edge.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/EdgeConnection.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/FloatCollectionOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/FloatLinearRangeInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/FloatOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/Graph.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/GraphExecutionState.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/GraphInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/GraphInvocationOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/HTTPValidationError.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/HedImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageBlurInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageCategory.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageChannelInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageConvertInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageCropInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageDTO.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageInverseLerpInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageLerpInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageMetadata.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageMultiplyInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImagePasteInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageRecordChanges.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageResizeInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageScaleInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageToLatentsInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ImageUrlsDTO.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/InfillColorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/InfillPatchMatchInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/InfillTileInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/InpaintInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/IntCollectionOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/IntOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/IterateInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/IterateInvocationOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LatentsField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LatentsOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LatentsToImageInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LatentsToLatentsInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LineartAnimeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LineartImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoRAModelConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoRAModelFormat.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoadImageInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoraInfo.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoraLoaderInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/LoraLoaderOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MaskFromAlphaInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MaskOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MediapipeFaceProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MidasDepthImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MlsdImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelError.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelInfo.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelLoaderOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelType.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelVariantType.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ModelsList.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/MultiplyInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/NoiseInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/NoiseOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/NormalbaeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_BoardDTO_.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_ImageDTO_.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/OpenposeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PaginatedResults_GraphExecutionState_.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ParamFloatInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ParamIntInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PidiImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PipelineModelField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PipelineModelLoaderInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PromptCollectionOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/PromptOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/RandomIntInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/RandomRangeInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/RangeInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/RangeOfSizeInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ResizeLatentsInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ResourceOrigin.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/RestoreFaceInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ScaleLatentsInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/SchedulerPredictionType.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ShowImageInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelCheckpointConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelDiffusersConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelFormat.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelCheckpointConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelDiffusersConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelFormat.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/StepParamEasingInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/SubModelType.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/SubtractInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/TextToLatentsInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/TextualInversionModelConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/UNetField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/UpscaleInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/VaeField.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/VaeModelConfig.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/VaeModelFormat.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/VaeRepo.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ValidationError.ts delete mode 100644 invokeai/frontend/web/src/services/api/models/ZoeDepthImageProcessorInvocation.ts create mode 100644 invokeai/frontend/web/src/services/api/schema.d.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$CannyImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$ContentShuffleImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$ControlField.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$ControlNetInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$ControlOutput.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$HedImageprocessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$ImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$LineartAnimeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$LineartImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$MidasDepthImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$MlsdImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$NormalbaeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$OpenposeImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$PidiImageProcessorInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/schemas/$RandomIntInvocation.ts delete mode 100644 invokeai/frontend/web/src/services/api/services/BoardsService.ts delete mode 100644 invokeai/frontend/web/src/services/api/services/ImagesService.ts delete mode 100644 invokeai/frontend/web/src/services/api/services/ModelsService.ts delete mode 100644 invokeai/frontend/web/src/services/api/services/SessionsService.ts create mode 100644 invokeai/frontend/web/src/services/api/thunks/image.ts rename invokeai/frontend/web/src/services/{ => api}/thunks/schema.ts (100%) create mode 100644 invokeai/frontend/web/src/services/api/thunks/session.ts create mode 100644 invokeai/frontend/web/src/services/api/types.d.ts delete mode 100644 invokeai/frontend/web/src/services/apiSlice.ts delete mode 100644 invokeai/frontend/web/src/services/fixtures/openapi.json delete mode 100644 invokeai/frontend/web/src/services/fixtures/request.ts delete mode 100644 invokeai/frontend/web/src/services/thunks/image.ts delete mode 100644 invokeai/frontend/web/src/services/thunks/session.ts delete mode 100644 invokeai/frontend/web/src/services/util/getHeaders.ts diff --git a/invokeai/frontend/web/package.json b/invokeai/frontend/web/package.json index c072a9d95c..d3d6c2e737 100644 --- a/invokeai/frontend/web/package.json +++ b/invokeai/frontend/web/package.json @@ -23,8 +23,7 @@ "dev": "concurrently \"vite dev\" \"yarn run theme:watch\"", "dev:host": "concurrently \"vite dev --host\" \"yarn run theme:watch\"", "build": "yarn run lint && vite build", - "api:web": "openapi -i http://localhost:9090/openapi.json -o src/services/api --client axios --useOptions --useUnionTypes --indent 2 --request src/services/fixtures/request.ts", - "api:file": "openapi -i src/services/fixtures/openapi.json -o src/services/api --client axios --useOptions --useUnionTypes --indent 2 --request src/services/fixtures/request.ts", + "typegen": "npx openapi-typescript http://localhost:9090/openapi.json --output src/services/schema.d.ts -t", "preview": "vite preview", "lint:madge": "madge --circular src/main.tsx", "lint:eslint": "eslint --max-warnings=0 .", @@ -81,6 +80,8 @@ "i18next-http-backend": "^2.2.0", "konva": "^9.0.1", "lodash-es": "^4.17.21", + "nanostores": "^0.9.2", + "openapi-fetch": "^0.4.0", "overlayscrollbars": "^2.1.1", "overlayscrollbars-react": "^0.5.0", "patch-package": "^7.0.0", @@ -140,6 +141,7 @@ "lint-staged": "^13.2.2", "madge": "^6.0.0", "openapi-types": "^12.1.0", + "openapi-typescript": "^6.2.8", "openapi-typescript-codegen": "^0.24.0", "postinstall-postinstall": "^2.1.0", "prettier": "^2.8.8", diff --git a/invokeai/frontend/web/src/app/components/App.tsx b/invokeai/frontend/web/src/app/components/App.tsx index 55fcc97745..3f1f2cf7a6 100644 --- a/invokeai/frontend/web/src/app/components/App.tsx +++ b/invokeai/frontend/web/src/app/components/App.tsx @@ -24,7 +24,7 @@ import Toaster from './Toaster'; import DeleteImageModal from 'features/gallery/components/DeleteImageModal'; import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale'; import UpdateImageBoardModal from '../../features/gallery/components/Boards/UpdateImageBoardModal'; -import { useListModelsQuery } from 'services/apiSlice'; +import { useListModelsQuery } from 'services/api/endpoints/models'; const DEFAULT_CONFIG = {}; diff --git a/invokeai/frontend/web/src/app/components/ImageDnd/ImageDndContext.tsx b/invokeai/frontend/web/src/app/components/ImageDnd/ImageDndContext.tsx index 104073c023..6150259f66 100644 --- a/invokeai/frontend/web/src/app/components/ImageDnd/ImageDndContext.tsx +++ b/invokeai/frontend/web/src/app/components/ImageDnd/ImageDndContext.tsx @@ -11,8 +11,8 @@ import { } from '@dnd-kit/core'; import { PropsWithChildren, memo, useCallback, useState } from 'react'; import OverlayDragImage from './OverlayDragImage'; -import { ImageDTO } from 'services/api'; -import { isImageDTO } from 'services/types/guards'; +import { ImageDTO } from 'services/api/types'; +import { isImageDTO } from 'services/api/guards'; import { snapCenterToCursor } from '@dnd-kit/modifiers'; import { AnimatePresence, motion } from 'framer-motion'; diff --git a/invokeai/frontend/web/src/app/components/ImageDnd/OverlayDragImage.tsx b/invokeai/frontend/web/src/app/components/ImageDnd/OverlayDragImage.tsx index 510dadc823..611d1ceee9 100644 --- a/invokeai/frontend/web/src/app/components/ImageDnd/OverlayDragImage.tsx +++ b/invokeai/frontend/web/src/app/components/ImageDnd/OverlayDragImage.tsx @@ -1,6 +1,6 @@ import { Box, Image } from '@chakra-ui/react'; import { memo } from 'react'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; type OverlayDragImageProps = { image: ImageDTO; diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 141e62652d..4d83a407c0 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -7,7 +7,7 @@ import React, { } from 'react'; import { Provider } from 'react-redux'; import { store } from 'app/store/store'; -import { OpenAPI } from 'services/api'; +// import { OpenAPI } from 'services/api/types'; import Loading from '../../common/components/Loading/Loading'; import { addMiddleware, resetMiddlewares } from 'redux-dynamic-middlewares'; @@ -23,6 +23,7 @@ import { } from 'app/contexts/DeleteImageContext'; import UpdateImageBoardModal from '../../features/gallery/components/Boards/UpdateImageBoardModal'; import { AddImageToBoardContextProvider } from '../contexts/AddImageToBoardContext'; +import { $authToken, $baseUrl } from 'services/api/client'; const App = lazy(() => import('./App')); const ThemeLocaleProvider = lazy(() => import('./ThemeLocaleProvider')); @@ -47,12 +48,12 @@ const InvokeAIUI = ({ useEffect(() => { // configure API client token if (token) { - OpenAPI.TOKEN = token; + $authToken.set(token); } // configure API client base url if (apiUrl) { - OpenAPI.BASE = apiUrl; + $baseUrl.set(apiUrl); } // reset dynamically added middlewares @@ -69,6 +70,12 @@ const InvokeAIUI = ({ } else { addMiddleware(socketMiddleware()); } + + return () => { + // Reset the API client token and base url on unmount + $baseUrl.set(undefined); + $authToken.set(undefined); + }; }, [apiUrl, token, middleware]); return ( diff --git a/invokeai/frontend/web/src/app/contexts/AddImageToBoardContext.tsx b/invokeai/frontend/web/src/app/contexts/AddImageToBoardContext.tsx index f5a856d3d8..f37f06d4b1 100644 --- a/invokeai/frontend/web/src/app/contexts/AddImageToBoardContext.tsx +++ b/invokeai/frontend/web/src/app/contexts/AddImageToBoardContext.tsx @@ -1,7 +1,7 @@ import { useDisclosure } from '@chakra-ui/react'; import { PropsWithChildren, createContext, useCallback, useState } from 'react'; -import { ImageDTO } from 'services/api'; -import { useAddImageToBoardMutation } from 'services/apiSlice'; +import { ImageDTO } from 'services/api/types'; +import { useAddImageToBoardMutation } from 'services/api/endpoints/boardImages'; export type ImageUsage = { isInitialImage: boolean; diff --git a/invokeai/frontend/web/src/app/contexts/DeleteImageContext.tsx b/invokeai/frontend/web/src/app/contexts/DeleteImageContext.tsx index d01298944b..b59649a5f8 100644 --- a/invokeai/frontend/web/src/app/contexts/DeleteImageContext.tsx +++ b/invokeai/frontend/web/src/app/contexts/DeleteImageContext.tsx @@ -11,7 +11,7 @@ import { useEffect, useState, } from 'react'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { RootState } from 'app/store/store'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { controlNetSelector } from 'features/controlNet/store/controlNetSlice'; diff --git a/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts b/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts index 24b85e0f83..227b15d6f8 100644 --- a/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts +++ b/invokeai/frontend/web/src/app/store/middleware/devtools/actionSanitizer.ts @@ -1,7 +1,7 @@ import { AnyAction } from '@reduxjs/toolkit'; import { isAnyGraphBuilt } from 'features/nodes/store/actions'; import { forEach } from 'lodash-es'; -import { Graph } from 'services/api'; +import { Graph } from 'services/api/types'; export const actionSanitizer = (action: A): A => { if (isAnyGraphBuilt(action)) { diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/addCommitStagingAreaImageListener.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/addCommitStagingAreaImageListener.ts index 90f71879a1..322cc51fa7 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/addCommitStagingAreaImageListener.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/addCommitStagingAreaImageListener.ts @@ -1,7 +1,7 @@ import { startAppListening } from '..'; import { log } from 'app/logging/useLogger'; import { commitStagingAreaImage } from 'features/canvas/store/canvasSlice'; -import { sessionCanceled } from 'services/thunks/session'; +import { sessionCanceled } from 'services/api/thunks/session'; const moduleLog = log.child({ namespace: 'canvas' }); @@ -10,7 +10,7 @@ export const addCommitStagingAreaImageListener = () => { actionCreator: commitStagingAreaImage, effect: async (action, { dispatch, getState }) => { const state = getState(); - const { sessionId, isProcessing } = state.system; + const { sessionId: session_id, isProcessing } = state.system; const canvasSessionId = action.payload; if (!isProcessing) { @@ -23,12 +23,12 @@ export const addCommitStagingAreaImageListener = () => { return; } - if (canvasSessionId !== sessionId) { + if (canvasSessionId !== session_id) { moduleLog.debug( { data: { canvasSessionId, - sessionId, + session_id, }, }, 'Canvas session does not match global session, skipping cancel' @@ -36,7 +36,7 @@ export const addCommitStagingAreaImageListener = () => { return; } - dispatch(sessionCanceled({ sessionId })); + dispatch(sessionCanceled({ session_id })); }, }); }; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts index eab4389ceb..160ea33a1f 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts @@ -2,9 +2,12 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; import { boardIdSelected } from 'features/gallery/store/boardSlice'; import { selectImagesAll } from 'features/gallery/store/imagesSlice'; -import { IMAGES_PER_PAGE, receivedPageOfImages } from 'services/thunks/image'; -import { api } from 'services/apiSlice'; +import { + IMAGES_PER_PAGE, + receivedPageOfImages, +} from 'services/api/thunks/image'; import { imageSelected } from 'features/gallery/store/gallerySlice'; +import { boardsApi } from 'services/api/endpoints/boards'; const moduleLog = log.child({ namespace: 'boards' }); @@ -12,14 +15,14 @@ export const addBoardIdSelectedListener = () => { startAppListening({ actionCreator: boardIdSelected, effect: (action, { getState, dispatch }) => { - const boardId = action.payload; + const board_id = action.payload; // we need to check if we need to fetch more images const state = getState(); const allImages = selectImagesAll(state); - if (!boardId) { + if (!board_id) { // a board was unselected dispatch(imageSelected(allImages[0]?.image_name)); return; @@ -29,13 +32,14 @@ export const addBoardIdSelectedListener = () => { const filteredImages = allImages.filter((i) => { const isInCategory = categories.includes(i.image_category); - const isInSelectedBoard = boardId ? i.board_id === boardId : true; + const isInSelectedBoard = board_id ? i.board_id === board_id : true; return isInCategory && isInSelectedBoard; }); // get the board from the cache - const { data: boards } = api.endpoints.listAllBoards.select()(state); - const board = boards?.find((b) => b.board_id === boardId); + const { data: boards } = + boardsApi.endpoints.listAllBoards.select()(state); + const board = boards?.find((b) => b.board_id === board_id); if (!board) { // can't find the board in cache... @@ -50,7 +54,7 @@ export const addBoardIdSelectedListener = () => { filteredImages.length < board.image_count && filteredImages.length < IMAGES_PER_PAGE ) { - dispatch(receivedPageOfImages({ categories, boardId })); + dispatch(receivedPageOfImages({ categories, board_id })); } }, }); @@ -60,13 +64,13 @@ export const addBoardIdSelected_changeSelectedImage_listener = () => { startAppListening({ actionCreator: boardIdSelected, effect: (action, { getState, dispatch }) => { - const boardId = action.payload; + const board_id = action.payload; const state = getState(); // we need to check if we need to fetch more images - if (!boardId) { + if (!board_id) { // a board was unselected - we don't need to do anything return; } @@ -75,13 +79,14 @@ export const addBoardIdSelected_changeSelectedImage_listener = () => { const filteredImages = selectImagesAll(state).filter((i) => { const isInCategory = categories.includes(i.image_category); - const isInSelectedBoard = boardId ? i.board_id === boardId : true; + const isInSelectedBoard = board_id ? i.board_id === board_id : true; return isInCategory && isInSelectedBoard; }); // get the board from the cache - const { data: boards } = api.endpoints.listAllBoards.select()(state); - const board = boards?.find((b) => b.board_id === boardId); + const { data: boards } = + boardsApi.endpoints.listAllBoards.select()(state); + const board = boards?.find((b) => b.board_id === board_id); if (!board) { // can't find the board in cache... return; @@ -92,7 +97,7 @@ export const addBoardIdSelected_changeSelectedImage_listener = () => { filteredImages.length < board.image_count && filteredImages.length < IMAGES_PER_PAGE ) { - dispatch(receivedPageOfImages({ categories, boardId })); + dispatch(receivedPageOfImages({ categories, board_id })); } }, }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts index dd77e66c67..ce135ab3d0 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasMerged.ts @@ -2,7 +2,7 @@ import { canvasMerged } from 'features/canvas/store/actions'; import { startAppListening } from '..'; import { log } from 'app/logging/useLogger'; import { addToast } from 'features/system/store/systemSlice'; -import { imageUploaded } from 'services/thunks/image'; +import { imageUploaded } from 'services/api/thunks/image'; import { setMergedCanvas } from 'features/canvas/store/canvasSlice'; import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider'; import { getFullBaseLayerBlob } from 'features/canvas/util/getFullBaseLayerBlob'; @@ -47,13 +47,11 @@ export const addCanvasMergedListener = () => { const imageUploadedRequest = dispatch( imageUploaded({ - formData: { - file: new File([blob], 'mergedCanvas.png', { - type: 'image/png', - }), - }, - imageCategory: 'general', - isIntermediate: true, + file: new File([blob], 'mergedCanvas.png', { + type: 'image/png', + }), + image_category: 'general', + is_intermediate: true, postUploadAction: { type: 'TOAST_CANVAS_MERGED', }, @@ -68,13 +66,13 @@ export const addCanvasMergedListener = () => { uploadedImageAction.meta.requestId === imageUploadedRequest.requestId ); - const mergedCanvasImage = payload; + const { image_name } = payload; dispatch( setMergedCanvas({ kind: 'image', layer: 'base', - image: mergedCanvasImage, + imageName: image_name, ...baseLayerRect, }) ); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasSavedToGallery.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasSavedToGallery.ts index b53b08cd27..af55a1382e 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasSavedToGallery.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasSavedToGallery.ts @@ -1,7 +1,7 @@ import { canvasSavedToGallery } from 'features/canvas/store/actions'; import { startAppListening } from '..'; import { log } from 'app/logging/useLogger'; -import { imageUploaded } from 'services/thunks/image'; +import { imageUploaded } from 'services/api/thunks/image'; import { getBaseLayerBlob } from 'features/canvas/util/getBaseLayerBlob'; import { addToast } from 'features/system/store/systemSlice'; import { imageUpserted } from 'features/gallery/store/imagesSlice'; @@ -30,13 +30,11 @@ export const addCanvasSavedToGalleryListener = () => { const imageUploadedRequest = dispatch( imageUploaded({ - formData: { - file: new File([blob], 'savedCanvas.png', { - type: 'image/png', - }), - }, - imageCategory: 'general', - isIntermediate: false, + file: new File([blob], 'savedCanvas.png', { + type: 'image/png', + }), + image_category: 'general', + is_intermediate: false, postUploadAction: { type: 'TOAST_CANVAS_SAVED_TO_GALLERY', }, diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/controlNetImageProcessed.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/controlNetImageProcessed.ts index 7ff9a5118c..3e11a5f98b 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/controlNetImageProcessed.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/controlNetImageProcessed.ts @@ -1,14 +1,13 @@ import { startAppListening } from '..'; -import { imageMetadataReceived } from 'services/thunks/image'; +import { imageMetadataReceived } from 'services/api/thunks/image'; import { log } from 'app/logging/useLogger'; import { controlNetImageProcessed } from 'features/controlNet/store/actions'; -import { Graph } from 'services/api'; -import { sessionCreated } from 'services/thunks/session'; +import { Graph } from 'services/api/types'; +import { sessionCreated } from 'services/api/thunks/session'; import { sessionReadyToInvoke } from 'features/system/store/actions'; import { socketInvocationComplete } from 'services/events/actions'; -import { isImageOutput } from 'services/types/guards'; +import { isImageOutput } from 'services/api/guards'; import { controlNetProcessedImageChanged } from 'features/controlNet/store/controlNetSlice'; -import { pick } from 'lodash-es'; const moduleLog = log.child({ namespace: 'controlNet' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageAddedToBoard.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageAddedToBoard.ts index 0f404cab68..082dfc0efb 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageAddedToBoard.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageAddedToBoard.ts @@ -1,13 +1,13 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { imageMetadataReceived } from 'services/thunks/image'; -import { api } from 'services/apiSlice'; +import { imageMetadataReceived } from 'services/api/thunks/image'; +import { boardImagesApi } from 'services/api/endpoints/boardImages'; const moduleLog = log.child({ namespace: 'boards' }); export const addImageAddedToBoardFulfilledListener = () => { startAppListening({ - matcher: api.endpoints.addImageToBoard.matchFulfilled, + matcher: boardImagesApi.endpoints.addImageToBoard.matchFulfilled, effect: (action, { getState, dispatch }) => { const { board_id, image_name } = action.meta.arg.originalArgs; @@ -18,7 +18,7 @@ export const addImageAddedToBoardFulfilledListener = () => { dispatch( imageMetadataReceived({ - imageName: image_name, + image_name, }) ); }, @@ -27,7 +27,7 @@ export const addImageAddedToBoardFulfilledListener = () => { export const addImageAddedToBoardRejectedListener = () => { startAppListening({ - matcher: api.endpoints.addImageToBoard.matchRejected, + matcher: boardImagesApi.endpoints.addImageToBoard.matchRejected, effect: (action, { getState, dispatch }) => { const { board_id, image_name } = action.meta.arg.originalArgs; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts index 8f01b8d7b8..747d8789da 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { receivedPageOfImages } from 'services/thunks/image'; +import { receivedPageOfImages } from 'services/api/thunks/image'; import { imageCategoriesChanged, selectFilteredImagesAsArray, @@ -19,7 +19,7 @@ export const addImageCategoriesChangedListener = () => { dispatch( receivedPageOfImages({ categories: action.payload, - boardId: state.boards.selectedBoardId, + board_id: state.boards.selectedBoardId, }) ); } diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts index 224aa0d2aa..91cd509ca6 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeleted.ts @@ -1,6 +1,6 @@ import { requestedImageDeletion } from 'features/gallery/store/actions'; import { startAppListening } from '..'; -import { imageDeleted } from 'services/thunks/image'; +import { imageDeleted } from 'services/api/thunks/image'; import { log } from 'app/logging/useLogger'; import { clamp } from 'lodash-es'; import { imageSelected } from 'features/gallery/store/gallerySlice'; @@ -12,7 +12,7 @@ import { resetCanvas } from 'features/canvas/store/canvasSlice'; import { controlNetReset } from 'features/controlNet/store/controlNetSlice'; import { clearInitialImage } from 'features/parameters/store/generationSlice'; import { nodeEditorReset } from 'features/nodes/store/nodesSlice'; -import { api } from 'services/apiSlice'; +import { api } from 'services/api'; const moduleLog = log.child({ namespace: 'image' }); @@ -76,7 +76,7 @@ export const addRequestedImageDeletionListener = () => { dispatch(imageRemoved(image_name)); // Delete from server - const { requestId } = dispatch(imageDeleted({ imageName: image_name })); + const { requestId } = dispatch(imageDeleted({ image_name })); // Wait for successful deletion, then trigger boards to re-fetch const wasImageDeleted = await condition( diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageMetadataReceived.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageMetadataReceived.ts index ed308f08a8..7615f980f5 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageMetadataReceived.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageMetadataReceived.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { imageMetadataReceived, imageUpdated } from 'services/thunks/image'; +import { imageMetadataReceived, imageUpdated } from 'services/api/thunks/image'; import { imageUpserted } from 'features/gallery/store/imagesSlice'; const moduleLog = log.child({ namespace: 'image' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageRemovedFromBoard.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageRemovedFromBoard.ts index 40847ade3a..5c056474e3 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageRemovedFromBoard.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageRemovedFromBoard.ts @@ -1,13 +1,13 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { imageMetadataReceived } from 'services/thunks/image'; -import { api } from 'services/apiSlice'; +import { imageMetadataReceived } from 'services/api/thunks/image'; +import { boardImagesApi } from 'services/api/endpoints/boardImages'; const moduleLog = log.child({ namespace: 'boards' }); export const addImageRemovedFromBoardFulfilledListener = () => { startAppListening({ - matcher: api.endpoints.removeImageFromBoard.matchFulfilled, + matcher: boardImagesApi.endpoints.removeImageFromBoard.matchFulfilled, effect: (action, { getState, dispatch }) => { const { board_id, image_name } = action.meta.arg.originalArgs; @@ -18,7 +18,7 @@ export const addImageRemovedFromBoardFulfilledListener = () => { dispatch( imageMetadataReceived({ - imageName: image_name, + image_name, }) ); }, @@ -27,7 +27,7 @@ export const addImageRemovedFromBoardFulfilledListener = () => { export const addImageRemovedFromBoardRejectedListener = () => { startAppListening({ - matcher: api.endpoints.removeImageFromBoard.matchRejected, + matcher: boardImagesApi.endpoints.removeImageFromBoard.matchRejected, effect: (action, { getState, dispatch }) => { const { board_id, image_name } = action.meta.arg.originalArgs; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUpdated.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUpdated.ts index 6f8b46ec23..2e235aeb33 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUpdated.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUpdated.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { imageUpdated } from 'services/thunks/image'; +import { imageUpdated } from 'services/api/thunks/image'; import { log } from 'app/logging/useLogger'; const moduleLog = log.child({ namespace: 'image' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts index fc44d206c8..f55ed11c8f 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { imageUploaded } from 'services/thunks/image'; +import { imageUploaded } from 'services/api/thunks/image'; import { addToast } from 'features/system/store/systemSlice'; import { log } from 'app/logging/useLogger'; import { imageUpserted } from 'features/gallery/store/imagesSlice'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUrlsReceived.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUrlsReceived.ts index 2e365a20ac..c663c64361 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUrlsReceived.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUrlsReceived.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { imageUrlsReceived } from 'services/thunks/image'; +import { imageUrlsReceived } from 'services/api/thunks/image'; import { imageUpdatedOne } from 'features/gallery/store/imagesSlice'; const moduleLog = log.child({ namespace: 'image' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/initialImageSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/initialImageSelected.ts index 9069e477ac..9aca82a32b 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/initialImageSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/initialImageSelected.ts @@ -5,7 +5,7 @@ import { startAppListening } from '..'; import { initialImageSelected } from 'features/parameters/store/actions'; import { makeToast } from 'app/components/Toaster'; import { selectImagesById } from 'features/gallery/store/imagesSlice'; -import { isImageDTO } from 'services/types/guards'; +import { isImageDTO } from 'services/api/guards'; export const addInitialImageSelectedListener = () => { startAppListening({ diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/receivedPageOfImages.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/receivedPageOfImages.ts index cde7e22e3d..e357d38dc3 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/receivedPageOfImages.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/receivedPageOfImages.ts @@ -1,7 +1,7 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; import { serializeError } from 'serialize-error'; -import { receivedPageOfImages } from 'services/thunks/image'; +import { receivedPageOfImages } from 'services/api/thunks/image'; const moduleLog = log.child({ namespace: 'gallery' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCanceled.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCanceled.ts index 6274ad4dc8..85e2627d88 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCanceled.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCanceled.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { sessionCanceled } from 'services/thunks/session'; +import { sessionCanceled } from 'services/api/thunks/session'; import { serializeError } from 'serialize-error'; const moduleLog = log.child({ namespace: 'session' }); @@ -18,10 +18,10 @@ export const addSessionCanceledFulfilledListener = () => { startAppListening({ actionCreator: sessionCanceled.fulfilled, effect: (action, { getState, dispatch }) => { - const { sessionId } = action.meta.arg; + const { session_id } = action.meta.arg; moduleLog.debug( - { data: { sessionId } }, - `Session canceled (${sessionId})` + { data: { session_id } }, + `Session canceled (${session_id})` ); }, }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCreated.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCreated.ts index fb8a64d2e3..c502b4e38c 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCreated.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionCreated.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { sessionCreated } from 'services/thunks/session'; +import { sessionCreated } from 'services/api/thunks/session'; import { serializeError } from 'serialize-error'; const moduleLog = log.child({ namespace: 'session' }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionInvoked.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionInvoked.ts index 272d1d9e1d..6aff246cbe 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionInvoked.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionInvoked.ts @@ -1,6 +1,6 @@ import { log } from 'app/logging/useLogger'; import { startAppListening } from '..'; -import { sessionInvoked } from 'services/thunks/session'; +import { sessionInvoked } from 'services/api/thunks/session'; import { serializeError } from 'serialize-error'; const moduleLog = log.child({ namespace: 'session' }); @@ -18,10 +18,10 @@ export const addSessionInvokedFulfilledListener = () => { startAppListening({ actionCreator: sessionInvoked.fulfilled, effect: (action, { getState, dispatch }) => { - const { sessionId } = action.meta.arg; + const { session_id } = action.meta.arg; moduleLog.debug( - { data: { sessionId } }, - `Session invoked (${sessionId})` + { data: { session_id } }, + `Session invoked (${session_id})` ); }, }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionReadyToInvoke.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionReadyToInvoke.ts index 8d4262e7da..cc77403709 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionReadyToInvoke.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/sessionReadyToInvoke.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { sessionInvoked } from 'services/thunks/session'; +import { sessionInvoked } from 'services/api/thunks/session'; import { log } from 'app/logging/useLogger'; import { sessionReadyToInvoke } from 'features/system/store/actions'; @@ -9,13 +9,13 @@ export const addSessionReadyToInvokeListener = () => { startAppListening({ actionCreator: sessionReadyToInvoke, effect: (action, { getState, dispatch }) => { - const { sessionId } = getState().system; - if (sessionId) { + const { sessionId: session_id } = getState().system; + if (session_id) { moduleLog.debug( - { sessionId }, - `Session ready to invoke (${sessionId})})` + { session_id }, + `Session ready to invoke (${session_id})})` ); - dispatch(sessionInvoked({ sessionId })); + dispatch(sessionInvoked({ session_id })); } }, }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts index bf54e63836..976c1558d0 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts @@ -1,7 +1,7 @@ import { log } from 'app/logging/useLogger'; import { appSocketConnected, socketConnected } from 'services/events/actions'; -import { receivedPageOfImages } from 'services/thunks/image'; -import { receivedOpenAPISchema } from 'services/thunks/schema'; +import { receivedPageOfImages } from 'services/api/thunks/image'; +import { receivedOpenAPISchema } from 'services/api/thunks/schema'; import { startAppListening } from '../..'; const moduleLog = log.child({ namespace: 'socketio' }); @@ -22,7 +22,7 @@ export const addSocketConnectedEventListener = () => { dispatch( receivedPageOfImages({ categories: ['general'], - isIntermediate: false, + is_intermediate: false, }) ); } diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete.ts index c204f0bdfb..01ea6c4440 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete.ts @@ -5,11 +5,11 @@ import { appSocketInvocationComplete, socketInvocationComplete, } from 'services/events/actions'; -import { imageMetadataReceived } from 'services/thunks/image'; -import { sessionCanceled } from 'services/thunks/session'; -import { isImageOutput } from 'services/types/guards'; +import { imageMetadataReceived } from 'services/api/thunks/image'; +import { sessionCanceled } from 'services/api/thunks/session'; +import { isImageOutput } from 'services/api/guards'; import { progressImageSet } from 'features/system/store/systemSlice'; -import { api } from 'services/apiSlice'; +import { api } from 'services/api'; const moduleLog = log.child({ namespace: 'socketio' }); const nodeDenylist = ['dataURL_image']; @@ -19,18 +19,18 @@ export const addInvocationCompleteEventListener = () => { actionCreator: socketInvocationComplete, effect: async (action, { dispatch, getState, take }) => { moduleLog.debug( - action.payload, + { data: action.payload }, `Invocation complete (${action.payload.data.node.type})` ); - const sessionId = action.payload.data.graph_execution_state_id; + const session_id = action.payload.data.graph_execution_state_id; const { cancelType, isCancelScheduled, boardIdToAddTo } = getState().system; // Handle scheduled cancelation if (cancelType === 'scheduled' && isCancelScheduled) { - dispatch(sessionCanceled({ sessionId })); + dispatch(sessionCanceled({ session_id })); } const { data } = action.payload; @@ -43,7 +43,7 @@ export const addInvocationCompleteEventListener = () => { // Get its metadata dispatch( imageMetadataReceived({ - imageName: image_name, + image_name, }) ); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved.ts index 3e211f73bb..90c230e458 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved.ts @@ -1,7 +1,7 @@ import { stagingAreaImageSaved } from 'features/canvas/store/actions'; import { startAppListening } from '..'; import { log } from 'app/logging/useLogger'; -import { imageUpdated } from 'services/thunks/image'; +import { imageUpdated } from 'services/api/thunks/image'; import { imageUpserted } from 'features/gallery/store/imagesSlice'; import { addToast } from 'features/system/store/systemSlice'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/updateImageUrlsOnConnect.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/updateImageUrlsOnConnect.ts index b9ddcea4c3..72313a75a3 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/updateImageUrlsOnConnect.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/updateImageUrlsOnConnect.ts @@ -5,9 +5,8 @@ import { generationSelector } from 'features/parameters/store/generationSelector import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { nodesSelecter } from 'features/nodes/store/nodesSlice'; import { controlNetSelector } from 'features/controlNet/store/controlNetSlice'; -import { ImageDTO } from 'services/api'; import { forEach, uniqBy } from 'lodash-es'; -import { imageUrlsReceived } from 'services/thunks/image'; +import { imageUrlsReceived } from 'services/api/thunks/image'; import { log } from 'app/logging/useLogger'; import { selectImagesEntities } from 'features/gallery/store/imagesSlice'; @@ -83,7 +82,7 @@ export const addUpdateImageUrlsOnConnectListener = () => { allUsedImages.forEach((image_name) => { dispatch( imageUrlsReceived({ - imageName: image_name, + image_name, }) ); }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedCanvas.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedCanvas.ts index a26d872d50..1f9f773392 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedCanvas.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedCanvas.ts @@ -1,10 +1,10 @@ import { startAppListening } from '..'; -import { sessionCreated } from 'services/thunks/session'; +import { sessionCreated } from 'services/api/thunks/session'; import { buildCanvasGraph } from 'features/nodes/util/graphBuilders/buildCanvasGraph'; import { log } from 'app/logging/useLogger'; import { canvasGraphBuilt } from 'features/nodes/store/actions'; -import { imageUpdated, imageUploaded } from 'services/thunks/image'; -import { ImageDTO } from 'services/api'; +import { imageUpdated, imageUploaded } from 'services/api/thunks/image'; +import { ImageDTO } from 'services/api/types'; import { canvasSessionIdChanged, stagingAreaInitialized, @@ -75,13 +75,11 @@ export const addUserInvokedCanvasListener = () => { // upload the image, saving the request id const { requestId: initImageUploadedRequestId } = dispatch( imageUploaded({ - formData: { - file: new File([baseBlob], 'canvasInitImage.png', { - type: 'image/png', - }), - }, - imageCategory: 'general', - isIntermediate: true, + file: new File([baseBlob], 'canvasInitImage.png', { + type: 'image/png', + }), + image_category: 'general', + is_intermediate: true, }) ); @@ -100,13 +98,11 @@ export const addUserInvokedCanvasListener = () => { // upload the image, saving the request id const { requestId: maskImageUploadedRequestId } = dispatch( imageUploaded({ - formData: { - file: new File([maskBlob], 'canvasMaskImage.png', { - type: 'image/png', - }), - }, - imageCategory: 'mask', - isIntermediate: true, + file: new File([maskBlob], 'canvasMaskImage.png', { + type: 'image/png', + }), + image_category: 'mask', + is_intermediate: true, }) ); @@ -149,8 +145,8 @@ export const addUserInvokedCanvasListener = () => { if (['img2img', 'inpaint'].includes(generationMode) && canvasInitImage) { dispatch( imageUpdated({ - imageName: canvasInitImage.image_name, - requestBody: { session_id: sessionId }, + image_name: canvasInitImage.image_name, + session_id: sessionId, }) ); } @@ -159,8 +155,8 @@ export const addUserInvokedCanvasListener = () => { if (['inpaint'].includes(generationMode) && canvasMaskImage) { dispatch( imageUpdated({ - imageName: canvasMaskImage.image_name, - requestBody: { session_id: sessionId }, + image_name: canvasMaskImage.image_name, + session_id: sessionId, }) ); } diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedImageToImage.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedImageToImage.ts index 368d97a10f..202dd6f487 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedImageToImage.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedImageToImage.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { sessionCreated } from 'services/thunks/session'; +import { sessionCreated } from 'services/api/thunks/session'; import { log } from 'app/logging/useLogger'; import { imageToImageGraphBuilt } from 'features/nodes/store/actions'; import { userInvoked } from 'app/store/actions'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedNodes.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedNodes.ts index 6fda3db0d6..9fb0009b70 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedNodes.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedNodes.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { sessionCreated } from 'services/thunks/session'; +import { sessionCreated } from 'services/api/thunks/session'; import { buildNodesGraph } from 'features/nodes/util/graphBuilders/buildNodesGraph'; import { log } from 'app/logging/useLogger'; import { nodesGraphBuilt } from 'features/nodes/store/actions'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedTextToImage.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedTextToImage.ts index c76e0dfd4f..b024e94d9c 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedTextToImage.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/userInvokedTextToImage.ts @@ -1,5 +1,5 @@ import { startAppListening } from '..'; -import { sessionCreated } from 'services/thunks/session'; +import { sessionCreated } from 'services/api/thunks/session'; import { log } from 'app/logging/useLogger'; import { textToImageGraphBuilt } from 'features/nodes/store/actions'; import { userInvoked } from 'app/store/actions'; diff --git a/invokeai/frontend/web/src/app/store/store.ts b/invokeai/frontend/web/src/app/store/store.ts index 57a97168a3..8202c4fa76 100644 --- a/invokeai/frontend/web/src/app/store/store.ts +++ b/invokeai/frontend/web/src/app/store/store.ts @@ -31,7 +31,7 @@ import { stateSanitizer } from './middleware/devtools/stateSanitizer'; import { LOCALSTORAGE_PREFIX } from './constants'; import { serialize } from './enhancers/reduxRemember/serialize'; import { unserialize } from './enhancers/reduxRemember/unserialize'; -import { api } from 'services/apiSlice'; +import { api } from 'services/api'; const allReducers = { canvas: canvasReducer, diff --git a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx index e54b4a8872..4b95fc36df 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx @@ -15,10 +15,10 @@ import { AnimatePresence } from 'framer-motion'; import { ReactElement, SyntheticEvent, useCallback } from 'react'; import { memo, useRef } from 'react'; import { FaImage, FaTimes, FaUndo, FaUpload } from 'react-icons/fa'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { v4 as uuidv4 } from 'uuid'; import IAIDropOverlay from './IAIDropOverlay'; -import { PostUploadAction, imageUploaded } from 'services/thunks/image'; +import { PostUploadAction, imageUploaded } from 'services/api/thunks/image'; import { useDropzone } from 'react-dropzone'; import { useAppDispatch } from 'app/store/storeHooks'; @@ -96,9 +96,9 @@ const IAIDndImage = (props: IAIDndImageProps) => { dispatch( imageUploaded({ - formData: { file }, - imageCategory: 'user', - isIntermediate: false, + file, + image_category: 'user', + is_intermediate: false, postUploadAction, }) ); diff --git a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx index e3bee9797b..60c4e95cc0 100644 --- a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx @@ -1,7 +1,7 @@ import { Badge, Flex } from '@chakra-ui/react'; import { isString } from 'lodash-es'; import { useMemo } from 'react'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; type ImageMetadataOverlayProps = { image: ImageDTO; diff --git a/invokeai/frontend/web/src/common/components/ImageUploader.tsx b/invokeai/frontend/web/src/common/components/ImageUploader.tsx index 82d5584224..d3565ff5ec 100644 --- a/invokeai/frontend/web/src/common/components/ImageUploader.tsx +++ b/invokeai/frontend/web/src/common/components/ImageUploader.tsx @@ -12,7 +12,7 @@ import { } from 'react'; import { FileRejection, useDropzone } from 'react-dropzone'; import { useTranslation } from 'react-i18next'; -import { imageUploaded } from 'services/thunks/image'; +import { imageUploaded } from 'services/api/thunks/image'; import ImageUploadOverlay from './ImageUploadOverlay'; import { useAppToaster } from 'app/components/Toaster'; import { createSelector } from '@reduxjs/toolkit'; @@ -62,9 +62,9 @@ const ImageUploader = (props: ImageUploaderProps) => { async (file: File) => { dispatch( imageUploaded({ - formData: { file }, - imageCategory: 'user', - isIntermediate: false, + file, + image_category: 'user', + is_intermediate: false, postUploadAction: { type: 'TOAST_UPLOADED' }, }) ); diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasImage.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasImage.tsx index c3132f0285..ca838d9922 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasImage.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasImage.tsx @@ -1,6 +1,6 @@ import { skipToken } from '@reduxjs/toolkit/dist/query'; import { Image, Rect } from 'react-konva'; -import { useGetImageDTOQuery } from 'services/apiSlice'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import useImage from 'use-image'; import { CanvasImage } from '../store/canvasTypes'; @@ -9,7 +9,7 @@ type IAICanvasImageProps = { }; const IAICanvasImage = (props: IAICanvasImageProps) => { const { width, height, x, y, imageName } = props.canvasImage; - const { data: imageDTO } = useGetImageDTOQuery(imageName ?? skipToken); + const { currentData: imageDTO } = useGetImageDTOQuery(imageName ?? skipToken); const [image] = useImage(imageDTO?.image_url ?? '', 'anonymous'); if (!imageDTO) { diff --git a/invokeai/frontend/web/src/features/canvas/store/actions.ts b/invokeai/frontend/web/src/features/canvas/store/actions.ts index 207484200a..67aceb0822 100644 --- a/invokeai/frontend/web/src/features/canvas/store/actions.ts +++ b/invokeai/frontend/web/src/features/canvas/store/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; export const canvasSavedToGallery = createAction('canvas/canvasSavedToGallery'); diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts index 3e40c1211d..371719e087 100644 --- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts @@ -28,13 +28,13 @@ import { isCanvasBaseImage, isCanvasMaskLine, } from './canvasTypes'; -import { ImageDTO } from 'services/api'; -import { sessionCanceled } from 'services/thunks/session'; +import { ImageDTO } from 'services/api/types'; +import { sessionCanceled } from 'services/api/thunks/session'; import { setActiveTab, setShouldUseCanvasBetaLayout, } from 'features/ui/store/uiSlice'; -import { imageUrlsReceived } from 'services/thunks/image'; +import { imageUrlsReceived } from 'services/api/thunks/image'; export const initialLayerState: CanvasLayerState = { objects: [], diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasTypes.ts b/invokeai/frontend/web/src/features/canvas/store/canvasTypes.ts index 9294e10d32..54eafd9780 100644 --- a/invokeai/frontend/web/src/features/canvas/store/canvasTypes.ts +++ b/invokeai/frontend/web/src/features/canvas/store/canvasTypes.ts @@ -1,7 +1,7 @@ import * as InvokeAI from 'app/types/invokeai'; import { IRect, Vector2d } from 'konva/lib/types'; import { RgbaColor } from 'react-colorful'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; export const LAYER_NAMES_DICT = [ { label: 'Base', value: 'base' }, diff --git a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx index 217caf9461..ba173f7715 100644 --- a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx +++ b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx @@ -1,5 +1,5 @@ import { memo, useCallback, useState } from 'react'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { ControlNetConfig, controlNetImageChanged, @@ -14,7 +14,7 @@ import { AnimatePresence, motion } from 'framer-motion'; import { IAIImageLoadingFallback } from 'common/components/IAIImageFallback'; import IAIIconButton from 'common/components/IAIIconButton'; import { FaUndo } from 'react-icons/fa'; -import { useGetImageDTOQuery } from 'services/apiSlice'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { skipToken } from '@reduxjs/toolkit/dist/query'; const selector = createSelector( @@ -45,14 +45,14 @@ const ControlNetImagePreview = (props: Props) => { const [isMouseOverImage, setIsMouseOverImage] = useState(false); const { - data: controlImage, + currentData: controlImage, isLoading: isLoadingControlImage, isError: isErrorControlImage, isSuccess: isSuccessControlImage, } = useGetImageDTOQuery(controlImageName ?? skipToken); const { - data: processedControlImage, + currentData: processedControlImage, isLoading: isLoadingProcessedControlImage, isError: isErrorProcessedControlImage, isSuccess: isSuccessProcessedControlImage, diff --git a/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts b/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts index 5a54bdcd74..f1748c830b 100644 --- a/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts +++ b/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts @@ -1,7 +1,7 @@ import { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { ControlNetProcessorType, RequiredCannyImageProcessorInvocation, @@ -13,9 +13,9 @@ import { ControlNetModelName, } from './constants'; import { controlNetImageProcessed } from './actions'; -import { imageDeleted, imageUrlsReceived } from 'services/thunks/image'; +import { imageDeleted, imageUrlsReceived } from 'services/api/thunks/image'; import { forEach } from 'lodash-es'; -import { isAnySessionRejected } from 'services/thunks/session'; +import { isAnySessionRejected } from 'services/api/thunks/session'; import { appSocketInvocationError } from 'services/events/actions'; export const initialControlNet: Omit = { @@ -258,13 +258,13 @@ export const controlNetSlice = createSlice({ builder.addCase(imageDeleted.pending, (state, action) => { // Preemptively remove the image from the gallery - const { imageName } = action.meta.arg; + const { image_name } = action.meta.arg; forEach(state.controlNets, (c) => { - if (c.controlImage === imageName) { + if (c.controlImage === image_name) { c.controlImage = null; c.processedControlImage = null; } - if (c.processedControlImage === imageName) { + if (c.processedControlImage === image_name) { c.processedControlImage = null; } }); diff --git a/invokeai/frontend/web/src/features/controlNet/store/types.ts b/invokeai/frontend/web/src/features/controlNet/store/types.ts index 4ee15b39b9..2d028fd0bb 100644 --- a/invokeai/frontend/web/src/features/controlNet/store/types.ts +++ b/invokeai/frontend/web/src/features/controlNet/store/types.ts @@ -12,7 +12,7 @@ import { OpenposeImageProcessorInvocation, PidiImageProcessorInvocation, ZoeDepthImageProcessorInvocation, -} from 'services/api'; +} from 'services/api/types'; import { O } from 'ts-toolbelt'; /** diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/AddBoardButton.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/AddBoardButton.tsx index 632cebcb33..a08fdec07f 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/AddBoardButton.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/AddBoardButton.tsx @@ -1,6 +1,6 @@ import IAIButton from 'common/components/IAIButton'; import { useCallback } from 'react'; -import { useCreateBoardMutation } from 'services/apiSlice'; +import { useCreateBoardMutation } from 'services/api/endpoints/boards'; const DEFAULT_BOARD_NAME = 'My Board'; diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/AllImagesBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/AllImagesBoard.tsx index e506c88e2d..ae1b1a29ae 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/AllImagesBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/AllImagesBoard.tsx @@ -6,8 +6,8 @@ import { IAINoImageFallback } from 'common/components/IAIImageFallback'; import { AnimatePresence } from 'framer-motion'; import { SelectedItemOverlay } from '../SelectedItemOverlay'; import { useCallback } from 'react'; -import { ImageDTO } from 'services/api'; -import { useRemoveImageFromBoardMutation } from 'services/apiSlice'; +import { ImageDTO } from 'services/api/types'; +import { useRemoveImageFromBoardMutation } from 'services/api/endpoints/boardImages'; import { useDroppable } from '@dnd-kit/core'; import IAIDropOverlay from 'common/components/IAIDropOverlay'; diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList.tsx index 738693a278..21eba1a0a8 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList.tsx @@ -20,7 +20,7 @@ import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; import AddBoardButton from './AddBoardButton'; import AllImagesBoard from './AllImagesBoard'; import { CloseIcon } from '@chakra-ui/icons'; -import { useListAllBoardsQuery } from 'services/apiSlice'; +import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; const selector = createSelector( [boardsSelector], diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/HoverableBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/HoverableBoard.tsx index a2c07e4870..ba43f792bf 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/HoverableBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/HoverableBoard.tsx @@ -14,15 +14,16 @@ import { useAppDispatch } from 'app/store/storeHooks'; import { memo, useCallback } from 'react'; import { FaFolder, FaTrash } from 'react-icons/fa'; import { ContextMenu } from 'chakra-ui-contextmenu'; -import { BoardDTO, ImageDTO } from 'services/api'; +import { BoardDTO, ImageDTO } from 'services/api/types'; import { IAINoImageFallback } from 'common/components/IAIImageFallback'; import { boardIdSelected } from 'features/gallery/store/boardSlice'; +import { useAddImageToBoardMutation } from 'services/api/endpoints/boardImages'; import { - useAddImageToBoardMutation, useDeleteBoardMutation, - useGetImageDTOQuery, useUpdateBoardMutation, -} from 'services/apiSlice'; +} from 'services/api/endpoints/boards'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; + import { skipToken } from '@reduxjs/toolkit/dist/query'; import { useDroppable } from '@dnd-kit/core'; import { AnimatePresence } from 'framer-motion'; @@ -37,7 +38,7 @@ interface HoverableBoardProps { const HoverableBoard = memo(({ board, isSelected }: HoverableBoardProps) => { const dispatch = useAppDispatch(); - const { data: coverImage } = useGetImageDTOQuery( + const { currentData: coverImage } = useGetImageDTOQuery( board.cover_image_name ?? skipToken ); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/UpdateImageBoardModal.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/UpdateImageBoardModal.tsx index b16bddd6b4..a98e8dca34 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/UpdateImageBoardModal.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/UpdateImageBoardModal.tsx @@ -15,7 +15,7 @@ import IAIButton from 'common/components/IAIButton'; import { memo, useContext, useRef, useState } from 'react'; import { AddImageToBoardContext } from '../../../../app/contexts/AddImageToBoardContext'; import IAIMantineSelect from 'common/components/IAIMantineSelect'; -import { useListAllBoardsQuery } from 'services/apiSlice'; +import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; const UpdateImageBoardModal = () => { // const boards = useSelector(selectBoardsAll); diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx index 5426fee3b1..b0998d128f 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImagePreview.tsx @@ -11,9 +11,9 @@ import { memo, useCallback } from 'react'; import { systemSelector } from 'features/system/store/systemSelectors'; import { imageSelected } from '../store/gallerySlice'; import IAIDndImage from 'common/components/IAIDndImage'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { IAIImageLoadingFallback } from 'common/components/IAIImageFallback'; -import { useGetImageDTOQuery } from 'services/apiSlice'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { skipToken } from '@reduxjs/toolkit/dist/query'; export const imagesSelector = createSelector( @@ -56,7 +56,7 @@ const CurrentImagePreview = () => { // ); const { - data: image, + currentData: image, isLoading, isError, isSuccess, @@ -110,14 +110,14 @@ const CurrentImagePreview = () => { }} > } isUploadDisabled={true} /> )} - {shouldShowImageDetails && image && selectedImage && ( + {shouldShowImageDetails && image && ( { )} - {!shouldShowImageDetails && image && selectedImage && ( + {!shouldShowImageDetails && image && ( state], @@ -167,7 +167,7 @@ const ImageGalleryContent = () => { dispatch( receivedPageOfImages({ categories, - boardId: selectedBoardId, + board_id: selectedBoardId, }) ); }, [categories, dispatch, selectedBoardId]); diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx index e5cb4cf4a8..e150cea883 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx @@ -17,7 +17,7 @@ import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; import { FaCopy } from 'react-icons/fa'; import { IoArrowUndoCircleOutline } from 'react-icons/io5'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; type MetadataItemProps = { isLink?: boolean; diff --git a/invokeai/frontend/web/src/features/gallery/store/actions.ts b/invokeai/frontend/web/src/features/gallery/store/actions.ts index 8b2beb9c13..aa767b1422 100644 --- a/invokeai/frontend/web/src/features/gallery/store/actions.ts +++ b/invokeai/frontend/web/src/features/gallery/store/actions.ts @@ -1,6 +1,6 @@ import { createAction } from '@reduxjs/toolkit'; import { ImageUsage } from 'app/contexts/DeleteImageContext'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; export type RequestedImageDeletionArg = { image: ImageDTO; diff --git a/invokeai/frontend/web/src/features/gallery/store/boardSlice.ts b/invokeai/frontend/web/src/features/gallery/store/boardSlice.ts index 8fc9bfa486..4e8af0a832 100644 --- a/invokeai/frontend/web/src/features/gallery/store/boardSlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/boardSlice.ts @@ -1,6 +1,6 @@ import { PayloadAction, createSlice } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { api } from 'services/apiSlice'; +import { api } from 'services/api'; type BoardsState = { searchText: string; diff --git a/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts b/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts index 25a3341532..4bdaa796cd 100644 --- a/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts @@ -6,14 +6,14 @@ import { createSlice, } from '@reduxjs/toolkit'; import { RootState } from 'app/store/store'; -import { ImageCategory, ImageDTO } from 'services/api'; +import { ImageCategory, ImageDTO } from 'services/api/types'; import { dateComparator } from 'common/util/dateComparator'; import { keyBy } from 'lodash-es'; import { imageDeleted, imageUrlsReceived, receivedPageOfImages, -} from 'services/thunks/image'; +} from 'services/api/thunks/image'; export const imagesAdapter = createEntityAdapter({ selectId: (image) => image.image_name, @@ -73,13 +73,13 @@ const imagesSlice = createSlice({ }); builder.addCase(receivedPageOfImages.fulfilled, (state, action) => { state.isLoading = false; - const { boardId, categories, imageOrigin, isIntermediate } = + const { board_id, categories, image_origin, is_intermediate } = action.meta.arg; const { items, offset, limit, total } = action.payload; imagesAdapter.upsertMany(state, items); - if (!categories?.includes('general') || boardId) { + if (!categories?.includes('general') || board_id) { // need to skip updating the total images count if the images recieved were for a specific board // TODO: this doesn't work when on the Asset tab/category... return; @@ -91,8 +91,8 @@ const imagesSlice = createSlice({ }); builder.addCase(imageDeleted.pending, (state, action) => { // Image deleted - const { imageName } = action.meta.arg; - imagesAdapter.removeOne(state, imageName); + const { image_name } = action.meta.arg; + imagesAdapter.removeOne(state, image_name); }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { const { image_name, image_url, thumbnail_url } = action.payload; diff --git a/invokeai/frontend/web/src/features/lightbox/components/ReactPanZoomImage.tsx b/invokeai/frontend/web/src/features/lightbox/components/ReactPanZoomImage.tsx index 7ec7d23371..73e7144163 100644 --- a/invokeai/frontend/web/src/features/lightbox/components/ReactPanZoomImage.tsx +++ b/invokeai/frontend/web/src/features/lightbox/components/ReactPanZoomImage.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { TransformComponent, useTransformContext } from 'react-zoom-pan-pinch'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; type ReactPanZoomProps = { image: ImageDTO; diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/ImageInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/ImageInputFieldComponent.tsx index c5a3a1970b..1107cb1706 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/ImageInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/ImageInputFieldComponent.tsx @@ -9,9 +9,9 @@ import { memo, useCallback } from 'react'; import { FieldComponentProps } from './types'; import IAIDndImage from 'common/components/IAIDndImage'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { Flex } from '@chakra-ui/react'; -import { useGetImageDTOQuery } from 'services/apiSlice'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { skipToken } from '@reduxjs/toolkit/dist/query'; const ImageInputFieldComponent = ( @@ -22,7 +22,7 @@ const ImageInputFieldComponent = ( const dispatch = useAppDispatch(); const { - data: image, + currentData: image, isLoading, isError, isSuccess, diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx index c274f23f26..895d763882 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/ModelInputFieldComponent.tsx @@ -12,7 +12,7 @@ import { forEach, isString } from 'lodash-es'; import { MODEL_TYPE_MAP as BASE_MODEL_NAME_MAP } from 'features/system/components/ModelSelect'; import IAIMantineSelect from 'common/components/IAIMantineSelect'; import { useTranslation } from 'react-i18next'; -import { useListModelsQuery } from 'services/apiSlice'; +import { useListModelsQuery } from 'services/api/endpoints/models'; const ModelInputFieldComponent = ( props: FieldComponentProps diff --git a/invokeai/frontend/web/src/features/nodes/components/panels/TopCenterPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/panels/TopCenterPanel.tsx index b961a9f403..17920af501 100644 --- a/invokeai/frontend/web/src/features/nodes/components/panels/TopCenterPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/panels/TopCenterPanel.tsx @@ -3,7 +3,7 @@ import { useAppDispatch } from 'app/store/storeHooks'; import IAIButton from 'common/components/IAIButton'; import { memo, useCallback } from 'react'; import { Panel } from 'reactflow'; -import { receivedOpenAPISchema } from 'services/thunks/schema'; +import { receivedOpenAPISchema } from 'services/api/thunks/schema'; import NodeInvokeButton from '../ui/NodeInvokeButton'; const TopCenterPanel = () => { diff --git a/invokeai/frontend/web/src/features/nodes/store/actions.ts b/invokeai/frontend/web/src/features/nodes/store/actions.ts index eda753b9dc..2463a1e945 100644 --- a/invokeai/frontend/web/src/features/nodes/store/actions.ts +++ b/invokeai/frontend/web/src/features/nodes/store/actions.ts @@ -1,5 +1,5 @@ import { createAction, isAnyOf } from '@reduxjs/toolkit'; -import { Graph } from 'services/api'; +import { Graph } from 'services/api/types'; export const textToImageGraphBuilt = createAction( 'nodes/textToImageGraphBuilt' diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index 341f0c467b..00b4c82c58 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -11,14 +11,14 @@ import { NodeChange, OnConnectStartParams, } from 'reactflow'; -import { ImageDTO } from 'services/api'; -import { receivedOpenAPISchema } from 'services/thunks/schema'; +import { ImageDTO } from 'services/api/types'; +import { receivedOpenAPISchema } from 'services/api/thunks/schema'; import { InvocationTemplate, InvocationValue } from '../types/types'; import { parseSchema } from '../util/parseSchema'; import { log } from 'app/logging/useLogger'; import { forEach, size } from 'lodash-es'; import { RgbaColor } from 'react-colorful'; -import { imageUrlsReceived } from 'services/thunks/image'; +import { imageUrlsReceived } from 'services/api/thunks/image'; import { RootState } from 'app/store/store'; export type NodesState = { diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts index acad10cf48..376667972f 100644 --- a/invokeai/frontend/web/src/features/nodes/types/types.ts +++ b/invokeai/frontend/web/src/features/nodes/types/types.ts @@ -1,6 +1,6 @@ import { OpenAPIV3 } from 'openapi-types'; import { RgbaColor } from 'react-colorful'; -import { Graph, ImageDTO } from 'services/api'; +import { Graph, ImageDTO } from 'services/api/types'; import { AnyInvocationType } from 'services/events/types'; import { O } from 'ts-toolbelt'; diff --git a/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts index 314af85193..13d4457129 100644 --- a/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts @@ -1,6 +1,6 @@ import { RootState } from 'app/store/store'; import { filter, forEach, size } from 'lodash-es'; -import { CollectInvocation, ControlNetInvocation } from 'services/api'; +import { CollectInvocation, ControlNetInvocation } from 'services/api/types'; import { NonNullableGraph } from '../types/types'; import { CONTROL_NET_COLLECT } from './graphBuilders/constants'; diff --git a/invokeai/frontend/web/src/features/nodes/util/edgeBuilders/buildEdges.ts b/invokeai/frontend/web/src/features/nodes/util/edgeBuilders/buildEdges.ts index a1e9837647..1c3d2c909e 100644 --- a/invokeai/frontend/web/src/features/nodes/util/edgeBuilders/buildEdges.ts +++ b/invokeai/frontend/web/src/features/nodes/util/edgeBuilders/buildEdges.ts @@ -6,7 +6,7 @@ import { RandomRangeInvocation, RangeInvocation, TextToImageInvocation, -} from 'services/api'; +} from 'services/api/types'; export const buildEdges = ( baseNode: TextToImageInvocation | ImageToImageInvocation | InpaintInvocation, diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasGraph.ts index 3ea513fe7e..3b2816844b 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasGraph.ts @@ -1,5 +1,5 @@ import { RootState } from 'app/store/store'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { log } from 'app/logging/useLogger'; import { forEach } from 'lodash-es'; import { buildCanvasInpaintGraph } from './buildCanvasInpaintGraph'; diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts index ccdc3e0a27..cf46b1226d 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts @@ -4,7 +4,7 @@ import { ImageResizeInvocation, RandomIntInvocation, RangeOfSizeInvocation, -} from 'services/api'; +} from 'services/api/types'; import { NonNullableGraph } from 'features/nodes/types/types'; import { log } from 'app/logging/useLogger'; import { diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasInpaintGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasInpaintGraph.ts index 9ffe85b3c9..eb2399771a 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasInpaintGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasInpaintGraph.ts @@ -4,7 +4,7 @@ import { InpaintInvocation, RandomIntInvocation, RangeOfSizeInvocation, -} from 'services/api'; +} from 'services/api/types'; import { NonNullableGraph } from 'features/nodes/types/types'; import { log } from 'app/logging/useLogger'; import { diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts index 920cb5bf02..251ad94165 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts @@ -1,6 +1,6 @@ import { RootState } from 'app/store/store'; import { NonNullableGraph } from 'features/nodes/types/types'; -import { RandomIntInvocation, RangeOfSizeInvocation } from 'services/api'; +import { RandomIntInvocation, RangeOfSizeInvocation } from 'services/api/types'; import { ITERATE, LATENTS_TO_IMAGE, diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearImageToImageGraph.ts index 8425ac043a..d488accd0a 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearImageToImageGraph.ts @@ -3,7 +3,7 @@ import { ImageResizeInvocation, RandomIntInvocation, RangeOfSizeInvocation, -} from 'services/api'; +} from 'services/api/types'; import { NonNullableGraph } from 'features/nodes/types/types'; import { log } from 'app/logging/useLogger'; import { diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts index 973acdfb77..b8bdb1efd0 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearTextToImageGraph.ts @@ -4,7 +4,7 @@ import { BaseModelType, RandomIntInvocation, RangeOfSizeInvocation, -} from 'services/api'; +} from 'services/api/types'; import { ITERATE, LATENTS_TO_IMAGE, diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildNodesGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildNodesGraph.ts index 072b1a53fd..091899a21a 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildNodesGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildNodesGraph.ts @@ -1,4 +1,4 @@ -import { Graph } from 'services/api'; +import { Graph } from 'services/api/types'; import { v4 as uuidv4 } from 'uuid'; import { cloneDeep, omit, reduce } from 'lodash-es'; import { RootState } from 'app/store/store'; diff --git a/invokeai/frontend/web/src/features/nodes/util/modelIdToPipelineModelField.ts b/invokeai/frontend/web/src/features/nodes/util/modelIdToPipelineModelField.ts index bbcd8d9bc6..0941255181 100644 --- a/invokeai/frontend/web/src/features/nodes/util/modelIdToPipelineModelField.ts +++ b/invokeai/frontend/web/src/features/nodes/util/modelIdToPipelineModelField.ts @@ -1,4 +1,4 @@ -import { BaseModelType, PipelineModelField } from 'services/api'; +import { BaseModelType, PipelineModelField } from 'services/api/types'; /** * Crudely converts a model id to a pipeline model field diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildCompelNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildCompelNode.ts index 02ac148181..8499c21f0b 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildCompelNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildCompelNode.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; import { RootState } from 'app/store/store'; -import { CompelInvocation } from 'services/api'; +import { CompelInvocation } from 'services/api/types'; import { O } from 'ts-toolbelt'; export const buildCompelNode = ( diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts index 6ebd014876..0e0e498370 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts @@ -4,7 +4,7 @@ import { Edge, ImageToImageInvocation, TextToImageInvocation, -} from 'services/api'; +} from 'services/api/types'; import { O } from 'ts-toolbelt'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildInpaintNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildInpaintNode.ts index 593658e536..91b5128931 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildInpaintNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildInpaintNode.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; import { RootState } from 'app/store/store'; -import { InpaintInvocation } from 'services/api'; +import { InpaintInvocation } from 'services/api/types'; import { O } from 'ts-toolbelt'; export const buildInpaintNode = ( diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildIterateNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildIterateNode.ts index 4f1b8d8930..12e4e0e6e3 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildIterateNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildIterateNode.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; -import { IterateInvocation } from 'services/api'; +import { IterateInvocation } from 'services/api/types'; export const buildIterateNode = (): IterateInvocation => { const nodeId = uuidv4(); diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildRangeNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildRangeNode.ts index 735c0ef726..a18a210f20 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildRangeNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildRangeNode.ts @@ -1,7 +1,7 @@ import { v4 as uuidv4 } from 'uuid'; import { RootState } from 'app/store/store'; -import { RandomRangeInvocation, RangeInvocation } from 'services/api'; +import { RandomRangeInvocation, RangeInvocation } from 'services/api/types'; export const buildRangeNode = ( state: RootState diff --git a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildTextToImageNode.ts b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildTextToImageNode.ts index 64e7aaa831..efe5f50d9c 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildTextToImageNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildTextToImageNode.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; import { RootState } from 'app/store/store'; -import { TextToImageInvocation } from 'services/api'; +import { TextToImageInvocation } from 'services/api/types'; import { O } from 'ts-toolbelt'; export const buildTxt2ImgNode = ( diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/ImageToImage/InitialImagePreview.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/ImageToImage/InitialImagePreview.tsx index fbfa00e2a1..83f04b4c5a 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/ImageToImage/InitialImagePreview.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/ImageToImage/InitialImagePreview.tsx @@ -9,9 +9,9 @@ import { useCallback } from 'react'; import { generationSelector } from 'features/parameters/store/generationSelectors'; import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions'; import IAIDndImage from 'common/components/IAIDndImage'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { IAIImageLoadingFallback } from 'common/components/IAIImageFallback'; -import { useGetImageDTOQuery } from 'services/apiSlice'; +import { useGetImageDTOQuery } from 'services/api/endpoints/images'; import { skipToken } from '@reduxjs/toolkit/dist/query'; const selector = createSelector( @@ -30,7 +30,7 @@ const InitialImagePreview = () => { const dispatch = useAppDispatch(); const { - data: image, + currentData: image, isLoading, isError, isSuccess, diff --git a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx index 57b556f88c..701a6ac4df 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ProcessButtons/CancelButton.tsx @@ -26,7 +26,7 @@ import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; import { MdCancel, MdCancelScheduleSend } from 'react-icons/md'; -import { sessionCanceled } from 'services/thunks/session'; +import { sessionCanceled } from 'services/api/thunks/session'; import { ChevronDownIcon } from '@chakra-ui/icons'; const cancelButtonSelector = createSelector( @@ -78,7 +78,7 @@ const CancelButton = ( return; } - dispatch(sessionCanceled({ sessionId })); + dispatch(sessionCanceled({ session_id: sessionId })); }, [dispatch, sessionId, cancelType]); const { t } = useTranslation(); diff --git a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts index 7b7a405867..f504c62ed6 100644 --- a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts +++ b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts @@ -13,10 +13,10 @@ import { setSteps, setWidth, } from '../store/generationSlice'; -import { isImageField } from 'services/types/guards'; +import { isImageField } from 'services/api/guards'; import { initialImageSelected } from '../store/actions'; import { useAppToaster } from 'app/components/Toaster'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { isValidCfgScale, isValidHeight, diff --git a/invokeai/frontend/web/src/features/parameters/store/actions.ts b/invokeai/frontend/web/src/features/parameters/store/actions.ts index e9f708fc03..2fb56c0883 100644 --- a/invokeai/frontend/web/src/features/parameters/store/actions.ts +++ b/invokeai/frontend/web/src/features/parameters/store/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; export const initialImageSelected = createAction( 'generation/initialImageSelected' diff --git a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts index e7dcbf0d83..c8e65314da 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -3,7 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'; import { DEFAULT_SCHEDULER_NAME } from 'app/constants'; import { configChanged } from 'features/system/store/configSlice'; import { clamp } from 'lodash-es'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { CfgScaleParam, HeightParam, diff --git a/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx b/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx index 43de14d507..916f70ef9a 100644 --- a/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx +++ b/invokeai/frontend/web/src/features/system/components/ModelSelect.tsx @@ -8,7 +8,7 @@ import { modelSelected } from 'features/parameters/store/generationSlice'; import { forEach, isString } from 'lodash-es'; import { SelectItem } from '@mantine/core'; import { RootState } from 'app/store/store'; -import { useListModelsQuery } from 'services/apiSlice'; +import { useListModelsQuery } from 'services/api/endpoints/models'; export const MODEL_TYPE_MAP = { 'sd-1': 'Stable Diffusion 1.x', diff --git a/invokeai/frontend/web/src/features/system/store/systemSlice.ts b/invokeai/frontend/web/src/features/system/store/systemSlice.ts index 688f69c1f7..fe6cf7386a 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSlice.ts @@ -19,8 +19,11 @@ import { appSocketUnsubscribed, } from 'services/events/actions'; import { ProgressImage } from 'services/events/types'; -import { imageUploaded } from 'services/thunks/image'; -import { isAnySessionRejected, sessionCanceled } from 'services/thunks/session'; +import { imageUploaded } from 'services/api/thunks/image'; +import { + isAnySessionRejected, + sessionCanceled, +} from 'services/api/thunks/session'; import { makeToast } from '../../../app/components/Toaster'; import { LANGUAGES } from '../components/LanguagePicker'; @@ -362,7 +365,7 @@ export const systemSlice = createSlice({ * Session Canceled - FULFILLED */ builder.addCase(sessionCanceled.fulfilled, (state, action) => { - state.canceledSession = action.meta.arg.sessionId; + state.canceledSession = action.meta.arg.session_id; state.isProcessing = false; state.isCancelable = false; state.isCancelScheduled = false; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx index 898f7db839..d4b75fec1d 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasContent.tsx @@ -12,7 +12,7 @@ import { uiSelector } from 'features/ui/store/uiSelectors'; import { memo, useCallback, useLayoutEffect } from 'react'; import UnifiedCanvasToolbarBeta from './UnifiedCanvasBeta/UnifiedCanvasToolbarBeta'; import UnifiedCanvasToolSettingsBeta from './UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta'; -import { ImageDTO } from 'services/api'; +import { ImageDTO } from 'services/api/types'; import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice'; import { useDroppable } from '@dnd-kit/core'; import IAIDropOverlay from 'common/components/IAIDropOverlay'; diff --git a/invokeai/frontend/web/src/services/api/client.ts b/invokeai/frontend/web/src/services/api/client.ts new file mode 100644 index 0000000000..dd4caa460e --- /dev/null +++ b/invokeai/frontend/web/src/services/api/client.ts @@ -0,0 +1,33 @@ +import { atom, computed } from 'nanostores'; +import createClient from 'openapi-fetch'; +import { paths } from 'services/api/schema'; + +/** + * We use nanostores to store the token and base url for very simple reactivity + */ + +/** + * The user's auth token. + */ +export const $authToken = atom(); + +/** + * The OpenAPI base url. + */ +export const $baseUrl = atom(); + +/** + * Autogenerated, type-safe fetch client for the API. Used when RTK Query is not an option. + * Dynamically updates when the token or base url changes. + * Use `$client.get()` to get the client. + * + * @example + * const { get, post, del } = $client.get(); + */ +export const $client = computed([$authToken, $baseUrl], (authToken, baseUrl) => + createClient({ + headers: authToken ? { Authorization: `Bearer ${authToken}` } : {}, + // do not include `api/v1` in the base url for this client + baseUrl: `${baseUrl ?? ''}`, + }) +); diff --git a/invokeai/frontend/web/src/services/api/core/ApiError.ts b/invokeai/frontend/web/src/services/api/core/ApiError.ts deleted file mode 100644 index 41a9605a3a..0000000000 --- a/invokeai/frontend/web/src/services/api/core/ApiError.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} diff --git a/invokeai/frontend/web/src/services/api/core/ApiRequestOptions.ts b/invokeai/frontend/web/src/services/api/core/ApiRequestOptions.ts deleted file mode 100644 index c9350406a1..0000000000 --- a/invokeai/frontend/web/src/services/api/core/ApiRequestOptions.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiRequestOptions = { - readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; -}; diff --git a/invokeai/frontend/web/src/services/api/core/ApiResult.ts b/invokeai/frontend/web/src/services/api/core/ApiResult.ts deleted file mode 100644 index 91f60ae082..0000000000 --- a/invokeai/frontend/web/src/services/api/core/ApiResult.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; -}; diff --git a/invokeai/frontend/web/src/services/api/core/CancelablePromise.ts b/invokeai/frontend/web/src/services/api/core/CancelablePromise.ts deleted file mode 100644 index a0f92e01b7..0000000000 --- a/invokeai/frontend/web/src/services/api/core/CancelablePromise.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export class CancelError extends Error { - - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - #isResolved: boolean; - #isRejected: boolean; - #isCancelled: boolean; - readonly #cancelHandlers: (() => void)[]; - readonly #promise: Promise; - #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: any) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: OnCancel - ) => void - ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isResolved = true; - this.#resolve?.(value); - }; - - const onReject = (reason?: any): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isRejected = true; - this.#reject?.(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this.#isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this.#isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this.#isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null - ): Promise { - return this.#promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null - ): Promise { - return this.#promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); - } - - public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { - try { - for (const cancelHandler of this.#cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.#cancelHandlers.length = 0; - this.#reject?.(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this.#isCancelled; - } -} diff --git a/invokeai/frontend/web/src/services/api/core/OpenAPI.ts b/invokeai/frontend/web/src/services/api/core/OpenAPI.ts deleted file mode 100644 index ba65dcd55d..0000000000 --- a/invokeai/frontend/web/src/services/api/core/OpenAPI.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Resolver = (options: ApiRequestOptions) => Promise; -type Headers = Record; - -export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver; - USERNAME?: string | Resolver; - PASSWORD?: string | Resolver; - HEADERS?: Headers | Resolver; - ENCODE_PATH?: (path: string) => string; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: '', - VERSION: '1.0.0', - WITH_CREDENTIALS: false, - CREDENTIALS: 'include', - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, -}; diff --git a/invokeai/frontend/web/src/services/api/core/request.ts b/invokeai/frontend/web/src/services/api/core/request.ts deleted file mode 100644 index 51c5f0f708..0000000000 --- a/invokeai/frontend/web/src/services/api/core/request.ts +++ /dev/null @@ -1,353 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * DO NOT DELETE EVEN THOUGH IT IS NOT USED! - * - * Custom `request.ts` file for OpenAPI code generator. - * - * Patches the request logic in such a way that we can extract headers from requests. - * - * Copied from https://github.com/ferdikoomen/openapi-typescript-codegen/issues/829#issuecomment-1228224477 - * - * This file should be excluded in `tsconfig.json` and ignored by prettier/eslint! - */ - -import axios from 'axios'; -import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; -import FormData from 'form-data'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const HEADERS = Symbol('HEADERS'); - -const isDefined = ( - value: T | null | undefined -): value is Exclude => { - return value !== undefined && value !== null; -}; - -const isString = (value: any): value is string => { - return typeof value === 'string'; -}; - -const isStringWithValue = (value: any): value is string => { - return isString(value) && value !== ''; -}; - -const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); -}; - -const isFormData = (value: any): value is FormData => { - return value instanceof FormData; -}; - -const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: any) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach((v) => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: any) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver -): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - formData?: FormData -): Promise> => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); - const formHeaders = - (typeof formData?.getHeaders === 'function' && formData?.getHeaders()) || - {}; - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - ...formHeaders, - }) - .filter(([_, value]) => isDefined(value)) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), - {} as Record - ); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return headers; -}; - -const getRequestBody = (options: ApiRequestOptions): any => { - if (options.body) { - return options.body; - } - return undefined; -}; - -const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Record, - onCancel: OnCancel -): Promise> => { - const source = axios.CancelToken.source(); - - const requestConfig: AxiosRequestConfig = { - url, - headers, - data: body ?? formData, - method: options.method, - withCredentials: config.WITH_CREDENTIALS, - cancelToken: source.token, - }; - - onCancel(() => source.cancel('The user aborted a request.')); - - try { - return await axios.request(requestConfig); - } catch (error) { - const axiosError = error as AxiosError; - if (axiosError.response) { - return axiosError.response; - } - throw error; - } -}; - -const getResponseHeader = ( - response: AxiosResponse, - responseHeader?: string -): string | undefined => { - if (responseHeader) { - const content = response.headers[responseHeader]; - if (isString(content)) { - return content; - } - } - return undefined; -}; - -const getResponseBody = (response: AxiosResponse): any => { - if (response.status !== 204) { - return response.data; - } - return undefined; -}; - -const catchErrorCodes = ( - options: ApiRequestOptions, - result: ApiResult -): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors, - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - throw new ApiError(options, result, 'Generic Error'); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options, formData); - - if (!onCancel.isCancelled) { - const response = await sendRequest( - config, - options, - url, - body, - formData, - headers, - onCancel - ); - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader( - response, - options.responseHeader - ); - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - }; - - catchErrorCodes(options, result); - - resolve({ ...result.body, [HEADERS]: response.headers }); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/invokeai/frontend/web/src/services/api/endpoints/boardImages.ts b/invokeai/frontend/web/src/services/api/endpoints/boardImages.ts new file mode 100644 index 0000000000..cef9ab7cae --- /dev/null +++ b/invokeai/frontend/web/src/services/api/endpoints/boardImages.ts @@ -0,0 +1,66 @@ +import { OffsetPaginatedResults_ImageDTO_ } from 'services/api/types'; +import { api } from '..'; +import { paths } from '../schema'; + +type ListBoardImagesArg = + paths['/api/v1/board_images/{board_id}']['get']['parameters']['path'] & + paths['/api/v1/board_images/{board_id}']['get']['parameters']['query']; + +type AddImageToBoardArg = + paths['/api/v1/board_images/']['post']['requestBody']['content']['application/json']; + +type RemoveImageFromBoardArg = + paths['/api/v1/board_images/']['delete']['requestBody']['content']['application/json']; + +export const boardImagesApi = api.injectEndpoints({ + endpoints: (build) => ({ + /** + * Board Images Queries + */ + + listBoardImages: build.query< + OffsetPaginatedResults_ImageDTO_, + ListBoardImagesArg + >({ + query: ({ board_id, offset, limit }) => ({ + url: `board_images/${board_id}`, + method: 'DELETE', + body: { offset, limit }, + }), + }), + + /** + * Board Images Mutations + */ + + addImageToBoard: build.mutation({ + query: ({ board_id, image_name }) => ({ + url: `board_images/`, + method: 'POST', + body: { board_id, image_name }, + }), + invalidatesTags: (result, error, arg) => [ + { type: 'Board', id: arg.board_id }, + { type: 'Image', id: arg.image_name }, + ], + }), + + removeImageFromBoard: build.mutation({ + query: ({ board_id, image_name }) => ({ + url: `board_images/`, + method: 'DELETE', + body: { board_id, image_name }, + }), + invalidatesTags: (result, error, arg) => [ + { type: 'Board', id: arg.board_id }, + { type: 'Image', id: arg.image_name }, + ], + }), + }), +}); + +export const { + useAddImageToBoardMutation, + useRemoveImageFromBoardMutation, + useListBoardImagesQuery, +} = boardImagesApi; diff --git a/invokeai/frontend/web/src/services/api/endpoints/boards.ts b/invokeai/frontend/web/src/services/api/endpoints/boards.ts new file mode 100644 index 0000000000..9816d88eb9 --- /dev/null +++ b/invokeai/frontend/web/src/services/api/endpoints/boards.ts @@ -0,0 +1,99 @@ +import { BoardDTO, OffsetPaginatedResults_BoardDTO_ } from 'services/api/types'; +import { ApiFullTagDescription, LIST_TAG, api } from '..'; +import { paths } from '../schema'; + +type ListBoardsArg = NonNullable< + paths['/api/v1/boards/']['get']['parameters']['query'] +>; + +type UpdateBoardArg = + paths['/api/v1/boards/{board_id}']['patch']['parameters']['path'] & { + changes: paths['/api/v1/boards/{board_id}']['patch']['requestBody']['content']['application/json']; + }; + +export const boardsApi = api.injectEndpoints({ + endpoints: (build) => ({ + /** + * Boards Queries + */ + listBoards: build.query({ + query: (arg) => ({ url: 'boards/', params: arg }), + providesTags: (result, error, arg) => { + // any list of boards + const tags: ApiFullTagDescription[] = [{ id: 'Board', type: LIST_TAG }]; + + if (result) { + // and individual tags for each board + tags.push( + ...result.items.map(({ board_id }) => ({ + type: 'Board' as const, + id: board_id, + })) + ); + } + + return tags; + }, + }), + + listAllBoards: build.query, void>({ + query: () => ({ + url: 'boards/', + params: { all: true }, + }), + providesTags: (result, error, arg) => { + // any list of boards + const tags: ApiFullTagDescription[] = [{ id: 'Board', type: LIST_TAG }]; + + if (result) { + // and individual tags for each board + tags.push( + ...result.map(({ board_id }) => ({ + type: 'Board' as const, + id: board_id, + })) + ); + } + + return tags; + }, + }), + + /** + * Boards Mutations + */ + + createBoard: build.mutation({ + query: (board_name) => ({ + url: `boards/`, + method: 'POST', + params: { board_name }, + }), + invalidatesTags: [{ id: 'Board', type: LIST_TAG }], + }), + + updateBoard: build.mutation({ + query: ({ board_id, changes }) => ({ + url: `boards/${board_id}`, + method: 'PATCH', + body: changes, + }), + invalidatesTags: (result, error, arg) => [ + { type: 'Board', id: arg.board_id }, + ], + }), + + deleteBoard: build.mutation({ + query: (board_id) => ({ url: `boards/${board_id}`, method: 'DELETE' }), + invalidatesTags: (result, error, arg) => [{ type: 'Board', id: arg }], + }), + }), +}); + +export const { + useListBoardsQuery, + useListAllBoardsQuery, + useCreateBoardMutation, + useUpdateBoardMutation, + useDeleteBoardMutation, +} = boardsApi; diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts new file mode 100644 index 0000000000..0094af4e39 --- /dev/null +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -0,0 +1,22 @@ +import { ApiFullTagDescription, api } from '..'; +import { ImageDTO } from '../types'; + +export const imagesApi = api.injectEndpoints({ + endpoints: (build) => ({ + /** + * Image Queries + */ + getImageDTO: build.query({ + query: (image_name) => ({ url: `images/${image_name}/metadata` }), + providesTags: (result, error, arg) => { + const tags: ApiFullTagDescription[] = [{ type: 'Image', id: arg }]; + if (result?.board_id) { + tags.push({ type: 'Board', id: result.board_id }); + } + return tags; + }, + }), + }), +}); + +export const { useGetImageDTOQuery } = imagesApi; diff --git a/invokeai/frontend/web/src/services/api/endpoints/models.ts b/invokeai/frontend/web/src/services/api/endpoints/models.ts new file mode 100644 index 0000000000..39e4e46d3b --- /dev/null +++ b/invokeai/frontend/web/src/services/api/endpoints/models.ts @@ -0,0 +1,52 @@ +import { ModelsList } from 'services/api/types'; +import { EntityState, createEntityAdapter } from '@reduxjs/toolkit'; +import { keyBy } from 'lodash-es'; + +import { ApiFullTagDescription, LIST_TAG, api } from '..'; +import { paths } from '../schema'; + +type ModelConfig = ModelsList['models'][number]; + +type ListModelsArg = NonNullable< + paths['/api/v1/models/']['get']['parameters']['query'] +>; + +const modelsAdapter = createEntityAdapter({ + selectId: (model) => getModelId(model), + sortComparer: (a, b) => a.name.localeCompare(b.name), +}); + +const getModelId = ({ base_model, type, name }: ModelConfig) => + `${base_model}/${type}/${name}`; + +export const modelsApi = api.injectEndpoints({ + endpoints: (build) => ({ + listModels: build.query, ListModelsArg>({ + query: (arg) => ({ url: 'models/', params: arg }), + providesTags: (result, error, arg) => { + // any list of boards + const tags: ApiFullTagDescription[] = [{ id: 'Model', type: LIST_TAG }]; + + if (result) { + // and individual tags for each board + tags.push( + ...result.ids.map((id) => ({ + type: 'Model' as const, + id, + })) + ); + } + + return tags; + }, + transformResponse: (response: ModelsList, meta, arg) => { + return modelsAdapter.setAll( + modelsAdapter.getInitialState(), + keyBy(response.models, getModelId) + ); + }, + }), + }), +}); + +export const { useListModelsQuery } = modelsApi; diff --git a/invokeai/frontend/web/src/services/types/guards.ts b/invokeai/frontend/web/src/services/api/guards.ts similarity index 78% rename from invokeai/frontend/web/src/services/types/guards.ts rename to invokeai/frontend/web/src/services/api/guards.ts index 7ac0d95e6a..0a28617f98 100644 --- a/invokeai/frontend/web/src/services/types/guards.ts +++ b/invokeai/frontend/web/src/services/api/guards.ts @@ -12,7 +12,7 @@ import { ResourceOrigin, ImageDTO, BoardDTO, -} from 'services/api'; +} from 'services/api/types'; export const isImageDTO = (obj: unknown): obj is ImageDTO => { return ( @@ -42,31 +42,31 @@ export const isBoardDTO = (obj: unknown): obj is BoardDTO => { export const isImageOutput = ( output: GraphExecutionState['results'][string] -): output is ImageOutput => output.type === 'image_output'; +): output is ImageOutput => output?.type === 'image_output'; export const isLatentsOutput = ( output: GraphExecutionState['results'][string] -): output is LatentsOutput => output.type === 'latents_output'; +): output is LatentsOutput => output?.type === 'latents_output'; export const isMaskOutput = ( output: GraphExecutionState['results'][string] -): output is MaskOutput => output.type === 'mask'; +): output is MaskOutput => output?.type === 'mask'; export const isPromptOutput = ( output: GraphExecutionState['results'][string] -): output is PromptOutput => output.type === 'prompt'; +): output is PromptOutput => output?.type === 'prompt'; export const isGraphOutput = ( output: GraphExecutionState['results'][string] -): output is GraphInvocationOutput => output.type === 'graph_output'; +): output is GraphInvocationOutput => output?.type === 'graph_output'; export const isIterateOutput = ( output: GraphExecutionState['results'][string] -): output is IterateInvocationOutput => output.type === 'iterate_output'; +): output is IterateInvocationOutput => output?.type === 'iterate_output'; export const isCollectOutput = ( output: GraphExecutionState['results'][string] -): output is CollectInvocationOutput => output.type === 'collect_output'; +): output is CollectInvocationOutput => output?.type === 'collect_output'; export const isResourceOrigin = (t: unknown): t is ResourceOrigin => isString(t) && ['internal', 'external'].includes(t); diff --git a/invokeai/frontend/web/src/services/api/index.ts b/invokeai/frontend/web/src/services/api/index.ts index 8ce42494e5..f91c3b90fd 100644 --- a/invokeai/frontend/web/src/services/api/index.ts +++ b/invokeai/frontend/web/src/services/api/index.ts @@ -1,145 +1,44 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI } from './core/OpenAPI'; -export type { OpenAPIConfig } from './core/OpenAPI'; +import { + BaseQueryFn, + FetchArgs, + FetchBaseQueryError, + createApi, + fetchBaseQuery, +} from '@reduxjs/toolkit/query/react'; +import { FullTagDescription } from '@reduxjs/toolkit/dist/query/endpointDefinitions'; +import { $authToken, $baseUrl } from 'services/api/client'; -export type { AddInvocation } from './models/AddInvocation'; -export type { BaseModelType } from './models/BaseModelType'; -export type { BoardChanges } from './models/BoardChanges'; -export type { BoardDTO } from './models/BoardDTO'; -export type { Body_create_board_image } from './models/Body_create_board_image'; -export type { Body_remove_board_image } from './models/Body_remove_board_image'; -export type { Body_upload_image } from './models/Body_upload_image'; -export type { CannyImageProcessorInvocation } from './models/CannyImageProcessorInvocation'; -export type { CkptModelInfo } from './models/CkptModelInfo'; -export type { ClipField } from './models/ClipField'; -export type { CollectInvocation } from './models/CollectInvocation'; -export type { CollectInvocationOutput } from './models/CollectInvocationOutput'; -export type { ColorField } from './models/ColorField'; -export type { CompelInvocation } from './models/CompelInvocation'; -export type { CompelOutput } from './models/CompelOutput'; -export type { ConditioningField } from './models/ConditioningField'; -export type { ContentShuffleImageProcessorInvocation } from './models/ContentShuffleImageProcessorInvocation'; -export type { ControlField } from './models/ControlField'; -export type { ControlNetInvocation } from './models/ControlNetInvocation'; -export type { ControlNetModelConfig } from './models/ControlNetModelConfig'; -export type { ControlNetModelFormat } from './models/ControlNetModelFormat'; -export type { ControlOutput } from './models/ControlOutput'; -export type { CreateModelRequest } from './models/CreateModelRequest'; -export type { CvInpaintInvocation } from './models/CvInpaintInvocation'; -export type { DiffusersModelInfo } from './models/DiffusersModelInfo'; -export type { DivideInvocation } from './models/DivideInvocation'; -export type { DynamicPromptInvocation } from './models/DynamicPromptInvocation'; -export type { Edge } from './models/Edge'; -export type { EdgeConnection } from './models/EdgeConnection'; -export type { FloatCollectionOutput } from './models/FloatCollectionOutput'; -export type { FloatLinearRangeInvocation } from './models/FloatLinearRangeInvocation'; -export type { FloatOutput } from './models/FloatOutput'; -export type { Graph } from './models/Graph'; -export type { GraphExecutionState } from './models/GraphExecutionState'; -export type { GraphInvocation } from './models/GraphInvocation'; -export type { GraphInvocationOutput } from './models/GraphInvocationOutput'; -export type { HedImageProcessorInvocation } from './models/HedImageProcessorInvocation'; -export type { HTTPValidationError } from './models/HTTPValidationError'; -export type { ImageBlurInvocation } from './models/ImageBlurInvocation'; -export type { ImageCategory } from './models/ImageCategory'; -export type { ImageChannelInvocation } from './models/ImageChannelInvocation'; -export type { ImageConvertInvocation } from './models/ImageConvertInvocation'; -export type { ImageCropInvocation } from './models/ImageCropInvocation'; -export type { ImageDTO } from './models/ImageDTO'; -export type { ImageField } from './models/ImageField'; -export type { ImageInverseLerpInvocation } from './models/ImageInverseLerpInvocation'; -export type { ImageLerpInvocation } from './models/ImageLerpInvocation'; -export type { ImageMetadata } from './models/ImageMetadata'; -export type { ImageMultiplyInvocation } from './models/ImageMultiplyInvocation'; -export type { ImageOutput } from './models/ImageOutput'; -export type { ImagePasteInvocation } from './models/ImagePasteInvocation'; -export type { ImageProcessorInvocation } from './models/ImageProcessorInvocation'; -export type { ImageRecordChanges } from './models/ImageRecordChanges'; -export type { ImageResizeInvocation } from './models/ImageResizeInvocation'; -export type { ImageScaleInvocation } from './models/ImageScaleInvocation'; -export type { ImageToLatentsInvocation } from './models/ImageToLatentsInvocation'; -export type { ImageUrlsDTO } from './models/ImageUrlsDTO'; -export type { InfillColorInvocation } from './models/InfillColorInvocation'; -export type { InfillPatchMatchInvocation } from './models/InfillPatchMatchInvocation'; -export type { InfillTileInvocation } from './models/InfillTileInvocation'; -export type { InpaintInvocation } from './models/InpaintInvocation'; -export type { IntCollectionOutput } from './models/IntCollectionOutput'; -export type { IntOutput } from './models/IntOutput'; -export type { IterateInvocation } from './models/IterateInvocation'; -export type { IterateInvocationOutput } from './models/IterateInvocationOutput'; -export type { LatentsField } from './models/LatentsField'; -export type { LatentsOutput } from './models/LatentsOutput'; -export type { LatentsToImageInvocation } from './models/LatentsToImageInvocation'; -export type { LatentsToLatentsInvocation } from './models/LatentsToLatentsInvocation'; -export type { LineartAnimeImageProcessorInvocation } from './models/LineartAnimeImageProcessorInvocation'; -export type { LineartImageProcessorInvocation } from './models/LineartImageProcessorInvocation'; -export type { LoadImageInvocation } from './models/LoadImageInvocation'; -export type { LoraInfo } from './models/LoraInfo'; -export type { LoraLoaderInvocation } from './models/LoraLoaderInvocation'; -export type { LoraLoaderOutput } from './models/LoraLoaderOutput'; -export type { LoRAModelConfig } from './models/LoRAModelConfig'; -export type { LoRAModelFormat } from './models/LoRAModelFormat'; -export type { MaskFromAlphaInvocation } from './models/MaskFromAlphaInvocation'; -export type { MaskOutput } from './models/MaskOutput'; -export type { MediapipeFaceProcessorInvocation } from './models/MediapipeFaceProcessorInvocation'; -export type { MidasDepthImageProcessorInvocation } from './models/MidasDepthImageProcessorInvocation'; -export type { MlsdImageProcessorInvocation } from './models/MlsdImageProcessorInvocation'; -export type { ModelError } from './models/ModelError'; -export type { ModelInfo } from './models/ModelInfo'; -export type { ModelLoaderOutput } from './models/ModelLoaderOutput'; -export type { ModelsList } from './models/ModelsList'; -export type { ModelType } from './models/ModelType'; -export type { ModelVariantType } from './models/ModelVariantType'; -export type { MultiplyInvocation } from './models/MultiplyInvocation'; -export type { NoiseInvocation } from './models/NoiseInvocation'; -export type { NoiseOutput } from './models/NoiseOutput'; -export type { NormalbaeImageProcessorInvocation } from './models/NormalbaeImageProcessorInvocation'; -export type { OffsetPaginatedResults_BoardDTO_ } from './models/OffsetPaginatedResults_BoardDTO_'; -export type { OffsetPaginatedResults_ImageDTO_ } from './models/OffsetPaginatedResults_ImageDTO_'; -export type { OpenposeImageProcessorInvocation } from './models/OpenposeImageProcessorInvocation'; -export type { PaginatedResults_GraphExecutionState_ } from './models/PaginatedResults_GraphExecutionState_'; -export type { ParamFloatInvocation } from './models/ParamFloatInvocation'; -export type { ParamIntInvocation } from './models/ParamIntInvocation'; -export type { PidiImageProcessorInvocation } from './models/PidiImageProcessorInvocation'; -export type { PipelineModelField } from './models/PipelineModelField'; -export type { PipelineModelLoaderInvocation } from './models/PipelineModelLoaderInvocation'; -export type { PromptCollectionOutput } from './models/PromptCollectionOutput'; -export type { PromptOutput } from './models/PromptOutput'; -export type { RandomIntInvocation } from './models/RandomIntInvocation'; -export type { RandomRangeInvocation } from './models/RandomRangeInvocation'; -export type { RangeInvocation } from './models/RangeInvocation'; -export type { RangeOfSizeInvocation } from './models/RangeOfSizeInvocation'; -export type { ResizeLatentsInvocation } from './models/ResizeLatentsInvocation'; -export type { ResourceOrigin } from './models/ResourceOrigin'; -export type { RestoreFaceInvocation } from './models/RestoreFaceInvocation'; -export type { ScaleLatentsInvocation } from './models/ScaleLatentsInvocation'; -export type { SchedulerPredictionType } from './models/SchedulerPredictionType'; -export type { ShowImageInvocation } from './models/ShowImageInvocation'; -export type { StableDiffusion1ModelCheckpointConfig } from './models/StableDiffusion1ModelCheckpointConfig'; -export type { StableDiffusion1ModelDiffusersConfig } from './models/StableDiffusion1ModelDiffusersConfig'; -export type { StableDiffusion1ModelFormat } from './models/StableDiffusion1ModelFormat'; -export type { StableDiffusion2ModelCheckpointConfig } from './models/StableDiffusion2ModelCheckpointConfig'; -export type { StableDiffusion2ModelDiffusersConfig } from './models/StableDiffusion2ModelDiffusersConfig'; -export type { StableDiffusion2ModelFormat } from './models/StableDiffusion2ModelFormat'; -export type { StepParamEasingInvocation } from './models/StepParamEasingInvocation'; -export type { SubModelType } from './models/SubModelType'; -export type { SubtractInvocation } from './models/SubtractInvocation'; -export type { TextToLatentsInvocation } from './models/TextToLatentsInvocation'; -export type { TextualInversionModelConfig } from './models/TextualInversionModelConfig'; -export type { UNetField } from './models/UNetField'; -export type { UpscaleInvocation } from './models/UpscaleInvocation'; -export type { VaeField } from './models/VaeField'; -export type { VaeModelConfig } from './models/VaeModelConfig'; -export type { VaeModelFormat } from './models/VaeModelFormat'; -export type { VaeRepo } from './models/VaeRepo'; -export type { ValidationError } from './models/ValidationError'; -export type { ZoeDepthImageProcessorInvocation } from './models/ZoeDepthImageProcessorInvocation'; +export const tagTypes = ['Board', 'Image', 'Model']; +export type ApiFullTagDescription = FullTagDescription< + (typeof tagTypes)[number] +>; +export const LIST_TAG = 'LIST'; -export { BoardsService } from './services/BoardsService'; -export { ImagesService } from './services/ImagesService'; -export { ModelsService } from './services/ModelsService'; -export { SessionsService } from './services/SessionsService'; +const dynamicBaseQuery: BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError +> = async (args, api, extraOptions) => { + const baseUrl = $baseUrl.get(); + const authToken = $authToken.get(); + + const rawBaseQuery = fetchBaseQuery({ + baseUrl: `${baseUrl ?? ''}/api/v1`, + prepareHeaders: (headers) => { + if (authToken) { + headers.set('Authorization', `Bearer ${authToken}`); + } + + return headers; + }, + }); + + return rawBaseQuery(args, api, extraOptions); +}; + +export const api = createApi({ + baseQuery: dynamicBaseQuery, + reducerPath: 'api', + tagTypes, + endpoints: () => ({}), +}); diff --git a/invokeai/frontend/web/src/services/api/models/AddInvocation.ts b/invokeai/frontend/web/src/services/api/models/AddInvocation.ts deleted file mode 100644 index e9671a918f..0000000000 --- a/invokeai/frontend/web/src/services/api/models/AddInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Adds two numbers - */ -export type AddInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'add'; - /** - * The first number - */ - 'a'?: number; - /** - * The second number - */ - 'b'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/BaseModelType.ts b/invokeai/frontend/web/src/services/api/models/BaseModelType.ts deleted file mode 100644 index 3f72e68fa4..0000000000 --- a/invokeai/frontend/web/src/services/api/models/BaseModelType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type BaseModelType = 'sd-1' | 'sd-2'; diff --git a/invokeai/frontend/web/src/services/api/models/BoardChanges.ts b/invokeai/frontend/web/src/services/api/models/BoardChanges.ts deleted file mode 100644 index fb2bfa0cd9..0000000000 --- a/invokeai/frontend/web/src/services/api/models/BoardChanges.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type BoardChanges = { - /** - * The board's new name. - */ - board_name?: string; - /** - * The name of the board's new cover image. - */ - cover_image_name?: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/BoardDTO.ts b/invokeai/frontend/web/src/services/api/models/BoardDTO.ts deleted file mode 100644 index bbcc6f1dd6..0000000000 --- a/invokeai/frontend/web/src/services/api/models/BoardDTO.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Deserialized board record with cover image URL and image count. - */ -export type BoardDTO = { - /** - * The unique ID of the board. - */ - board_id: string; - /** - * The name of the board. - */ - board_name: string; - /** - * The created timestamp of the board. - */ - created_at: string; - /** - * The updated timestamp of the board. - */ - updated_at: string; - /** - * The deleted timestamp of the board. - */ - deleted_at?: string; - /** - * The name of the board's cover image. - */ - cover_image_name?: string; - /** - * The number of images in the board. - */ - image_count: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/Body_create_board_image.ts b/invokeai/frontend/web/src/services/api/models/Body_create_board_image.ts deleted file mode 100644 index 47f8537eaa..0000000000 --- a/invokeai/frontend/web/src/services/api/models/Body_create_board_image.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Body_create_board_image = { - /** - * The id of the board to add to - */ - board_id: string; - /** - * The name of the image to add - */ - image_name: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/Body_remove_board_image.ts b/invokeai/frontend/web/src/services/api/models/Body_remove_board_image.ts deleted file mode 100644 index 6f5a3652d0..0000000000 --- a/invokeai/frontend/web/src/services/api/models/Body_remove_board_image.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Body_remove_board_image = { - /** - * The id of the board - */ - board_id: string; - /** - * The name of the image to remove - */ - image_name: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/Body_upload_image.ts b/invokeai/frontend/web/src/services/api/models/Body_upload_image.ts deleted file mode 100644 index b81146d3ab..0000000000 --- a/invokeai/frontend/web/src/services/api/models/Body_upload_image.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Body_upload_image = { - file: Blob; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CannyImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/CannyImageProcessorInvocation.ts deleted file mode 100644 index d5203867ac..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CannyImageProcessorInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Canny edge detection for ControlNet - */ -export type CannyImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'canny_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The low threshold of the Canny pixel gradient (0-255) - */ - low_threshold?: number; - /** - * The high threshold of the Canny pixel gradient (0-255) - */ - high_threshold?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CkptModelInfo.ts b/invokeai/frontend/web/src/services/api/models/CkptModelInfo.ts deleted file mode 100644 index cfa4357725..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CkptModelInfo.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CkptModelInfo = { - /** - * A description of the model - */ - description?: string; - /** - * The name of the model - */ - model_name: string; - /** - * The type of the model - */ - model_type: string; - format?: 'ckpt'; - /** - * The path to the model config - */ - config: string; - /** - * The path to the model weights - */ - weights: string; - /** - * The path to the model VAE - */ - vae: string; - /** - * The width of the model - */ - width?: number; - /** - * The height of the model - */ - height?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ClipField.ts b/invokeai/frontend/web/src/services/api/models/ClipField.ts deleted file mode 100644 index f9ef2cc683..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ClipField.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LoraInfo } from './LoraInfo'; -import type { ModelInfo } from './ModelInfo'; - -export type ClipField = { - /** - * Info to load tokenizer submodel - */ - tokenizer: ModelInfo; - /** - * Info to load text_encoder submodel - */ - text_encoder: ModelInfo; - /** - * Loras to apply on model loading - */ - loras: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CollectInvocation.ts b/invokeai/frontend/web/src/services/api/models/CollectInvocation.ts deleted file mode 100644 index f190ab7073..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CollectInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Collects values into a collection - */ -export type CollectInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'collect'; - /** - * The item to collect (all inputs must be of the same type) - */ - item?: any; - /** - * The collection, will be provided on execution - */ - collection?: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CollectInvocationOutput.ts b/invokeai/frontend/web/src/services/api/models/CollectInvocationOutput.ts deleted file mode 100644 index a5976242ea..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CollectInvocationOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Base class for all invocation outputs - */ -export type CollectInvocationOutput = { - type: 'collect_output'; - /** - * The collection of input items - */ - collection: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ColorField.ts b/invokeai/frontend/web/src/services/api/models/ColorField.ts deleted file mode 100644 index e0a609ec12..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ColorField.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ColorField = { - /** - * The red component - */ - 'r': number; - /** - * The green component - */ - 'g': number; - /** - * The blue component - */ - 'b': number; - /** - * The alpha component - */ - 'a': number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CompelInvocation.ts b/invokeai/frontend/web/src/services/api/models/CompelInvocation.ts deleted file mode 100644 index dd381ef22c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CompelInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ClipField } from './ClipField'; - -/** - * Parse prompt using compel package to conditioning. - */ -export type CompelInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'compel'; - /** - * Prompt - */ - prompt?: string; - /** - * Clip to use - */ - clip?: ClipField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CompelOutput.ts b/invokeai/frontend/web/src/services/api/models/CompelOutput.ts deleted file mode 100644 index 94f1fcb282..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CompelOutput.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ConditioningField } from './ConditioningField'; - -/** - * Compel parser output - */ -export type CompelOutput = { - type?: 'compel_output'; - /** - * Conditioning - */ - conditioning?: ConditioningField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ConditioningField.ts b/invokeai/frontend/web/src/services/api/models/ConditioningField.ts deleted file mode 100644 index 7e53a63b42..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ConditioningField.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ConditioningField = { - /** - * The name of conditioning data - */ - conditioning_name: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ContentShuffleImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/ContentShuffleImageProcessorInvocation.ts deleted file mode 100644 index e3f67ec9be..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ContentShuffleImageProcessorInvocation.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies content shuffle processing to image - */ -export type ContentShuffleImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'content_shuffle_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; - /** - * Content shuffle `h` parameter - */ - 'h'?: number; - /** - * Content shuffle `w` parameter - */ - 'w'?: number; - /** - * Content shuffle `f` parameter - */ - 'f'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ControlField.ts b/invokeai/frontend/web/src/services/api/models/ControlField.ts deleted file mode 100644 index 0479684d2c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ControlField.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -export type ControlField = { - /** - * The control image - */ - image: ImageField; - /** - * The ControlNet model to use - */ - control_model: string; - /** - * The weight given to the ControlNet - */ - control_weight: (number | Array); - /** - * When the ControlNet is first applied (% of total steps) - */ - begin_step_percent: number; - /** - * When the ControlNet is last applied (% of total steps) - */ - end_step_percent: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ControlNetInvocation.ts b/invokeai/frontend/web/src/services/api/models/ControlNetInvocation.ts deleted file mode 100644 index 42268b8295..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ControlNetInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Collects ControlNet info to pass to other nodes - */ -export type ControlNetInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'controlnet'; - /** - * The control image - */ - image?: ImageField; - /** - * control model used - */ - control_model?: 'lllyasviel/sd-controlnet-canny' | 'lllyasviel/sd-controlnet-depth' | 'lllyasviel/sd-controlnet-hed' | 'lllyasviel/sd-controlnet-seg' | 'lllyasviel/sd-controlnet-openpose' | 'lllyasviel/sd-controlnet-scribble' | 'lllyasviel/sd-controlnet-normal' | 'lllyasviel/sd-controlnet-mlsd' | 'lllyasviel/control_v11p_sd15_canny' | 'lllyasviel/control_v11p_sd15_openpose' | 'lllyasviel/control_v11p_sd15_seg' | 'lllyasviel/control_v11f1p_sd15_depth' | 'lllyasviel/control_v11p_sd15_normalbae' | 'lllyasviel/control_v11p_sd15_scribble' | 'lllyasviel/control_v11p_sd15_mlsd' | 'lllyasviel/control_v11p_sd15_softedge' | 'lllyasviel/control_v11p_sd15s2_lineart_anime' | 'lllyasviel/control_v11p_sd15_lineart' | 'lllyasviel/control_v11p_sd15_inpaint' | 'lllyasviel/control_v11e_sd15_shuffle' | 'lllyasviel/control_v11e_sd15_ip2p' | 'lllyasviel/control_v11f1e_sd15_tile' | 'thibaud/controlnet-sd21-openpose-diffusers' | 'thibaud/controlnet-sd21-canny-diffusers' | 'thibaud/controlnet-sd21-depth-diffusers' | 'thibaud/controlnet-sd21-scribble-diffusers' | 'thibaud/controlnet-sd21-hed-diffusers' | 'thibaud/controlnet-sd21-zoedepth-diffusers' | 'thibaud/controlnet-sd21-color-diffusers' | 'thibaud/controlnet-sd21-openposev2-diffusers' | 'thibaud/controlnet-sd21-lineart-diffusers' | 'thibaud/controlnet-sd21-normalbae-diffusers' | 'thibaud/controlnet-sd21-ade20k-diffusers' | 'CrucibleAI/ControlNetMediaPipeFace,diffusion_sd15' | 'CrucibleAI/ControlNetMediaPipeFace'; - /** - * The weight given to the ControlNet - */ - control_weight?: (number | Array); - /** - * When the ControlNet is first applied (% of total steps) - */ - begin_step_percent?: number; - /** - * When the ControlNet is last applied (% of total steps) - */ - end_step_percent?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ControlNetModelConfig.ts b/invokeai/frontend/web/src/services/api/models/ControlNetModelConfig.ts deleted file mode 100644 index 60e2958f5c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ControlNetModelConfig.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ControlNetModelFormat } from './ControlNetModelFormat'; -import type { ModelError } from './ModelError'; - -export type ControlNetModelConfig = { - name: string; - base_model: BaseModelType; - type: 'controlnet'; - path: string; - description?: string; - model_format: ControlNetModelFormat; - error?: ModelError; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ControlNetModelFormat.ts b/invokeai/frontend/web/src/services/api/models/ControlNetModelFormat.ts deleted file mode 100644 index 500b3e8f8c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ControlNetModelFormat.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type ControlNetModelFormat = 'checkpoint' | 'diffusers'; diff --git a/invokeai/frontend/web/src/services/api/models/ControlOutput.ts b/invokeai/frontend/web/src/services/api/models/ControlOutput.ts deleted file mode 100644 index a3cc5530c1..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ControlOutput.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ControlField } from './ControlField'; - -/** - * node output for ControlNet info - */ -export type ControlOutput = { - type?: 'control_output'; - /** - * The control info - */ - control?: ControlField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CreateModelRequest.ts b/invokeai/frontend/web/src/services/api/models/CreateModelRequest.ts deleted file mode 100644 index 0b0f52b8fe..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CreateModelRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { CkptModelInfo } from './CkptModelInfo'; -import type { DiffusersModelInfo } from './DiffusersModelInfo'; - -export type CreateModelRequest = { - /** - * The name of the model - */ - name: string; - /** - * The model info - */ - info: (CkptModelInfo | DiffusersModelInfo); -}; - diff --git a/invokeai/frontend/web/src/services/api/models/CvInpaintInvocation.ts b/invokeai/frontend/web/src/services/api/models/CvInpaintInvocation.ts deleted file mode 100644 index 874df93c30..0000000000 --- a/invokeai/frontend/web/src/services/api/models/CvInpaintInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Simple inpaint using opencv. - */ -export type CvInpaintInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'cv_inpaint'; - /** - * The image to inpaint - */ - image?: ImageField; - /** - * The mask to use when inpainting - */ - mask?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/DiffusersModelInfo.ts b/invokeai/frontend/web/src/services/api/models/DiffusersModelInfo.ts deleted file mode 100644 index 4e722ddb80..0000000000 --- a/invokeai/frontend/web/src/services/api/models/DiffusersModelInfo.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { VaeRepo } from './VaeRepo'; - -export type DiffusersModelInfo = { - /** - * A description of the model - */ - description?: string; - /** - * The name of the model - */ - model_name: string; - /** - * The type of the model - */ - model_type: string; - format?: 'folder'; - /** - * The VAE repo to use for this model - */ - vae?: VaeRepo; - /** - * The repo ID to use for this model - */ - repo_id?: string; - /** - * The path to the model - */ - path?: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/DivideInvocation.ts b/invokeai/frontend/web/src/services/api/models/DivideInvocation.ts deleted file mode 100644 index fd5b3475ae..0000000000 --- a/invokeai/frontend/web/src/services/api/models/DivideInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Divides two numbers - */ -export type DivideInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'div'; - /** - * The first number - */ - 'a'?: number; - /** - * The second number - */ - 'b'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/DynamicPromptInvocation.ts b/invokeai/frontend/web/src/services/api/models/DynamicPromptInvocation.ts deleted file mode 100644 index f7323a489b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/DynamicPromptInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Parses a prompt using adieyal/dynamicprompts' random or combinatorial generator - */ -export type DynamicPromptInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'dynamic_prompt'; - /** - * The prompt to parse with dynamicprompts - */ - prompt: string; - /** - * The number of prompts to generate - */ - max_prompts?: number; - /** - * Whether to use the combinatorial generator - */ - combinatorial?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/Edge.ts b/invokeai/frontend/web/src/services/api/models/Edge.ts deleted file mode 100644 index bba275cb26..0000000000 --- a/invokeai/frontend/web/src/services/api/models/Edge.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { EdgeConnection } from './EdgeConnection'; - -export type Edge = { - /** - * The connection for the edge's from node and field - */ - source: EdgeConnection; - /** - * The connection for the edge's to node and field - */ - destination: EdgeConnection; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/EdgeConnection.ts b/invokeai/frontend/web/src/services/api/models/EdgeConnection.ts deleted file mode 100644 index ecbddccd76..0000000000 --- a/invokeai/frontend/web/src/services/api/models/EdgeConnection.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type EdgeConnection = { - /** - * The id of the node for this edge connection - */ - node_id: string; - /** - * The field for this connection - */ - field: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/FloatCollectionOutput.ts b/invokeai/frontend/web/src/services/api/models/FloatCollectionOutput.ts deleted file mode 100644 index a3f08247a4..0000000000 --- a/invokeai/frontend/web/src/services/api/models/FloatCollectionOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * A collection of floats - */ -export type FloatCollectionOutput = { - type?: 'float_collection'; - /** - * The float collection - */ - collection?: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/FloatLinearRangeInvocation.ts b/invokeai/frontend/web/src/services/api/models/FloatLinearRangeInvocation.ts deleted file mode 100644 index e0fd4a1caa..0000000000 --- a/invokeai/frontend/web/src/services/api/models/FloatLinearRangeInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Creates a range - */ -export type FloatLinearRangeInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'float_range'; - /** - * The first value of the range - */ - start?: number; - /** - * The last value of the range - */ - stop?: number; - /** - * number of values to interpolate over (including start and stop) - */ - steps?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/FloatOutput.ts b/invokeai/frontend/web/src/services/api/models/FloatOutput.ts deleted file mode 100644 index 2331936b30..0000000000 --- a/invokeai/frontend/web/src/services/api/models/FloatOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * A float output - */ -export type FloatOutput = { - type?: 'float_output'; - /** - * The output float - */ - param?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/Graph.ts b/invokeai/frontend/web/src/services/api/models/Graph.ts deleted file mode 100644 index 5fba3d8311..0000000000 --- a/invokeai/frontend/web/src/services/api/models/Graph.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AddInvocation } from './AddInvocation'; -import type { CannyImageProcessorInvocation } from './CannyImageProcessorInvocation'; -import type { CollectInvocation } from './CollectInvocation'; -import type { CompelInvocation } from './CompelInvocation'; -import type { ContentShuffleImageProcessorInvocation } from './ContentShuffleImageProcessorInvocation'; -import type { ControlNetInvocation } from './ControlNetInvocation'; -import type { CvInpaintInvocation } from './CvInpaintInvocation'; -import type { DivideInvocation } from './DivideInvocation'; -import type { DynamicPromptInvocation } from './DynamicPromptInvocation'; -import type { Edge } from './Edge'; -import type { FloatLinearRangeInvocation } from './FloatLinearRangeInvocation'; -import type { GraphInvocation } from './GraphInvocation'; -import type { HedImageProcessorInvocation } from './HedImageProcessorInvocation'; -import type { ImageBlurInvocation } from './ImageBlurInvocation'; -import type { ImageChannelInvocation } from './ImageChannelInvocation'; -import type { ImageConvertInvocation } from './ImageConvertInvocation'; -import type { ImageCropInvocation } from './ImageCropInvocation'; -import type { ImageInverseLerpInvocation } from './ImageInverseLerpInvocation'; -import type { ImageLerpInvocation } from './ImageLerpInvocation'; -import type { ImageMultiplyInvocation } from './ImageMultiplyInvocation'; -import type { ImagePasteInvocation } from './ImagePasteInvocation'; -import type { ImageProcessorInvocation } from './ImageProcessorInvocation'; -import type { ImageResizeInvocation } from './ImageResizeInvocation'; -import type { ImageScaleInvocation } from './ImageScaleInvocation'; -import type { ImageToLatentsInvocation } from './ImageToLatentsInvocation'; -import type { InfillColorInvocation } from './InfillColorInvocation'; -import type { InfillPatchMatchInvocation } from './InfillPatchMatchInvocation'; -import type { InfillTileInvocation } from './InfillTileInvocation'; -import type { InpaintInvocation } from './InpaintInvocation'; -import type { IterateInvocation } from './IterateInvocation'; -import type { LatentsToImageInvocation } from './LatentsToImageInvocation'; -import type { LatentsToLatentsInvocation } from './LatentsToLatentsInvocation'; -import type { LineartAnimeImageProcessorInvocation } from './LineartAnimeImageProcessorInvocation'; -import type { LineartImageProcessorInvocation } from './LineartImageProcessorInvocation'; -import type { LoadImageInvocation } from './LoadImageInvocation'; -import type { LoraLoaderInvocation } from './LoraLoaderInvocation'; -import type { MaskFromAlphaInvocation } from './MaskFromAlphaInvocation'; -import type { MediapipeFaceProcessorInvocation } from './MediapipeFaceProcessorInvocation'; -import type { MidasDepthImageProcessorInvocation } from './MidasDepthImageProcessorInvocation'; -import type { MlsdImageProcessorInvocation } from './MlsdImageProcessorInvocation'; -import type { MultiplyInvocation } from './MultiplyInvocation'; -import type { NoiseInvocation } from './NoiseInvocation'; -import type { NormalbaeImageProcessorInvocation } from './NormalbaeImageProcessorInvocation'; -import type { OpenposeImageProcessorInvocation } from './OpenposeImageProcessorInvocation'; -import type { ParamFloatInvocation } from './ParamFloatInvocation'; -import type { ParamIntInvocation } from './ParamIntInvocation'; -import type { PidiImageProcessorInvocation } from './PidiImageProcessorInvocation'; -import type { PipelineModelLoaderInvocation } from './PipelineModelLoaderInvocation'; -import type { RandomIntInvocation } from './RandomIntInvocation'; -import type { RandomRangeInvocation } from './RandomRangeInvocation'; -import type { RangeInvocation } from './RangeInvocation'; -import type { RangeOfSizeInvocation } from './RangeOfSizeInvocation'; -import type { ResizeLatentsInvocation } from './ResizeLatentsInvocation'; -import type { RestoreFaceInvocation } from './RestoreFaceInvocation'; -import type { ScaleLatentsInvocation } from './ScaleLatentsInvocation'; -import type { ShowImageInvocation } from './ShowImageInvocation'; -import type { StepParamEasingInvocation } from './StepParamEasingInvocation'; -import type { SubtractInvocation } from './SubtractInvocation'; -import type { TextToLatentsInvocation } from './TextToLatentsInvocation'; -import type { UpscaleInvocation } from './UpscaleInvocation'; -import type { ZoeDepthImageProcessorInvocation } from './ZoeDepthImageProcessorInvocation'; - -export type Graph = { - /** - * The id of this graph - */ - id?: string; - /** - * The nodes in this graph - */ - nodes?: Record; - /** - * The connections between nodes and their fields in this graph - */ - edges?: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/GraphExecutionState.ts b/invokeai/frontend/web/src/services/api/models/GraphExecutionState.ts deleted file mode 100644 index 602e7a2ebc..0000000000 --- a/invokeai/frontend/web/src/services/api/models/GraphExecutionState.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { CollectInvocationOutput } from './CollectInvocationOutput'; -import type { CompelOutput } from './CompelOutput'; -import type { ControlOutput } from './ControlOutput'; -import type { FloatCollectionOutput } from './FloatCollectionOutput'; -import type { FloatOutput } from './FloatOutput'; -import type { Graph } from './Graph'; -import type { GraphInvocationOutput } from './GraphInvocationOutput'; -import type { ImageOutput } from './ImageOutput'; -import type { IntCollectionOutput } from './IntCollectionOutput'; -import type { IntOutput } from './IntOutput'; -import type { IterateInvocationOutput } from './IterateInvocationOutput'; -import type { LatentsOutput } from './LatentsOutput'; -import type { LoraLoaderOutput } from './LoraLoaderOutput'; -import type { MaskOutput } from './MaskOutput'; -import type { ModelLoaderOutput } from './ModelLoaderOutput'; -import type { NoiseOutput } from './NoiseOutput'; -import type { PromptCollectionOutput } from './PromptCollectionOutput'; -import type { PromptOutput } from './PromptOutput'; - -/** - * Tracks the state of a graph execution - */ -export type GraphExecutionState = { - /** - * The id of the execution state - */ - id: string; - /** - * The graph being executed - */ - graph: Graph; - /** - * The expanded graph of activated and executed nodes - */ - execution_graph: Graph; - /** - * The set of node ids that have been executed - */ - executed: Array; - /** - * The list of node ids that have been executed, in order of execution - */ - executed_history: Array; - /** - * The results of node executions - */ - results: Record; - /** - * Errors raised when executing nodes - */ - errors: Record; - /** - * The map of prepared nodes to original graph nodes - */ - prepared_source_mapping: Record; - /** - * The map of original graph nodes to prepared nodes - */ - source_prepared_mapping: Record>; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/GraphInvocation.ts b/invokeai/frontend/web/src/services/api/models/GraphInvocation.ts deleted file mode 100644 index 8512faae74..0000000000 --- a/invokeai/frontend/web/src/services/api/models/GraphInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { Graph } from './Graph'; - -/** - * Execute a graph - */ -export type GraphInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'graph'; - /** - * The graph to run - */ - graph?: Graph; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/GraphInvocationOutput.ts b/invokeai/frontend/web/src/services/api/models/GraphInvocationOutput.ts deleted file mode 100644 index af0aae3edb..0000000000 --- a/invokeai/frontend/web/src/services/api/models/GraphInvocationOutput.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Base class for all invocation outputs - */ -export type GraphInvocationOutput = { - type: 'graph_output'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/HTTPValidationError.ts b/invokeai/frontend/web/src/services/api/models/HTTPValidationError.ts deleted file mode 100644 index 5e13adc4e5..0000000000 --- a/invokeai/frontend/web/src/services/api/models/HTTPValidationError.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ValidationError } from './ValidationError'; - -export type HTTPValidationError = { - detail?: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/HedImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/HedImageProcessorInvocation.ts deleted file mode 100644 index 1132012c5a..0000000000 --- a/invokeai/frontend/web/src/services/api/models/HedImageProcessorInvocation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies HED edge detection to image - */ -export type HedImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'hed_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; - /** - * Whether to use scribble mode - */ - scribble?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageBlurInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageBlurInvocation.ts deleted file mode 100644 index 3ba86d8fab..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageBlurInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Blurs an image - */ -export type ImageBlurInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_blur'; - /** - * The image to blur - */ - image?: ImageField; - /** - * The blur radius - */ - radius?: number; - /** - * The type of blur - */ - blur_type?: 'gaussian' | 'box'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageCategory.ts b/invokeai/frontend/web/src/services/api/models/ImageCategory.ts deleted file mode 100644 index 84551d3cd6..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageCategory.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * The category of an image. - * - * - GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose. - * - MASK: The image is a mask image. - * - CONTROL: The image is a ControlNet control image. - * - USER: The image is a user-provide image. - * - OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes. - */ -export type ImageCategory = 'general' | 'mask' | 'control' | 'user' | 'other'; diff --git a/invokeai/frontend/web/src/services/api/models/ImageChannelInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageChannelInvocation.ts deleted file mode 100644 index 47bfd4110f..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageChannelInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Gets a channel from an image. - */ -export type ImageChannelInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_chan'; - /** - * The image to get the channel from - */ - image?: ImageField; - /** - * The channel to get - */ - channel?: 'A' | 'R' | 'G' | 'B'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageConvertInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageConvertInvocation.ts deleted file mode 100644 index 4bd59d03b0..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageConvertInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Converts an image to a different mode. - */ -export type ImageConvertInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_conv'; - /** - * The image to convert - */ - image?: ImageField; - /** - * The mode to convert to - */ - mode?: 'L' | 'RGB' | 'RGBA' | 'CMYK' | 'YCbCr' | 'LAB' | 'HSV' | 'I' | 'F'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageCropInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageCropInvocation.ts deleted file mode 100644 index 5207ebbf6d..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageCropInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Crops an image to a specified box. The box can be outside of the image. - */ -export type ImageCropInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_crop'; - /** - * The image to crop - */ - image?: ImageField; - /** - * The left x coordinate of the crop rectangle - */ - 'x'?: number; - /** - * The top y coordinate of the crop rectangle - */ - 'y'?: number; - /** - * The width of the crop rectangle - */ - width?: number; - /** - * The height of the crop rectangle - */ - height?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageDTO.ts b/invokeai/frontend/web/src/services/api/models/ImageDTO.ts deleted file mode 100644 index 4e273e8854..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageDTO.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageCategory } from './ImageCategory'; -import type { ImageMetadata } from './ImageMetadata'; -import type { ResourceOrigin } from './ResourceOrigin'; - -/** - * Deserialized image record, enriched for the frontend. - */ -export type ImageDTO = { - /** - * The unique name of the image. - */ - image_name: string; - /** - * The URL of the image. - */ - image_url: string; - /** - * The URL of the image's thumbnail. - */ - thumbnail_url: string; - /** - * The type of the image. - */ - image_origin: ResourceOrigin; - /** - * The category of the image. - */ - image_category: ImageCategory; - /** - * The width of the image in px. - */ - width: number; - /** - * The height of the image in px. - */ - height: number; - /** - * The created timestamp of the image. - */ - created_at: string; - /** - * The updated timestamp of the image. - */ - updated_at: string; - /** - * The deleted timestamp of the image. - */ - deleted_at?: string; - /** - * Whether this is an intermediate image. - */ - is_intermediate: boolean; - /** - * The session ID that generated this image, if it is a generated image. - */ - session_id?: string; - /** - * The node ID that generated this image, if it is a generated image. - */ - node_id?: string; - /** - * A limited subset of the image's generation metadata. Retrieve the image's session for full metadata. - */ - metadata?: ImageMetadata; - /** - * The id of the board the image belongs to, if one exists. - */ - board_id?: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageField.ts b/invokeai/frontend/web/src/services/api/models/ImageField.ts deleted file mode 100644 index baf3bf2b54..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageField.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An image field used for passing image objects between invocations - */ -export type ImageField = { - /** - * The name of the image - */ - image_name: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageInverseLerpInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageInverseLerpInvocation.ts deleted file mode 100644 index 0347d4dc38..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageInverseLerpInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Inverse linear interpolation of all pixels of an image - */ -export type ImageInverseLerpInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_ilerp'; - /** - * The image to lerp - */ - image?: ImageField; - /** - * The minimum input value - */ - min?: number; - /** - * The maximum input value - */ - max?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageLerpInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageLerpInvocation.ts deleted file mode 100644 index 388c86061c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageLerpInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Linear interpolation of all pixels of an image - */ -export type ImageLerpInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_lerp'; - /** - * The image to lerp - */ - image?: ImageField; - /** - * The minimum output value - */ - min?: number; - /** - * The maximum output value - */ - max?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageMetadata.ts b/invokeai/frontend/web/src/services/api/models/ImageMetadata.ts deleted file mode 100644 index 0b2af78799..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageMetadata.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Core generation metadata for an image/tensor generated in InvokeAI. - * - * Also includes any metadata from the image's PNG tEXt chunks. - * - * Generated by traversing the execution graph, collecting the parameters of the nearest ancestors - * of a given node. - * - * Full metadata may be accessed by querying for the session in the `graph_executions` table. - */ -export type ImageMetadata = { - /** - * The type of the ancestor node of the image output node. - */ - type?: string; - /** - * The positive conditioning. - */ - positive_conditioning?: string; - /** - * The negative conditioning. - */ - negative_conditioning?: string; - /** - * Width of the image/latents in pixels. - */ - width?: number; - /** - * Height of the image/latents in pixels. - */ - height?: number; - /** - * The seed used for noise generation. - */ - seed?: number; - /** - * The classifier-free guidance scale. - */ - cfg_scale?: (number | Array); - /** - * The number of steps used for inference. - */ - steps?: number; - /** - * The scheduler used for inference. - */ - scheduler?: string; - /** - * The model used for inference. - */ - model?: string; - /** - * The strength used for image-to-image/latents-to-latents. - */ - strength?: number; - /** - * The ID of the initial latents. - */ - latents?: string; - /** - * The VAE used for decoding. - */ - vae?: string; - /** - * The UNet used dor inference. - */ - unet?: string; - /** - * The CLIP Encoder used for conditioning. - */ - clip?: string; - /** - * Uploaded image metadata, extracted from the PNG tEXt chunk. - */ - extra?: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageMultiplyInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageMultiplyInvocation.ts deleted file mode 100644 index 751ee49158..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageMultiplyInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Multiplies two images together using `PIL.ImageChops.multiply()`. - */ -export type ImageMultiplyInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_mul'; - /** - * The first image to multiply - */ - image1?: ImageField; - /** - * The second image to multiply - */ - image2?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageOutput.ts b/invokeai/frontend/web/src/services/api/models/ImageOutput.ts deleted file mode 100644 index d7db0c11de..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageOutput.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Base class for invocations that output an image - */ -export type ImageOutput = { - type: 'image_output'; - /** - * The output image - */ - image: ImageField; - /** - * The width of the image in pixels - */ - width: number; - /** - * The height of the image in pixels - */ - height: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImagePasteInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImagePasteInvocation.ts deleted file mode 100644 index c883b9a5d8..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImagePasteInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Pastes an image into another image. - */ -export type ImagePasteInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_paste'; - /** - * The base image - */ - base_image?: ImageField; - /** - * The image to paste - */ - image?: ImageField; - /** - * The mask to use when pasting - */ - mask?: ImageField; - /** - * The left x coordinate at which to paste the image - */ - 'x'?: number; - /** - * The top y coordinate at which to paste the image - */ - 'y'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageProcessorInvocation.ts deleted file mode 100644 index 0d995c4e68..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageProcessorInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Base class for invocations that preprocess images for ControlNet - */ -export type ImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'image_processor'; - /** - * The image to process - */ - image?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageRecordChanges.ts b/invokeai/frontend/web/src/services/api/models/ImageRecordChanges.ts deleted file mode 100644 index e597cd907d..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageRecordChanges.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageCategory } from './ImageCategory'; - -/** - * A set of changes to apply to an image record. - * - * Only limited changes are valid: - * - `image_category`: change the category of an image - * - `session_id`: change the session associated with an image - * - `is_intermediate`: change the image's `is_intermediate` flag - */ -export type ImageRecordChanges = { - /** - * The image's new category. - */ - image_category?: ImageCategory; - /** - * The image's new session ID. - */ - session_id?: string; - /** - * The image's new `is_intermediate` flag. - */ - is_intermediate?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageResizeInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageResizeInvocation.ts deleted file mode 100644 index 3b096c83b7..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageResizeInvocation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Resizes an image to specific dimensions - */ -export type ImageResizeInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_resize'; - /** - * The image to resize - */ - image?: ImageField; - /** - * The width to resize to (px) - */ - width: number; - /** - * The height to resize to (px) - */ - height: number; - /** - * The resampling mode - */ - resample_mode?: 'nearest' | 'box' | 'bilinear' | 'hamming' | 'bicubic' | 'lanczos'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageScaleInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageScaleInvocation.ts deleted file mode 100644 index bf4da28a4a..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageScaleInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Scales an image by a factor - */ -export type ImageScaleInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'img_scale'; - /** - * The image to scale - */ - image?: ImageField; - /** - * The factor by which to scale the image - */ - scale_factor: number; - /** - * The resampling mode - */ - resample_mode?: 'nearest' | 'box' | 'bilinear' | 'hamming' | 'bicubic' | 'lanczos'; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageToLatentsInvocation.ts b/invokeai/frontend/web/src/services/api/models/ImageToLatentsInvocation.ts deleted file mode 100644 index ace0ed8e3c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageToLatentsInvocation.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; -import type { VaeField } from './VaeField'; - -/** - * Encodes an image into latents. - */ -export type ImageToLatentsInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'i2l'; - /** - * The image to encode - */ - image?: ImageField; - /** - * Vae submodel - */ - vae?: VaeField; - /** - * Encode latents by overlaping tiles(less memory consumption) - */ - tiled?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ImageUrlsDTO.ts b/invokeai/frontend/web/src/services/api/models/ImageUrlsDTO.ts deleted file mode 100644 index 1e0ff322e8..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ImageUrlsDTO.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * The URLs for an image and its thumbnail. - */ -export type ImageUrlsDTO = { - /** - * The unique name of the image. - */ - image_name: string; - /** - * The URL of the image. - */ - image_url: string; - /** - * The URL of the image's thumbnail. - */ - thumbnail_url: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/InfillColorInvocation.ts b/invokeai/frontend/web/src/services/api/models/InfillColorInvocation.ts deleted file mode 100644 index 3e637b299c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/InfillColorInvocation.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ColorField } from './ColorField'; -import type { ImageField } from './ImageField'; - -/** - * Infills transparent areas of an image with a solid color - */ -export type InfillColorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'infill_rgba'; - /** - * The image to infill - */ - image?: ImageField; - /** - * The color to use to infill - */ - color?: ColorField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/InfillPatchMatchInvocation.ts b/invokeai/frontend/web/src/services/api/models/InfillPatchMatchInvocation.ts deleted file mode 100644 index 325bfe2080..0000000000 --- a/invokeai/frontend/web/src/services/api/models/InfillPatchMatchInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Infills transparent areas of an image using the PatchMatch algorithm - */ -export type InfillPatchMatchInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'infill_patchmatch'; - /** - * The image to infill - */ - image?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/InfillTileInvocation.ts b/invokeai/frontend/web/src/services/api/models/InfillTileInvocation.ts deleted file mode 100644 index dfb1cbc61d..0000000000 --- a/invokeai/frontend/web/src/services/api/models/InfillTileInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Infills transparent areas of an image with tiles of the image - */ -export type InfillTileInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'infill_tile'; - /** - * The image to infill - */ - image?: ImageField; - /** - * The tile size (px) - */ - tile_size?: number; - /** - * The seed to use for tile generation (omit for random) - */ - seed?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/InpaintInvocation.ts b/invokeai/frontend/web/src/services/api/models/InpaintInvocation.ts deleted file mode 100644 index 8fb9ad3d54..0000000000 --- a/invokeai/frontend/web/src/services/api/models/InpaintInvocation.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ColorField } from './ColorField'; -import type { ConditioningField } from './ConditioningField'; -import type { ImageField } from './ImageField'; -import type { UNetField } from './UNetField'; -import type { VaeField } from './VaeField'; - -/** - * Generates an image using inpaint. - */ -export type InpaintInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'inpaint'; - /** - * Positive conditioning for generation - */ - positive_conditioning?: ConditioningField; - /** - * Negative conditioning for generation - */ - negative_conditioning?: ConditioningField; - /** - * The seed to use (omit for random) - */ - seed?: number; - /** - * The number of steps to use to generate the image - */ - steps?: number; - /** - * The width of the resulting image - */ - width?: number; - /** - * The height of the resulting image - */ - height?: number; - /** - * The Classifier-Free Guidance, higher values may result in a result closer to the prompt - */ - cfg_scale?: number; - /** - * The scheduler to use - */ - scheduler?: 'ddim' | 'ddpm' | 'deis' | 'lms' | 'lms_k' | 'pndm' | 'heun' | 'heun_k' | 'euler' | 'euler_k' | 'euler_a' | 'kdpm_2' | 'kdpm_2_a' | 'dpmpp_2s' | 'dpmpp_2s_k' | 'dpmpp_2m' | 'dpmpp_2m_k' | 'dpmpp_2m_sde' | 'dpmpp_2m_sde_k' | 'dpmpp_sde' | 'dpmpp_sde_k' | 'unipc'; - /** - * UNet model - */ - unet?: UNetField; - /** - * Vae model - */ - vae?: VaeField; - /** - * The input image - */ - image?: ImageField; - /** - * The strength of the original image - */ - strength?: number; - /** - * Whether or not the result should be fit to the aspect ratio of the input image - */ - fit?: boolean; - /** - * The mask - */ - mask?: ImageField; - /** - * The seam inpaint size (px) - */ - seam_size?: number; - /** - * The seam inpaint blur radius (px) - */ - seam_blur?: number; - /** - * The seam inpaint strength - */ - seam_strength?: number; - /** - * The number of steps to use for seam inpaint - */ - seam_steps?: number; - /** - * The tile infill method size (px) - */ - tile_size?: number; - /** - * The method used to infill empty regions (px) - */ - infill_method?: 'patchmatch' | 'tile' | 'solid'; - /** - * The width of the inpaint region (px) - */ - inpaint_width?: number; - /** - * The height of the inpaint region (px) - */ - inpaint_height?: number; - /** - * The solid infill method color - */ - inpaint_fill?: ColorField; - /** - * The amount by which to replace masked areas with latent noise - */ - inpaint_replace?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/IntCollectionOutput.ts b/invokeai/frontend/web/src/services/api/models/IntCollectionOutput.ts deleted file mode 100644 index 93a115f980..0000000000 --- a/invokeai/frontend/web/src/services/api/models/IntCollectionOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * A collection of integers - */ -export type IntCollectionOutput = { - type?: 'int_collection'; - /** - * The int collection - */ - collection?: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/IntOutput.ts b/invokeai/frontend/web/src/services/api/models/IntOutput.ts deleted file mode 100644 index eeea6c68b4..0000000000 --- a/invokeai/frontend/web/src/services/api/models/IntOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An integer output - */ -export type IntOutput = { - type?: 'int_output'; - /** - * The output integer - */ - 'a'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/IterateInvocation.ts b/invokeai/frontend/web/src/services/api/models/IterateInvocation.ts deleted file mode 100644 index 15bf92dfea..0000000000 --- a/invokeai/frontend/web/src/services/api/models/IterateInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Iterates over a list of items - */ -export type IterateInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'iterate'; - /** - * The list of items to iterate over - */ - collection?: Array; - /** - * The index, will be provided on executed iterators - */ - index?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/IterateInvocationOutput.ts b/invokeai/frontend/web/src/services/api/models/IterateInvocationOutput.ts deleted file mode 100644 index ce8d9f8c4b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/IterateInvocationOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Used to connect iteration outputs. Will be expanded to a specific output. - */ -export type IterateInvocationOutput = { - type: 'iterate_output'; - /** - * The item being iterated over - */ - item: any; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LatentsField.ts b/invokeai/frontend/web/src/services/api/models/LatentsField.ts deleted file mode 100644 index bc6a525f7c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LatentsField.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * A latents field used for passing latents between invocations - */ -export type LatentsField = { - /** - * The name of the latents - */ - latents_name: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LatentsOutput.ts b/invokeai/frontend/web/src/services/api/models/LatentsOutput.ts deleted file mode 100644 index 3e9c2f60e4..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LatentsOutput.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LatentsField } from './LatentsField'; - -/** - * Base class for invocations that output latents - */ -export type LatentsOutput = { - type?: 'latents_output'; - /** - * The output latents - */ - latents?: LatentsField; - /** - * The width of the latents in pixels - */ - width: number; - /** - * The height of the latents in pixels - */ - height: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LatentsToImageInvocation.ts b/invokeai/frontend/web/src/services/api/models/LatentsToImageInvocation.ts deleted file mode 100644 index 865eeff554..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LatentsToImageInvocation.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LatentsField } from './LatentsField'; -import type { VaeField } from './VaeField'; - -/** - * Generates an image from latents. - */ -export type LatentsToImageInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'l2i'; - /** - * The latents to generate an image from - */ - latents?: LatentsField; - /** - * Vae submodel - */ - vae?: VaeField; - /** - * Decode latents by overlaping tiles(less memory consumption) - */ - tiled?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LatentsToLatentsInvocation.ts b/invokeai/frontend/web/src/services/api/models/LatentsToLatentsInvocation.ts deleted file mode 100644 index 4273115963..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LatentsToLatentsInvocation.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ConditioningField } from './ConditioningField'; -import type { ControlField } from './ControlField'; -import type { LatentsField } from './LatentsField'; -import type { UNetField } from './UNetField'; - -/** - * Generates latents using latents as base image. - */ -export type LatentsToLatentsInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'l2l'; - /** - * Positive conditioning for generation - */ - positive_conditioning?: ConditioningField; - /** - * Negative conditioning for generation - */ - negative_conditioning?: ConditioningField; - /** - * The noise to use - */ - noise?: LatentsField; - /** - * The number of steps to use to generate the image - */ - steps?: number; - /** - * The Classifier-Free Guidance, higher values may result in a result closer to the prompt - */ - cfg_scale?: (number | Array); - /** - * The scheduler to use - */ - scheduler?: 'ddim' | 'ddpm' | 'deis' | 'lms' | 'lms_k' | 'pndm' | 'heun' | 'heun_k' | 'euler' | 'euler_k' | 'euler_a' | 'kdpm_2' | 'kdpm_2_a' | 'dpmpp_2s' | 'dpmpp_2s_k' | 'dpmpp_2m' | 'dpmpp_2m_k' | 'dpmpp_2m_sde' | 'dpmpp_2m_sde_k' | 'dpmpp_sde' | 'dpmpp_sde_k' | 'unipc'; - /** - * UNet submodel - */ - unet?: UNetField; - /** - * The control to use - */ - control?: (ControlField | Array); - /** - * The latents to use as a base image - */ - latents?: LatentsField; - /** - * The strength of the latents to use - */ - strength?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LineartAnimeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/LineartAnimeImageProcessorInvocation.ts deleted file mode 100644 index 5d239536d5..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LineartAnimeImageProcessorInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies line art anime processing to image - */ -export type LineartAnimeImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'lineart_anime_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LineartImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/LineartImageProcessorInvocation.ts deleted file mode 100644 index 17720e689b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LineartImageProcessorInvocation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies line art processing to image - */ -export type LineartImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'lineart_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; - /** - * Whether to use coarse mode - */ - coarse?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LoRAModelConfig.ts b/invokeai/frontend/web/src/services/api/models/LoRAModelConfig.ts deleted file mode 100644 index 184a266169..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoRAModelConfig.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { LoRAModelFormat } from './LoRAModelFormat'; -import type { ModelError } from './ModelError'; - -export type LoRAModelConfig = { - name: string; - base_model: BaseModelType; - type: 'lora'; - path: string; - description?: string; - model_format: LoRAModelFormat; - error?: ModelError; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LoRAModelFormat.ts b/invokeai/frontend/web/src/services/api/models/LoRAModelFormat.ts deleted file mode 100644 index 829f8a7c57..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoRAModelFormat.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type LoRAModelFormat = 'lycoris' | 'diffusers'; diff --git a/invokeai/frontend/web/src/services/api/models/LoadImageInvocation.ts b/invokeai/frontend/web/src/services/api/models/LoadImageInvocation.ts deleted file mode 100644 index f20d983f9b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoadImageInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Load an image and provide it as output. - */ -export type LoadImageInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'load_image'; - /** - * The image to load - */ - image?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LoraInfo.ts b/invokeai/frontend/web/src/services/api/models/LoraInfo.ts deleted file mode 100644 index 1a575d4147..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoraInfo.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelType } from './ModelType'; -import type { SubModelType } from './SubModelType'; - -export type LoraInfo = { - /** - * Info to load submodel - */ - model_name: string; - /** - * Base model - */ - base_model: BaseModelType; - /** - * Info to load submodel - */ - model_type: ModelType; - /** - * Info to load submodel - */ - submodel?: SubModelType; - /** - * Lora's weight which to use when apply to model - */ - weight: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LoraLoaderInvocation.ts b/invokeai/frontend/web/src/services/api/models/LoraLoaderInvocation.ts deleted file mode 100644 index b93281c5a7..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoraLoaderInvocation.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ClipField } from './ClipField'; -import type { UNetField } from './UNetField'; - -/** - * Apply selected lora to unet and text_encoder. - */ -export type LoraLoaderInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'lora_loader'; - /** - * Lora model name - */ - lora_name: string; - /** - * With what weight to apply lora - */ - weight?: number; - /** - * UNet model for applying lora - */ - unet?: UNetField; - /** - * Clip model for applying lora - */ - clip?: ClipField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/LoraLoaderOutput.ts b/invokeai/frontend/web/src/services/api/models/LoraLoaderOutput.ts deleted file mode 100644 index 1fed1ebc58..0000000000 --- a/invokeai/frontend/web/src/services/api/models/LoraLoaderOutput.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ClipField } from './ClipField'; -import type { UNetField } from './UNetField'; - -/** - * Model loader output - */ -export type LoraLoaderOutput = { - type?: 'lora_loader_output'; - /** - * UNet submodel - */ - unet?: UNetField; - /** - * Tokenizer and text_encoder submodels - */ - clip?: ClipField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MaskFromAlphaInvocation.ts b/invokeai/frontend/web/src/services/api/models/MaskFromAlphaInvocation.ts deleted file mode 100644 index e3693f6d98..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MaskFromAlphaInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Extracts the alpha channel of an image as a mask. - */ -export type MaskFromAlphaInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'tomask'; - /** - * The image to create the mask from - */ - image?: ImageField; - /** - * Whether or not to invert the mask - */ - invert?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MaskOutput.ts b/invokeai/frontend/web/src/services/api/models/MaskOutput.ts deleted file mode 100644 index d4594fe6e9..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MaskOutput.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Base class for invocations that output a mask - */ -export type MaskOutput = { - type: 'mask'; - /** - * The output mask - */ - mask: ImageField; - /** - * The width of the mask in pixels - */ - width?: number; - /** - * The height of the mask in pixels - */ - height?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MediapipeFaceProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/MediapipeFaceProcessorInvocation.ts deleted file mode 100644 index aa7b966b4b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MediapipeFaceProcessorInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies mediapipe face processing to image - */ -export type MediapipeFaceProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'mediapipe_face_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * Maximum number of faces to detect - */ - max_faces?: number; - /** - * Minimum confidence for face detection - */ - min_confidence?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MidasDepthImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/MidasDepthImageProcessorInvocation.ts deleted file mode 100644 index bd274228db..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MidasDepthImageProcessorInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies Midas depth processing to image - */ -export type MidasDepthImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'midas_depth_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * Midas parameter `a_mult` (a = a_mult * PI) - */ - a_mult?: number; - /** - * Midas parameter `bg_th` - */ - bg_th?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MlsdImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/MlsdImageProcessorInvocation.ts deleted file mode 100644 index 0e81c9a4b8..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MlsdImageProcessorInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies MLSD processing to image - */ -export type MlsdImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'mlsd_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; - /** - * MLSD parameter `thr_v` - */ - thr_v?: number; - /** - * MLSD parameter `thr_d` - */ - thr_d?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ModelError.ts b/invokeai/frontend/web/src/services/api/models/ModelError.ts deleted file mode 100644 index 3151a764d6..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelError.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type ModelError = 'not_found'; diff --git a/invokeai/frontend/web/src/services/api/models/ModelInfo.ts b/invokeai/frontend/web/src/services/api/models/ModelInfo.ts deleted file mode 100644 index e87799d142..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelInfo.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelType } from './ModelType'; -import type { SubModelType } from './SubModelType'; - -export type ModelInfo = { - /** - * Info to load submodel - */ - model_name: string; - /** - * Base model - */ - base_model: BaseModelType; - /** - * Info to load submodel - */ - model_type: ModelType; - /** - * Info to load submodel - */ - submodel?: SubModelType; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ModelLoaderOutput.ts b/invokeai/frontend/web/src/services/api/models/ModelLoaderOutput.ts deleted file mode 100644 index 5b5b51e71f..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelLoaderOutput.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ClipField } from './ClipField'; -import type { UNetField } from './UNetField'; -import type { VaeField } from './VaeField'; - -/** - * Model loader output - */ -export type ModelLoaderOutput = { - type?: 'model_loader_output'; - /** - * UNet submodel - */ - unet?: UNetField; - /** - * Tokenizer and text_encoder submodels - */ - clip?: ClipField; - /** - * Vae submodel - */ - vae?: VaeField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ModelType.ts b/invokeai/frontend/web/src/services/api/models/ModelType.ts deleted file mode 100644 index 7d7abcafae..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type ModelType = 'pipeline' | 'vae' | 'lora' | 'controlnet' | 'embedding'; diff --git a/invokeai/frontend/web/src/services/api/models/ModelVariantType.ts b/invokeai/frontend/web/src/services/api/models/ModelVariantType.ts deleted file mode 100644 index 0527c40bcf..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelVariantType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type ModelVariantType = 'normal' | 'inpaint' | 'depth'; diff --git a/invokeai/frontend/web/src/services/api/models/ModelsList.ts b/invokeai/frontend/web/src/services/api/models/ModelsList.ts deleted file mode 100644 index 9186db3e29..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ModelsList.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ControlNetModelConfig } from './ControlNetModelConfig'; -import type { LoRAModelConfig } from './LoRAModelConfig'; -import type { StableDiffusion1ModelCheckpointConfig } from './StableDiffusion1ModelCheckpointConfig'; -import type { StableDiffusion1ModelDiffusersConfig } from './StableDiffusion1ModelDiffusersConfig'; -import type { StableDiffusion2ModelCheckpointConfig } from './StableDiffusion2ModelCheckpointConfig'; -import type { StableDiffusion2ModelDiffusersConfig } from './StableDiffusion2ModelDiffusersConfig'; -import type { TextualInversionModelConfig } from './TextualInversionModelConfig'; -import type { VaeModelConfig } from './VaeModelConfig'; - -export type ModelsList = { - models: Array<(StableDiffusion1ModelCheckpointConfig | StableDiffusion1ModelDiffusersConfig | VaeModelConfig | LoRAModelConfig | ControlNetModelConfig | TextualInversionModelConfig | StableDiffusion2ModelCheckpointConfig | StableDiffusion2ModelDiffusersConfig)>; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/MultiplyInvocation.ts b/invokeai/frontend/web/src/services/api/models/MultiplyInvocation.ts deleted file mode 100644 index 9fd716f33d..0000000000 --- a/invokeai/frontend/web/src/services/api/models/MultiplyInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Multiplies two numbers - */ -export type MultiplyInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'mul'; - /** - * The first number - */ - 'a'?: number; - /** - * The second number - */ - 'b'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/NoiseInvocation.ts b/invokeai/frontend/web/src/services/api/models/NoiseInvocation.ts deleted file mode 100644 index 239a24bfe5..0000000000 --- a/invokeai/frontend/web/src/services/api/models/NoiseInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Generates latent noise. - */ -export type NoiseInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'noise'; - /** - * The seed to use - */ - seed?: number; - /** - * The width of the resulting noise - */ - width?: number; - /** - * The height of the resulting noise - */ - height?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/NoiseOutput.ts b/invokeai/frontend/web/src/services/api/models/NoiseOutput.ts deleted file mode 100644 index f1832d7aa2..0000000000 --- a/invokeai/frontend/web/src/services/api/models/NoiseOutput.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LatentsField } from './LatentsField'; - -/** - * Invocation noise output - */ -export type NoiseOutput = { - type?: 'noise_output'; - /** - * The output noise - */ - noise?: LatentsField; - /** - * The width of the noise in pixels - */ - width: number; - /** - * The height of the noise in pixels - */ - height: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/NormalbaeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/NormalbaeImageProcessorInvocation.ts deleted file mode 100644 index 400068171e..0000000000 --- a/invokeai/frontend/web/src/services/api/models/NormalbaeImageProcessorInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies NormalBae processing to image - */ -export type NormalbaeImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'normalbae_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_BoardDTO_.ts b/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_BoardDTO_.ts deleted file mode 100644 index 2e4734f469..0000000000 --- a/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_BoardDTO_.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BoardDTO } from './BoardDTO'; - -/** - * Offset-paginated results - */ -export type OffsetPaginatedResults_BoardDTO_ = { - /** - * Items - */ - items: Array; - /** - * Offset from which to retrieve items - */ - offset: number; - /** - * Limit of items to get - */ - limit: number; - /** - * Total number of items in result - */ - total: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_ImageDTO_.ts b/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_ImageDTO_.ts deleted file mode 100644 index 3408bea6db..0000000000 --- a/invokeai/frontend/web/src/services/api/models/OffsetPaginatedResults_ImageDTO_.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageDTO } from './ImageDTO'; - -/** - * Offset-paginated results - */ -export type OffsetPaginatedResults_ImageDTO_ = { - /** - * Items - */ - items: Array; - /** - * Offset from which to retrieve items - */ - offset: number; - /** - * Limit of items to get - */ - limit: number; - /** - * Total number of items in result - */ - total: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/OpenposeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/OpenposeImageProcessorInvocation.ts deleted file mode 100644 index 982ce8ade7..0000000000 --- a/invokeai/frontend/web/src/services/api/models/OpenposeImageProcessorInvocation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies Openpose processing to image - */ -export type OpenposeImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'openpose_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * Whether to use hands and face mode - */ - hand_and_face?: boolean; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PaginatedResults_GraphExecutionState_.ts b/invokeai/frontend/web/src/services/api/models/PaginatedResults_GraphExecutionState_.ts deleted file mode 100644 index dd9f50cd4a..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PaginatedResults_GraphExecutionState_.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { GraphExecutionState } from './GraphExecutionState'; - -/** - * Paginated results - */ -export type PaginatedResults_GraphExecutionState_ = { - /** - * Items - */ - items: Array; - /** - * Current Page - */ - page: number; - /** - * Total number of pages - */ - pages: number; - /** - * Number of items per page - */ - per_page: number; - /** - * Total number of items in result - */ - total: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ParamFloatInvocation.ts b/invokeai/frontend/web/src/services/api/models/ParamFloatInvocation.ts deleted file mode 100644 index 87c01f847f..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ParamFloatInvocation.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * A float parameter - */ -export type ParamFloatInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'param_float'; - /** - * The float value - */ - param?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ParamIntInvocation.ts b/invokeai/frontend/web/src/services/api/models/ParamIntInvocation.ts deleted file mode 100644 index 7a45d0a0ac..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ParamIntInvocation.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An integer parameter - */ -export type ParamIntInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'param_int'; - /** - * The integer value - */ - 'a'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PidiImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/PidiImageProcessorInvocation.ts deleted file mode 100644 index 91c9dc0ce5..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PidiImageProcessorInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies PIDI processing to image - */ -export type PidiImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'pidi_image_processor'; - /** - * The image to process - */ - image?: ImageField; - /** - * The pixel resolution for detection - */ - detect_resolution?: number; - /** - * The pixel resolution for the output image - */ - image_resolution?: number; - /** - * Whether to use safe mode - */ - safe?: boolean; - /** - * Whether to use scribble mode - */ - scribble?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PipelineModelField.ts b/invokeai/frontend/web/src/services/api/models/PipelineModelField.ts deleted file mode 100644 index c2f1c07fbf..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PipelineModelField.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; - -/** - * Pipeline model field - */ -export type PipelineModelField = { - /** - * Name of the model - */ - model_name: string; - /** - * Base model - */ - base_model: BaseModelType; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PipelineModelLoaderInvocation.ts b/invokeai/frontend/web/src/services/api/models/PipelineModelLoaderInvocation.ts deleted file mode 100644 index b8cdb27acf..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PipelineModelLoaderInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { PipelineModelField } from './PipelineModelField'; - -/** - * Loads a pipeline model, outputting its submodels. - */ -export type PipelineModelLoaderInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'pipeline_model_loader'; - /** - * The model to load - */ - model: PipelineModelField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PromptCollectionOutput.ts b/invokeai/frontend/web/src/services/api/models/PromptCollectionOutput.ts deleted file mode 100644 index 4444ab4d33..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PromptCollectionOutput.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Base class for invocations that output a collection of prompts - */ -export type PromptCollectionOutput = { - type: 'prompt_collection_output'; - /** - * The output prompt collection - */ - prompt_collection: Array; - /** - * The size of the prompt collection - */ - count: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/PromptOutput.ts b/invokeai/frontend/web/src/services/api/models/PromptOutput.ts deleted file mode 100644 index 5bca3f3037..0000000000 --- a/invokeai/frontend/web/src/services/api/models/PromptOutput.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Base class for invocations that output a prompt - */ -export type PromptOutput = { - type: 'prompt'; - /** - * The output prompt - */ - prompt: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/RandomIntInvocation.ts b/invokeai/frontend/web/src/services/api/models/RandomIntInvocation.ts deleted file mode 100644 index a2f7c2f02a..0000000000 --- a/invokeai/frontend/web/src/services/api/models/RandomIntInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Outputs a single random integer. - */ -export type RandomIntInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'rand_int'; - /** - * The inclusive low value - */ - low?: number; - /** - * The exclusive high value - */ - high?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/RandomRangeInvocation.ts b/invokeai/frontend/web/src/services/api/models/RandomRangeInvocation.ts deleted file mode 100644 index 925511578d..0000000000 --- a/invokeai/frontend/web/src/services/api/models/RandomRangeInvocation.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Creates a collection of random numbers - */ -export type RandomRangeInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'random_range'; - /** - * The inclusive low value - */ - low?: number; - /** - * The exclusive high value - */ - high?: number; - /** - * The number of values to generate - */ - size?: number; - /** - * The seed for the RNG (omit for random) - */ - seed?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/RangeInvocation.ts b/invokeai/frontend/web/src/services/api/models/RangeInvocation.ts deleted file mode 100644 index 3681602a95..0000000000 --- a/invokeai/frontend/web/src/services/api/models/RangeInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Creates a range of numbers from start to stop with step - */ -export type RangeInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'range'; - /** - * The start of the range - */ - start?: number; - /** - * The stop of the range - */ - stop?: number; - /** - * The step of the range - */ - step?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/RangeOfSizeInvocation.ts b/invokeai/frontend/web/src/services/api/models/RangeOfSizeInvocation.ts deleted file mode 100644 index 7dfac68d39..0000000000 --- a/invokeai/frontend/web/src/services/api/models/RangeOfSizeInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Creates a range from start to start + size with step - */ -export type RangeOfSizeInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'range_of_size'; - /** - * The start of the range - */ - start?: number; - /** - * The number of values - */ - size?: number; - /** - * The step of the range - */ - step?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ResizeLatentsInvocation.ts b/invokeai/frontend/web/src/services/api/models/ResizeLatentsInvocation.ts deleted file mode 100644 index 9a7b6c61e4..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ResizeLatentsInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LatentsField } from './LatentsField'; - -/** - * Resizes latents to explicit width/height (in pixels). Provided dimensions are floor-divided by 8. - */ -export type ResizeLatentsInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'lresize'; - /** - * The latents to resize - */ - latents?: LatentsField; - /** - * The width to resize to (px) - */ - width: number; - /** - * The height to resize to (px) - */ - height: number; - /** - * The interpolation mode - */ - mode?: 'nearest' | 'linear' | 'bilinear' | 'bicubic' | 'trilinear' | 'area' | 'nearest-exact'; - /** - * Whether or not to antialias (applied in bilinear and bicubic modes only) - */ - antialias?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ResourceOrigin.ts b/invokeai/frontend/web/src/services/api/models/ResourceOrigin.ts deleted file mode 100644 index a82edda0c1..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ResourceOrigin.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * The origin of a resource (eg image). - * - * - INTERNAL: The resource was created by the application. - * - EXTERNAL: The resource was not created by the application. - * This may be a user-initiated upload, or an internal application upload (eg Canvas init image). - */ -export type ResourceOrigin = 'internal' | 'external'; diff --git a/invokeai/frontend/web/src/services/api/models/RestoreFaceInvocation.ts b/invokeai/frontend/web/src/services/api/models/RestoreFaceInvocation.ts deleted file mode 100644 index 0bacb5d805..0000000000 --- a/invokeai/frontend/web/src/services/api/models/RestoreFaceInvocation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Restores faces in an image. - */ -export type RestoreFaceInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'restore_face'; - /** - * The input image - */ - image?: ImageField; - /** - * The strength of the restoration - */ - strength?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ScaleLatentsInvocation.ts b/invokeai/frontend/web/src/services/api/models/ScaleLatentsInvocation.ts deleted file mode 100644 index 506b21e540..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ScaleLatentsInvocation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LatentsField } from './LatentsField'; - -/** - * Scales latents by a given factor. - */ -export type ScaleLatentsInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'lscale'; - /** - * The latents to scale - */ - latents?: LatentsField; - /** - * The factor by which to scale the latents - */ - scale_factor: number; - /** - * The interpolation mode - */ - mode?: 'nearest' | 'linear' | 'bilinear' | 'bicubic' | 'trilinear' | 'area' | 'nearest-exact'; - /** - * Whether or not to antialias (applied in bilinear and bicubic modes only) - */ - antialias?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/SchedulerPredictionType.ts b/invokeai/frontend/web/src/services/api/models/SchedulerPredictionType.ts deleted file mode 100644 index fa24aab5a1..0000000000 --- a/invokeai/frontend/web/src/services/api/models/SchedulerPredictionType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type SchedulerPredictionType = 'epsilon' | 'v_prediction' | 'sample'; diff --git a/invokeai/frontend/web/src/services/api/models/ShowImageInvocation.ts b/invokeai/frontend/web/src/services/api/models/ShowImageInvocation.ts deleted file mode 100644 index 1b73055584..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ShowImageInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Displays a provided image, and passes it forward in the pipeline. - */ -export type ShowImageInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'show_image'; - /** - * The image to show - */ - image?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelCheckpointConfig.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelCheckpointConfig.ts deleted file mode 100644 index be7077cc53..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelCheckpointConfig.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; -import type { ModelVariantType } from './ModelVariantType'; - -export type StableDiffusion1ModelCheckpointConfig = { - name: string; - base_model: BaseModelType; - type: 'pipeline'; - path: string; - description?: string; - model_format: 'checkpoint'; - error?: ModelError; - vae?: string; - config?: string; - variant: ModelVariantType; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelDiffusersConfig.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelDiffusersConfig.ts deleted file mode 100644 index befe014605..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelDiffusersConfig.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; -import type { ModelVariantType } from './ModelVariantType'; - -export type StableDiffusion1ModelDiffusersConfig = { - name: string; - base_model: BaseModelType; - type: 'pipeline'; - path: string; - description?: string; - model_format: 'diffusers'; - error?: ModelError; - vae?: string; - variant: ModelVariantType; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelFormat.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelFormat.ts deleted file mode 100644 index 01b50c2fc0..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion1ModelFormat.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type StableDiffusion1ModelFormat = 'checkpoint' | 'diffusers'; diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelCheckpointConfig.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelCheckpointConfig.ts deleted file mode 100644 index dadd7cac9b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelCheckpointConfig.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; -import type { ModelVariantType } from './ModelVariantType'; -import type { SchedulerPredictionType } from './SchedulerPredictionType'; - -export type StableDiffusion2ModelCheckpointConfig = { - name: string; - base_model: BaseModelType; - type: 'pipeline'; - path: string; - description?: string; - model_format: 'checkpoint'; - error?: ModelError; - vae?: string; - config?: string; - variant: ModelVariantType; - prediction_type: SchedulerPredictionType; - upcast_attention: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelDiffusersConfig.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelDiffusersConfig.ts deleted file mode 100644 index 1e4a34c5dc..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelDiffusersConfig.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; -import type { ModelVariantType } from './ModelVariantType'; -import type { SchedulerPredictionType } from './SchedulerPredictionType'; - -export type StableDiffusion2ModelDiffusersConfig = { - name: string; - base_model: BaseModelType; - type: 'pipeline'; - path: string; - description?: string; - model_format: 'diffusers'; - error?: ModelError; - vae?: string; - variant: ModelVariantType; - prediction_type: SchedulerPredictionType; - upcast_attention: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelFormat.ts b/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelFormat.ts deleted file mode 100644 index 7e7b895231..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StableDiffusion2ModelFormat.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type StableDiffusion2ModelFormat = 'checkpoint' | 'diffusers'; diff --git a/invokeai/frontend/web/src/services/api/models/StepParamEasingInvocation.ts b/invokeai/frontend/web/src/services/api/models/StepParamEasingInvocation.ts deleted file mode 100644 index 2cff38b3e5..0000000000 --- a/invokeai/frontend/web/src/services/api/models/StepParamEasingInvocation.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Experimental per-step parameter easing for denoising steps - */ -export type StepParamEasingInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'step_param_easing'; - /** - * The easing function to use - */ - easing?: 'Linear' | 'QuadIn' | 'QuadOut' | 'QuadInOut' | 'CubicIn' | 'CubicOut' | 'CubicInOut' | 'QuarticIn' | 'QuarticOut' | 'QuarticInOut' | 'QuinticIn' | 'QuinticOut' | 'QuinticInOut' | 'SineIn' | 'SineOut' | 'SineInOut' | 'CircularIn' | 'CircularOut' | 'CircularInOut' | 'ExponentialIn' | 'ExponentialOut' | 'ExponentialInOut' | 'ElasticIn' | 'ElasticOut' | 'ElasticInOut' | 'BackIn' | 'BackOut' | 'BackInOut' | 'BounceIn' | 'BounceOut' | 'BounceInOut'; - /** - * number of denoising steps - */ - num_steps?: number; - /** - * easing starting value - */ - start_value?: number; - /** - * easing ending value - */ - end_value?: number; - /** - * fraction of steps at which to start easing - */ - start_step_percent?: number; - /** - * fraction of steps after which to end easing - */ - end_step_percent?: number; - /** - * value before easing start - */ - pre_start_value?: number; - /** - * value after easing end - */ - post_end_value?: number; - /** - * include mirror of easing function - */ - mirror?: boolean; - /** - * show easing plot - */ - show_easing_plot?: boolean; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/SubModelType.ts b/invokeai/frontend/web/src/services/api/models/SubModelType.ts deleted file mode 100644 index 12b055994c..0000000000 --- a/invokeai/frontend/web/src/services/api/models/SubModelType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type SubModelType = 'unet' | 'text_encoder' | 'tokenizer' | 'vae' | 'scheduler' | 'safety_checker'; diff --git a/invokeai/frontend/web/src/services/api/models/SubtractInvocation.ts b/invokeai/frontend/web/src/services/api/models/SubtractInvocation.ts deleted file mode 100644 index 23334bd891..0000000000 --- a/invokeai/frontend/web/src/services/api/models/SubtractInvocation.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * Subtracts two numbers - */ -export type SubtractInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'sub'; - /** - * The first number - */ - 'a'?: number; - /** - * The second number - */ - 'b'?: number; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/TextToLatentsInvocation.ts b/invokeai/frontend/web/src/services/api/models/TextToLatentsInvocation.ts deleted file mode 100644 index cf8229b1f7..0000000000 --- a/invokeai/frontend/web/src/services/api/models/TextToLatentsInvocation.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ConditioningField } from './ConditioningField'; -import type { ControlField } from './ControlField'; -import type { LatentsField } from './LatentsField'; -import type { UNetField } from './UNetField'; - -/** - * Generates latents from conditionings. - */ -export type TextToLatentsInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 't2l'; - /** - * Positive conditioning for generation - */ - positive_conditioning?: ConditioningField; - /** - * Negative conditioning for generation - */ - negative_conditioning?: ConditioningField; - /** - * The noise to use - */ - noise?: LatentsField; - /** - * The number of steps to use to generate the image - */ - steps?: number; - /** - * The Classifier-Free Guidance, higher values may result in a result closer to the prompt - */ - cfg_scale?: (number | Array); - /** - * The scheduler to use - */ - scheduler?: 'ddim' | 'ddpm' | 'deis' | 'lms' | 'lms_k' | 'pndm' | 'heun' | 'heun_k' | 'euler' | 'euler_k' | 'euler_a' | 'kdpm_2' | 'kdpm_2_a' | 'dpmpp_2s' | 'dpmpp_2s_k' | 'dpmpp_2m' | 'dpmpp_2m_k' | 'dpmpp_2m_sde' | 'dpmpp_2m_sde_k' | 'dpmpp_sde' | 'dpmpp_sde_k' | 'unipc'; - /** - * UNet submodel - */ - unet?: UNetField; - /** - * The control to use - */ - control?: (ControlField | Array); -}; - diff --git a/invokeai/frontend/web/src/services/api/models/TextualInversionModelConfig.ts b/invokeai/frontend/web/src/services/api/models/TextualInversionModelConfig.ts deleted file mode 100644 index 97d6aa7ffa..0000000000 --- a/invokeai/frontend/web/src/services/api/models/TextualInversionModelConfig.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; - -export type TextualInversionModelConfig = { - name: string; - base_model: BaseModelType; - type: 'embedding'; - path: string; - description?: string; - model_format: null; - error?: ModelError; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/UNetField.ts b/invokeai/frontend/web/src/services/api/models/UNetField.ts deleted file mode 100644 index ad3b1ddb5b..0000000000 --- a/invokeai/frontend/web/src/services/api/models/UNetField.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { LoraInfo } from './LoraInfo'; -import type { ModelInfo } from './ModelInfo'; - -export type UNetField = { - /** - * Info to load unet submodel - */ - unet: ModelInfo; - /** - * Info to load scheduler submodel - */ - scheduler: ModelInfo; - /** - * Loras to apply on model loading - */ - loras: Array; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/UpscaleInvocation.ts b/invokeai/frontend/web/src/services/api/models/UpscaleInvocation.ts deleted file mode 100644 index d0aca63964..0000000000 --- a/invokeai/frontend/web/src/services/api/models/UpscaleInvocation.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Upscales an image. - */ -export type UpscaleInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'upscale'; - /** - * The input image - */ - image?: ImageField; - /** - * The strength - */ - strength?: number; - /** - * The upscale level - */ - level?: 2 | 4; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/VaeField.ts b/invokeai/frontend/web/src/services/api/models/VaeField.ts deleted file mode 100644 index bfe2793887..0000000000 --- a/invokeai/frontend/web/src/services/api/models/VaeField.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ModelInfo } from './ModelInfo'; - -export type VaeField = { - /** - * Info to load vae submodel - */ - vae: ModelInfo; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/VaeModelConfig.ts b/invokeai/frontend/web/src/services/api/models/VaeModelConfig.ts deleted file mode 100644 index a73ee0aa32..0000000000 --- a/invokeai/frontend/web/src/services/api/models/VaeModelConfig.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { BaseModelType } from './BaseModelType'; -import type { ModelError } from './ModelError'; -import type { VaeModelFormat } from './VaeModelFormat'; - -export type VaeModelConfig = { - name: string; - base_model: BaseModelType; - type: 'vae'; - path: string; - description?: string; - model_format: VaeModelFormat; - error?: ModelError; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/VaeModelFormat.ts b/invokeai/frontend/web/src/services/api/models/VaeModelFormat.ts deleted file mode 100644 index 497f81d16f..0000000000 --- a/invokeai/frontend/web/src/services/api/models/VaeModelFormat.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * An enumeration. - */ -export type VaeModelFormat = 'checkpoint' | 'diffusers'; diff --git a/invokeai/frontend/web/src/services/api/models/VaeRepo.ts b/invokeai/frontend/web/src/services/api/models/VaeRepo.ts deleted file mode 100644 index 0e233626c6..0000000000 --- a/invokeai/frontend/web/src/services/api/models/VaeRepo.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type VaeRepo = { - /** - * The repo ID to use for this VAE - */ - repo_id: string; - /** - * The path to the VAE - */ - path?: string; - /** - * The subfolder to use for this VAE - */ - subfolder?: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ValidationError.ts b/invokeai/frontend/web/src/services/api/models/ValidationError.ts deleted file mode 100644 index 14e1fdecd0..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ValidationError.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ValidationError = { - loc: Array<(string | number)>; - msg: string; - type: string; -}; - diff --git a/invokeai/frontend/web/src/services/api/models/ZoeDepthImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/models/ZoeDepthImageProcessorInvocation.ts deleted file mode 100644 index 6caded8f04..0000000000 --- a/invokeai/frontend/web/src/services/api/models/ZoeDepthImageProcessorInvocation.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ImageField } from './ImageField'; - -/** - * Applies Zoe depth processing to image - */ -export type ZoeDepthImageProcessorInvocation = { - /** - * The id of this node. Must be unique among all nodes. - */ - id: string; - /** - * Whether or not this node is an intermediate node. - */ - is_intermediate?: boolean; - type?: 'zoe_depth_image_processor'; - /** - * The image to process - */ - image?: ImageField; -}; - diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts new file mode 100644 index 0000000000..1045b5e4bc --- /dev/null +++ b/invokeai/frontend/web/src/services/api/schema.d.ts @@ -0,0 +1,5057 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export type paths = { + "/api/v1/sessions/": { + /** + * List Sessions + * @description Gets a list of sessions, optionally searching + */ + get: operations["list_sessions"]; + /** + * Create Session + * @description Creates a new session, optionally initializing it with an invocation graph + */ + post: operations["create_session"]; + }; + "/api/v1/sessions/{session_id}": { + /** + * Get Session + * @description Gets a session + */ + get: operations["get_session"]; + }; + "/api/v1/sessions/{session_id}/nodes": { + /** + * Add Node + * @description Adds a node to the graph + */ + post: operations["add_node"]; + }; + "/api/v1/sessions/{session_id}/nodes/{node_path}": { + /** + * Update Node + * @description Updates a node in the graph and removes all linked edges + */ + put: operations["update_node"]; + /** + * Delete Node + * @description Deletes a node in the graph and removes all linked edges + */ + delete: operations["delete_node"]; + }; + "/api/v1/sessions/{session_id}/edges": { + /** + * Add Edge + * @description Adds an edge to the graph + */ + post: operations["add_edge"]; + }; + "/api/v1/sessions/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}": { + /** + * Delete Edge + * @description Deletes an edge from the graph + */ + delete: operations["delete_edge"]; + }; + "/api/v1/sessions/{session_id}/invoke": { + /** + * Invoke Session + * @description Invokes a session + */ + put: operations["invoke_session"]; + /** + * Cancel Session Invoke + * @description Invokes a session + */ + delete: operations["cancel_session_invoke"]; + }; + "/api/v1/models/": { + /** + * List Models + * @description Gets a list of models + */ + get: operations["list_models"]; + /** + * Update Model + * @description Add Model + */ + post: operations["update_model"]; + }; + "/api/v1/models/{model_name}": { + /** + * Delete Model + * @description Delete Model + */ + delete: operations["del_model"]; + }; + "/api/v1/images/": { + /** + * List Images With Metadata + * @description Gets a list of images + */ + get: operations["list_images_with_metadata"]; + /** + * Upload Image + * @description Uploads an image + */ + post: operations["upload_image"]; + }; + "/api/v1/images/{image_name}": { + /** + * Get Image Full + * @description Gets a full-resolution image file + */ + get: operations["get_image_full"]; + /** + * Delete Image + * @description Deletes an image + */ + delete: operations["delete_image"]; + /** + * Update Image + * @description Updates an image + */ + patch: operations["update_image"]; + }; + "/api/v1/images/{image_name}/metadata": { + /** + * Get Image Metadata + * @description Gets an image's metadata + */ + get: operations["get_image_metadata"]; + }; + "/api/v1/images/{image_name}/thumbnail": { + /** + * Get Image Thumbnail + * @description Gets a thumbnail image file + */ + get: operations["get_image_thumbnail"]; + }; + "/api/v1/images/{image_name}/urls": { + /** + * Get Image Urls + * @description Gets an image and thumbnail URL + */ + get: operations["get_image_urls"]; + }; + "/api/v1/boards/": { + /** + * List Boards + * @description Gets a list of boards + */ + get: operations["list_boards"]; + /** + * Create Board + * @description Creates a board + */ + post: operations["create_board"]; + }; + "/api/v1/boards/{board_id}": { + /** + * Get Board + * @description Gets a board + */ + get: operations["get_board"]; + /** + * Delete Board + * @description Deletes a board + */ + delete: operations["delete_board"]; + /** + * Update Board + * @description Updates a board + */ + patch: operations["update_board"]; + }; + "/api/v1/board_images/": { + /** + * Create Board Image + * @description Creates a board_image + */ + post: operations["create_board_image"]; + /** + * Remove Board Image + * @description Deletes a board_image + */ + delete: operations["remove_board_image"]; + }; + "/api/v1/board_images/{board_id}": { + /** + * List Board Images + * @description Gets a list of images for a board + */ + get: operations["list_board_images"]; + }; +}; + +export type webhooks = Record; + +export type components = { + schemas: { + /** + * AddInvocation + * @description Adds two numbers + */ + AddInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default add + * @enum {string} + */ + type?: "add"; + /** + * A + * @description The first number + * @default 0 + */ + a?: number; + /** + * B + * @description The second number + * @default 0 + */ + b?: number; + }; + /** + * BaseModelType + * @description An enumeration. + * @enum {string} + */ + BaseModelType: "sd-1" | "sd-2"; + /** BoardChanges */ + BoardChanges: { + /** + * Board Name + * @description The board's new name. + */ + board_name?: string; + /** + * Cover Image Name + * @description The name of the board's new cover image. + */ + cover_image_name?: string; + }; + /** + * BoardDTO + * @description Deserialized board record with cover image URL and image count. + */ + BoardDTO: { + /** + * Board Id + * @description The unique ID of the board. + */ + board_id: string; + /** + * Board Name + * @description The name of the board. + */ + board_name: string; + /** + * Created At + * @description The created timestamp of the board. + */ + created_at: string; + /** + * Updated At + * @description The updated timestamp of the board. + */ + updated_at: string; + /** + * Deleted At + * @description The deleted timestamp of the board. + */ + deleted_at?: string; + /** + * Cover Image Name + * @description The name of the board's cover image. + */ + cover_image_name?: string; + /** + * Image Count + * @description The number of images in the board. + */ + image_count: number; + }; + /** Body_create_board_image */ + Body_create_board_image: { + /** + * Board Id + * @description The id of the board to add to + */ + board_id: string; + /** + * Image Name + * @description The name of the image to add + */ + image_name: string; + }; + /** Body_remove_board_image */ + Body_remove_board_image: { + /** + * Board Id + * @description The id of the board + */ + board_id: string; + /** + * Image Name + * @description The name of the image to remove + */ + image_name: string; + }; + /** Body_upload_image */ + Body_upload_image: { + /** + * File + * Format: binary + */ + file: string; + }; + /** + * CannyImageProcessorInvocation + * @description Canny edge detection for ControlNet + */ + CannyImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default canny_image_processor + * @enum {string} + */ + type?: "canny_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Low Threshold + * @description The low threshold of the Canny pixel gradient (0-255) + * @default 100 + */ + low_threshold?: number; + /** + * High Threshold + * @description The high threshold of the Canny pixel gradient (0-255) + * @default 200 + */ + high_threshold?: number; + }; + /** CkptModelInfo */ + CkptModelInfo: { + /** + * Description + * @description A description of the model + */ + description?: string; + /** + * Model Name + * @description The name of the model + */ + model_name: string; + /** + * Model Type + * @description The type of the model + */ + model_type: string; + /** + * Format + * @default ckpt + * @enum {string} + */ + format?: "ckpt"; + /** + * Config + * @description The path to the model config + */ + config: string; + /** + * Weights + * @description The path to the model weights + */ + weights: string; + /** + * Vae + * @description The path to the model VAE + */ + vae: string; + /** + * Width + * @description The width of the model + */ + width?: number; + /** + * Height + * @description The height of the model + */ + height?: number; + }; + /** ClipField */ + ClipField: { + /** + * Tokenizer + * @description Info to load tokenizer submodel + */ + tokenizer: components["schemas"]["ModelInfo"]; + /** + * Text Encoder + * @description Info to load text_encoder submodel + */ + text_encoder: components["schemas"]["ModelInfo"]; + /** + * Loras + * @description Loras to apply on model loading + */ + loras: (components["schemas"]["LoraInfo"])[]; + }; + /** + * CollectInvocation + * @description Collects values into a collection + */ + CollectInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default collect + * @enum {string} + */ + type?: "collect"; + /** + * Item + * @description The item to collect (all inputs must be of the same type) + */ + item?: unknown; + /** + * Collection + * @description The collection, will be provided on execution + */ + collection?: (unknown)[]; + }; + /** + * CollectInvocationOutput + * @description Base class for all invocation outputs + */ + CollectInvocationOutput: { + /** + * Type + * @default collect_output + * @enum {string} + */ + type: "collect_output"; + /** + * Collection + * @description The collection of input items + */ + collection: (unknown)[]; + }; + /** ColorField */ + ColorField: { + /** + * R + * @description The red component + */ + r: number; + /** + * G + * @description The green component + */ + g: number; + /** + * B + * @description The blue component + */ + b: number; + /** + * A + * @description The alpha component + */ + a: number; + }; + /** + * CompelInvocation + * @description Parse prompt using compel package to conditioning. + */ + CompelInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default compel + * @enum {string} + */ + type?: "compel"; + /** + * Prompt + * @description Prompt + * @default + */ + prompt?: string; + /** + * Clip + * @description Clip to use + */ + clip?: components["schemas"]["ClipField"]; + }; + /** + * CompelOutput + * @description Compel parser output + */ + CompelOutput: { + /** + * Type + * @default compel_output + * @enum {string} + */ + type?: "compel_output"; + /** + * Conditioning + * @description Conditioning + */ + conditioning?: components["schemas"]["ConditioningField"]; + }; + /** ConditioningField */ + ConditioningField: { + /** + * Conditioning Name + * @description The name of conditioning data + */ + conditioning_name: string; + }; + /** + * ContentShuffleImageProcessorInvocation + * @description Applies content shuffle processing to image + */ + ContentShuffleImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default content_shuffle_image_processor + * @enum {string} + */ + type?: "content_shuffle_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + /** + * H + * @description Content shuffle `h` parameter + * @default 512 + */ + h?: number; + /** + * W + * @description Content shuffle `w` parameter + * @default 512 + */ + w?: number; + /** + * F + * @description Content shuffle `f` parameter + * @default 256 + */ + f?: number; + }; + /** ControlField */ + ControlField: { + /** + * Image + * @description The control image + */ + image: components["schemas"]["ImageField"]; + /** + * Control Model + * @description The ControlNet model to use + */ + control_model: string; + /** + * Control Weight + * @description The weight given to the ControlNet + * @default 1 + */ + control_weight: number | (number)[]; + /** + * Begin Step Percent + * @description When the ControlNet is first applied (% of total steps) + * @default 0 + */ + begin_step_percent: number; + /** + * End Step Percent + * @description When the ControlNet is last applied (% of total steps) + * @default 1 + */ + end_step_percent: number; + }; + /** + * ControlNetInvocation + * @description Collects ControlNet info to pass to other nodes + */ + ControlNetInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default controlnet + * @enum {string} + */ + type?: "controlnet"; + /** + * Image + * @description The control image + */ + image?: components["schemas"]["ImageField"]; + /** + * Control Model + * @description control model used + * @default lllyasviel/sd-controlnet-canny + * @enum {string} + */ + control_model?: "lllyasviel/sd-controlnet-canny" | "lllyasviel/sd-controlnet-depth" | "lllyasviel/sd-controlnet-hed" | "lllyasviel/sd-controlnet-seg" | "lllyasviel/sd-controlnet-openpose" | "lllyasviel/sd-controlnet-scribble" | "lllyasviel/sd-controlnet-normal" | "lllyasviel/sd-controlnet-mlsd" | "lllyasviel/control_v11p_sd15_canny" | "lllyasviel/control_v11p_sd15_openpose" | "lllyasviel/control_v11p_sd15_seg" | "lllyasviel/control_v11f1p_sd15_depth" | "lllyasviel/control_v11p_sd15_normalbae" | "lllyasviel/control_v11p_sd15_scribble" | "lllyasviel/control_v11p_sd15_mlsd" | "lllyasviel/control_v11p_sd15_softedge" | "lllyasviel/control_v11p_sd15s2_lineart_anime" | "lllyasviel/control_v11p_sd15_lineart" | "lllyasviel/control_v11p_sd15_inpaint" | "lllyasviel/control_v11e_sd15_shuffle" | "lllyasviel/control_v11e_sd15_ip2p" | "lllyasviel/control_v11f1e_sd15_tile" | "thibaud/controlnet-sd21-openpose-diffusers" | "thibaud/controlnet-sd21-canny-diffusers" | "thibaud/controlnet-sd21-depth-diffusers" | "thibaud/controlnet-sd21-scribble-diffusers" | "thibaud/controlnet-sd21-hed-diffusers" | "thibaud/controlnet-sd21-zoedepth-diffusers" | "thibaud/controlnet-sd21-color-diffusers" | "thibaud/controlnet-sd21-openposev2-diffusers" | "thibaud/controlnet-sd21-lineart-diffusers" | "thibaud/controlnet-sd21-normalbae-diffusers" | "thibaud/controlnet-sd21-ade20k-diffusers" | "CrucibleAI/ControlNetMediaPipeFace,diffusion_sd15" | "CrucibleAI/ControlNetMediaPipeFace"; + /** + * Control Weight + * @description The weight given to the ControlNet + * @default 1 + */ + control_weight?: number | (number)[]; + /** + * Begin Step Percent + * @description When the ControlNet is first applied (% of total steps) + * @default 0 + */ + begin_step_percent?: number; + /** + * End Step Percent + * @description When the ControlNet is last applied (% of total steps) + * @default 1 + */ + end_step_percent?: number; + }; + /** ControlNetModelConfig */ + ControlNetModelConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "controlnet"; + /** Path */ + path: string; + /** Description */ + description?: string; + model_format: components["schemas"]["ControlNetModelFormat"]; + error?: components["schemas"]["ModelError"]; + }; + /** + * ControlNetModelFormat + * @description An enumeration. + * @enum {string} + */ + ControlNetModelFormat: "checkpoint" | "diffusers"; + /** + * ControlOutput + * @description node output for ControlNet info + */ + ControlOutput: { + /** + * Type + * @default control_output + * @enum {string} + */ + type?: "control_output"; + /** + * Control + * @description The control info + */ + control?: components["schemas"]["ControlField"]; + }; + /** CreateModelRequest */ + CreateModelRequest: { + /** + * Name + * @description The name of the model + */ + name: string; + /** + * Info + * @description The model info + */ + info: components["schemas"]["CkptModelInfo"] | components["schemas"]["DiffusersModelInfo"]; + }; + /** + * CvInpaintInvocation + * @description Simple inpaint using opencv. + */ + CvInpaintInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default cv_inpaint + * @enum {string} + */ + type?: "cv_inpaint"; + /** + * Image + * @description The image to inpaint + */ + image?: components["schemas"]["ImageField"]; + /** + * Mask + * @description The mask to use when inpainting + */ + mask?: components["schemas"]["ImageField"]; + }; + /** DiffusersModelInfo */ + DiffusersModelInfo: { + /** + * Description + * @description A description of the model + */ + description?: string; + /** + * Model Name + * @description The name of the model + */ + model_name: string; + /** + * Model Type + * @description The type of the model + */ + model_type: string; + /** + * Format + * @default folder + * @enum {string} + */ + format?: "folder"; + /** + * Vae + * @description The VAE repo to use for this model + */ + vae?: components["schemas"]["VaeRepo"]; + /** + * Repo Id + * @description The repo ID to use for this model + */ + repo_id?: string; + /** + * Path + * @description The path to the model + */ + path?: string; + }; + /** + * DivideInvocation + * @description Divides two numbers + */ + DivideInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default div + * @enum {string} + */ + type?: "div"; + /** + * A + * @description The first number + * @default 0 + */ + a?: number; + /** + * B + * @description The second number + * @default 0 + */ + b?: number; + }; + /** + * DynamicPromptInvocation + * @description Parses a prompt using adieyal/dynamicprompts' random or combinatorial generator + */ + DynamicPromptInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default dynamic_prompt + * @enum {string} + */ + type?: "dynamic_prompt"; + /** + * Prompt + * @description The prompt to parse with dynamicprompts + */ + prompt: string; + /** + * Max Prompts + * @description The number of prompts to generate + * @default 1 + */ + max_prompts?: number; + /** + * Combinatorial + * @description Whether to use the combinatorial generator + * @default false + */ + combinatorial?: boolean; + }; + /** Edge */ + Edge: { + /** + * Source + * @description The connection for the edge's from node and field + */ + source: components["schemas"]["EdgeConnection"]; + /** + * Destination + * @description The connection for the edge's to node and field + */ + destination: components["schemas"]["EdgeConnection"]; + }; + /** EdgeConnection */ + EdgeConnection: { + /** + * Node Id + * @description The id of the node for this edge connection + */ + node_id: string; + /** + * Field + * @description The field for this connection + */ + field: string; + }; + /** + * FloatCollectionOutput + * @description A collection of floats + */ + FloatCollectionOutput: { + /** + * Type + * @default float_collection + * @enum {string} + */ + type?: "float_collection"; + /** + * Collection + * @description The float collection + * @default [] + */ + collection?: (number)[]; + }; + /** + * FloatLinearRangeInvocation + * @description Creates a range + */ + FloatLinearRangeInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default float_range + * @enum {string} + */ + type?: "float_range"; + /** + * Start + * @description The first value of the range + * @default 5 + */ + start?: number; + /** + * Stop + * @description The last value of the range + * @default 10 + */ + stop?: number; + /** + * Steps + * @description number of values to interpolate over (including start and stop) + * @default 30 + */ + steps?: number; + }; + /** + * FloatOutput + * @description A float output + */ + FloatOutput: { + /** + * Type + * @default float_output + * @enum {string} + */ + type?: "float_output"; + /** + * Param + * @description The output float + */ + param?: number; + }; + /** Graph */ + Graph: { + /** + * Id + * @description The id of this graph + */ + id?: string; + /** + * Nodes + * @description The nodes in this graph + */ + nodes?: { + [key: string]: (components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["PipelineModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["UpscaleInvocation"] | components["schemas"]["RestoreFaceInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]) | undefined; + }; + /** + * Edges + * @description The connections between nodes and their fields in this graph + */ + edges?: (components["schemas"]["Edge"])[]; + }; + /** + * GraphExecutionState + * @description Tracks the state of a graph execution + */ + GraphExecutionState: { + /** + * Id + * @description The id of the execution state + */ + id: string; + /** + * Graph + * @description The graph being executed + */ + graph: components["schemas"]["Graph"]; + /** + * Execution Graph + * @description The expanded graph of activated and executed nodes + */ + execution_graph: components["schemas"]["Graph"]; + /** + * Executed + * @description The set of node ids that have been executed + */ + executed: (string)[]; + /** + * Executed History + * @description The list of node ids that have been executed, in order of execution + */ + executed_history: (string)[]; + /** + * Results + * @description The results of node executions + */ + results: { + [key: string]: (components["schemas"]["ImageOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["PromptOutput"] | components["schemas"]["PromptCollectionOutput"] | components["schemas"]["CompelOutput"] | components["schemas"]["IntOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["IntCollectionOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"]) | undefined; + }; + /** + * Errors + * @description Errors raised when executing nodes + */ + errors: { + [key: string]: string | undefined; + }; + /** + * Prepared Source Mapping + * @description The map of prepared nodes to original graph nodes + */ + prepared_source_mapping: { + [key: string]: string | undefined; + }; + /** + * Source Prepared Mapping + * @description The map of original graph nodes to prepared nodes + */ + source_prepared_mapping: { + [key: string]: (string)[] | undefined; + }; + }; + /** + * GraphInvocation + * @description Execute a graph + */ + GraphInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default graph + * @enum {string} + */ + type?: "graph"; + /** + * Graph + * @description The graph to run + */ + graph?: components["schemas"]["Graph"]; + }; + /** + * GraphInvocationOutput + * @description Base class for all invocation outputs + */ + GraphInvocationOutput: { + /** + * Type + * @default graph_output + * @enum {string} + */ + type: "graph_output"; + }; + /** HTTPValidationError */ + HTTPValidationError: { + /** Detail */ + detail?: (components["schemas"]["ValidationError"])[]; + }; + /** + * HedImageProcessorInvocation + * @description Applies HED edge detection to image + */ + HedImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default hed_image_processor + * @enum {string} + */ + type?: "hed_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + /** + * Scribble + * @description Whether to use scribble mode + * @default false + */ + scribble?: boolean; + }; + /** + * ImageBlurInvocation + * @description Blurs an image + */ + ImageBlurInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_blur + * @enum {string} + */ + type?: "img_blur"; + /** + * Image + * @description The image to blur + */ + image?: components["schemas"]["ImageField"]; + /** + * Radius + * @description The blur radius + * @default 8 + */ + radius?: number; + /** + * Blur Type + * @description The type of blur + * @default gaussian + * @enum {string} + */ + blur_type?: "gaussian" | "box"; + }; + /** + * ImageCategory + * @description The category of an image. + * + * - GENERAL: The image is an output, init image, or otherwise an image without a specialized purpose. + * - MASK: The image is a mask image. + * - CONTROL: The image is a ControlNet control image. + * - USER: The image is a user-provide image. + * - OTHER: The image is some other type of image with a specialized purpose. To be used by external nodes. + * @enum {string} + */ + ImageCategory: "general" | "mask" | "control" | "user" | "other"; + /** + * ImageChannelInvocation + * @description Gets a channel from an image. + */ + ImageChannelInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_chan + * @enum {string} + */ + type?: "img_chan"; + /** + * Image + * @description The image to get the channel from + */ + image?: components["schemas"]["ImageField"]; + /** + * Channel + * @description The channel to get + * @default A + * @enum {string} + */ + channel?: "A" | "R" | "G" | "B"; + }; + /** + * ImageConvertInvocation + * @description Converts an image to a different mode. + */ + ImageConvertInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_conv + * @enum {string} + */ + type?: "img_conv"; + /** + * Image + * @description The image to convert + */ + image?: components["schemas"]["ImageField"]; + /** + * Mode + * @description The mode to convert to + * @default L + * @enum {string} + */ + mode?: "L" | "RGB" | "RGBA" | "CMYK" | "YCbCr" | "LAB" | "HSV" | "I" | "F"; + }; + /** + * ImageCropInvocation + * @description Crops an image to a specified box. The box can be outside of the image. + */ + ImageCropInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_crop + * @enum {string} + */ + type?: "img_crop"; + /** + * Image + * @description The image to crop + */ + image?: components["schemas"]["ImageField"]; + /** + * X + * @description The left x coordinate of the crop rectangle + * @default 0 + */ + x?: number; + /** + * Y + * @description The top y coordinate of the crop rectangle + * @default 0 + */ + y?: number; + /** + * Width + * @description The width of the crop rectangle + * @default 512 + */ + width?: number; + /** + * Height + * @description The height of the crop rectangle + * @default 512 + */ + height?: number; + }; + /** + * ImageDTO + * @description Deserialized image record, enriched for the frontend. + */ + ImageDTO: { + /** + * Image Name + * @description The unique name of the image. + */ + image_name: string; + /** + * Image Url + * @description The URL of the image. + */ + image_url: string; + /** + * Thumbnail Url + * @description The URL of the image's thumbnail. + */ + thumbnail_url: string; + /** @description The type of the image. */ + image_origin: components["schemas"]["ResourceOrigin"]; + /** @description The category of the image. */ + image_category: components["schemas"]["ImageCategory"]; + /** + * Width + * @description The width of the image in px. + */ + width: number; + /** + * Height + * @description The height of the image in px. + */ + height: number; + /** + * Created At + * @description The created timestamp of the image. + */ + created_at: string; + /** + * Updated At + * @description The updated timestamp of the image. + */ + updated_at: string; + /** + * Deleted At + * @description The deleted timestamp of the image. + */ + deleted_at?: string; + /** + * Is Intermediate + * @description Whether this is an intermediate image. + */ + is_intermediate: boolean; + /** + * Session Id + * @description The session ID that generated this image, if it is a generated image. + */ + session_id?: string; + /** + * Node Id + * @description The node ID that generated this image, if it is a generated image. + */ + node_id?: string; + /** + * Metadata + * @description A limited subset of the image's generation metadata. Retrieve the image's session for full metadata. + */ + metadata?: components["schemas"]["ImageMetadata"]; + /** + * Board Id + * @description The id of the board the image belongs to, if one exists. + */ + board_id?: string; + }; + /** + * ImageField + * @description An image field used for passing image objects between invocations + */ + ImageField: { + /** + * Image Name + * @description The name of the image + */ + image_name: string; + }; + /** + * ImageInverseLerpInvocation + * @description Inverse linear interpolation of all pixels of an image + */ + ImageInverseLerpInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_ilerp + * @enum {string} + */ + type?: "img_ilerp"; + /** + * Image + * @description The image to lerp + */ + image?: components["schemas"]["ImageField"]; + /** + * Min + * @description The minimum input value + * @default 0 + */ + min?: number; + /** + * Max + * @description The maximum input value + * @default 255 + */ + max?: number; + }; + /** + * ImageLerpInvocation + * @description Linear interpolation of all pixels of an image + */ + ImageLerpInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_lerp + * @enum {string} + */ + type?: "img_lerp"; + /** + * Image + * @description The image to lerp + */ + image?: components["schemas"]["ImageField"]; + /** + * Min + * @description The minimum output value + * @default 0 + */ + min?: number; + /** + * Max + * @description The maximum output value + * @default 255 + */ + max?: number; + }; + /** + * ImageMetadata + * @description Core generation metadata for an image/tensor generated in InvokeAI. + * + * Also includes any metadata from the image's PNG tEXt chunks. + * + * Generated by traversing the execution graph, collecting the parameters of the nearest ancestors + * of a given node. + * + * Full metadata may be accessed by querying for the session in the `graph_executions` table. + */ + ImageMetadata: { + /** + * Type + * @description The type of the ancestor node of the image output node. + */ + type?: string; + /** + * Positive Conditioning + * @description The positive conditioning. + */ + positive_conditioning?: string; + /** + * Negative Conditioning + * @description The negative conditioning. + */ + negative_conditioning?: string; + /** + * Width + * @description Width of the image/latents in pixels. + */ + width?: number; + /** + * Height + * @description Height of the image/latents in pixels. + */ + height?: number; + /** + * Seed + * @description The seed used for noise generation. + */ + seed?: number; + /** + * Cfg Scale + * @description The classifier-free guidance scale. + */ + cfg_scale?: number | (number)[]; + /** + * Steps + * @description The number of steps used for inference. + */ + steps?: number; + /** + * Scheduler + * @description The scheduler used for inference. + */ + scheduler?: string; + /** + * Model + * @description The model used for inference. + */ + model?: string; + /** + * Strength + * @description The strength used for image-to-image/latents-to-latents. + */ + strength?: number; + /** + * Latents + * @description The ID of the initial latents. + */ + latents?: string; + /** + * Vae + * @description The VAE used for decoding. + */ + vae?: string; + /** + * Unet + * @description The UNet used dor inference. + */ + unet?: string; + /** + * Clip + * @description The CLIP Encoder used for conditioning. + */ + clip?: string; + /** + * Extra + * @description Uploaded image metadata, extracted from the PNG tEXt chunk. + */ + extra?: string; + }; + /** + * ImageMultiplyInvocation + * @description Multiplies two images together using `PIL.ImageChops.multiply()`. + */ + ImageMultiplyInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_mul + * @enum {string} + */ + type?: "img_mul"; + /** + * Image1 + * @description The first image to multiply + */ + image1?: components["schemas"]["ImageField"]; + /** + * Image2 + * @description The second image to multiply + */ + image2?: components["schemas"]["ImageField"]; + }; + /** + * ImageOutput + * @description Base class for invocations that output an image + */ + ImageOutput: { + /** + * Type + * @default image_output + * @enum {string} + */ + type: "image_output"; + /** + * Image + * @description The output image + */ + image: components["schemas"]["ImageField"]; + /** + * Width + * @description The width of the image in pixels + */ + width: number; + /** + * Height + * @description The height of the image in pixels + */ + height: number; + }; + /** + * ImagePasteInvocation + * @description Pastes an image into another image. + */ + ImagePasteInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_paste + * @enum {string} + */ + type?: "img_paste"; + /** + * Base Image + * @description The base image + */ + base_image?: components["schemas"]["ImageField"]; + /** + * Image + * @description The image to paste + */ + image?: components["schemas"]["ImageField"]; + /** + * Mask + * @description The mask to use when pasting + */ + mask?: components["schemas"]["ImageField"]; + /** + * X + * @description The left x coordinate at which to paste the image + * @default 0 + */ + x?: number; + /** + * Y + * @description The top y coordinate at which to paste the image + * @default 0 + */ + y?: number; + }; + /** + * ImageProcessorInvocation + * @description Base class for invocations that preprocess images for ControlNet + */ + ImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default image_processor + * @enum {string} + */ + type?: "image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + }; + /** + * ImageRecordChanges + * @description A set of changes to apply to an image record. + * + * Only limited changes are valid: + * - `image_category`: change the category of an image + * - `session_id`: change the session associated with an image + * - `is_intermediate`: change the image's `is_intermediate` flag + */ + ImageRecordChanges: { + /** @description The image's new category. */ + image_category?: components["schemas"]["ImageCategory"]; + /** + * Session Id + * @description The image's new session ID. + */ + session_id?: string; + /** + * Is Intermediate + * @description The image's new `is_intermediate` flag. + */ + is_intermediate?: boolean; + }; + /** + * ImageResizeInvocation + * @description Resizes an image to specific dimensions + */ + ImageResizeInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_resize + * @enum {string} + */ + type?: "img_resize"; + /** + * Image + * @description The image to resize + */ + image?: components["schemas"]["ImageField"]; + /** + * Width + * @description The width to resize to (px) + */ + width: number; + /** + * Height + * @description The height to resize to (px) + */ + height: number; + /** + * Resample Mode + * @description The resampling mode + * @default bicubic + * @enum {string} + */ + resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos"; + }; + /** + * ImageScaleInvocation + * @description Scales an image by a factor + */ + ImageScaleInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_scale + * @enum {string} + */ + type?: "img_scale"; + /** + * Image + * @description The image to scale + */ + image?: components["schemas"]["ImageField"]; + /** + * Scale Factor + * @description The factor by which to scale the image + */ + scale_factor: number; + /** + * Resample Mode + * @description The resampling mode + * @default bicubic + * @enum {string} + */ + resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos"; + }; + /** + * ImageToLatentsInvocation + * @description Encodes an image into latents. + */ + ImageToLatentsInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default i2l + * @enum {string} + */ + type?: "i2l"; + /** + * Image + * @description The image to encode + */ + image?: components["schemas"]["ImageField"]; + /** + * Vae + * @description Vae submodel + */ + vae?: components["schemas"]["VaeField"]; + /** + * Tiled + * @description Encode latents by overlaping tiles(less memory consumption) + * @default false + */ + tiled?: boolean; + }; + /** + * ImageUrlsDTO + * @description The URLs for an image and its thumbnail. + */ + ImageUrlsDTO: { + /** + * Image Name + * @description The unique name of the image. + */ + image_name: string; + /** + * Image Url + * @description The URL of the image. + */ + image_url: string; + /** + * Thumbnail Url + * @description The URL of the image's thumbnail. + */ + thumbnail_url: string; + }; + /** + * InfillColorInvocation + * @description Infills transparent areas of an image with a solid color + */ + InfillColorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default infill_rgba + * @enum {string} + */ + type?: "infill_rgba"; + /** + * Image + * @description The image to infill + */ + image?: components["schemas"]["ImageField"]; + /** + * Color + * @description The color to use to infill + * @default { + * "r": 127, + * "g": 127, + * "b": 127, + * "a": 255 + * } + */ + color?: components["schemas"]["ColorField"]; + }; + /** + * InfillPatchMatchInvocation + * @description Infills transparent areas of an image using the PatchMatch algorithm + */ + InfillPatchMatchInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default infill_patchmatch + * @enum {string} + */ + type?: "infill_patchmatch"; + /** + * Image + * @description The image to infill + */ + image?: components["schemas"]["ImageField"]; + }; + /** + * InfillTileInvocation + * @description Infills transparent areas of an image with tiles of the image + */ + InfillTileInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default infill_tile + * @enum {string} + */ + type?: "infill_tile"; + /** + * Image + * @description The image to infill + */ + image?: components["schemas"]["ImageField"]; + /** + * Tile Size + * @description The tile size (px) + * @default 32 + */ + tile_size?: number; + /** + * Seed + * @description The seed to use for tile generation (omit for random) + */ + seed?: number; + }; + /** + * InpaintInvocation + * @description Generates an image using inpaint. + */ + InpaintInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default inpaint + * @enum {string} + */ + type?: "inpaint"; + /** + * Positive Conditioning + * @description Positive conditioning for generation + */ + positive_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Negative Conditioning + * @description Negative conditioning for generation + */ + negative_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Seed + * @description The seed to use (omit for random) + */ + seed?: number; + /** + * Steps + * @description The number of steps to use to generate the image + * @default 30 + */ + steps?: number; + /** + * Width + * @description The width of the resulting image + * @default 512 + */ + width?: number; + /** + * Height + * @description The height of the resulting image + * @default 512 + */ + height?: number; + /** + * Cfg Scale + * @description The Classifier-Free Guidance, higher values may result in a result closer to the prompt + * @default 7.5 + */ + cfg_scale?: number; + /** + * Scheduler + * @description The scheduler to use + * @default euler + * @enum {string} + */ + scheduler?: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc"; + /** + * Unet + * @description UNet model + */ + unet?: components["schemas"]["UNetField"]; + /** + * Vae + * @description Vae model + */ + vae?: components["schemas"]["VaeField"]; + /** + * Image + * @description The input image + */ + image?: components["schemas"]["ImageField"]; + /** + * Strength + * @description The strength of the original image + * @default 0.75 + */ + strength?: number; + /** + * Fit + * @description Whether or not the result should be fit to the aspect ratio of the input image + * @default true + */ + fit?: boolean; + /** + * Mask + * @description The mask + */ + mask?: components["schemas"]["ImageField"]; + /** + * Seam Size + * @description The seam inpaint size (px) + * @default 96 + */ + seam_size?: number; + /** + * Seam Blur + * @description The seam inpaint blur radius (px) + * @default 16 + */ + seam_blur?: number; + /** + * Seam Strength + * @description The seam inpaint strength + * @default 0.75 + */ + seam_strength?: number; + /** + * Seam Steps + * @description The number of steps to use for seam inpaint + * @default 30 + */ + seam_steps?: number; + /** + * Tile Size + * @description The tile infill method size (px) + * @default 32 + */ + tile_size?: number; + /** + * Infill Method + * @description The method used to infill empty regions (px) + * @default patchmatch + * @enum {string} + */ + infill_method?: "patchmatch" | "tile" | "solid"; + /** + * Inpaint Width + * @description The width of the inpaint region (px) + */ + inpaint_width?: number; + /** + * Inpaint Height + * @description The height of the inpaint region (px) + */ + inpaint_height?: number; + /** + * Inpaint Fill + * @description The solid infill method color + * @default { + * "r": 127, + * "g": 127, + * "b": 127, + * "a": 255 + * } + */ + inpaint_fill?: components["schemas"]["ColorField"]; + /** + * Inpaint Replace + * @description The amount by which to replace masked areas with latent noise + * @default 0 + */ + inpaint_replace?: number; + }; + /** + * IntCollectionOutput + * @description A collection of integers + */ + IntCollectionOutput: { + /** + * Type + * @default int_collection + * @enum {string} + */ + type?: "int_collection"; + /** + * Collection + * @description The int collection + * @default [] + */ + collection?: (number)[]; + }; + /** + * IntOutput + * @description An integer output + */ + IntOutput: { + /** + * Type + * @default int_output + * @enum {string} + */ + type?: "int_output"; + /** + * A + * @description The output integer + */ + a?: number; + }; + /** + * IterateInvocation + * @description Iterates over a list of items + */ + IterateInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default iterate + * @enum {string} + */ + type?: "iterate"; + /** + * Collection + * @description The list of items to iterate over + */ + collection?: (unknown)[]; + /** + * Index + * @description The index, will be provided on executed iterators + * @default 0 + */ + index?: number; + }; + /** + * IterateInvocationOutput + * @description Used to connect iteration outputs. Will be expanded to a specific output. + */ + IterateInvocationOutput: { + /** + * Type + * @default iterate_output + * @enum {string} + */ + type: "iterate_output"; + /** + * Item + * @description The item being iterated over + */ + item: unknown; + }; + /** + * LatentsField + * @description A latents field used for passing latents between invocations + */ + LatentsField: { + /** + * Latents Name + * @description The name of the latents + */ + latents_name: string; + }; + /** + * LatentsOutput + * @description Base class for invocations that output latents + */ + LatentsOutput: { + /** + * Type + * @default latents_output + * @enum {string} + */ + type?: "latents_output"; + /** + * Latents + * @description The output latents + */ + latents?: components["schemas"]["LatentsField"]; + /** + * Width + * @description The width of the latents in pixels + */ + width: number; + /** + * Height + * @description The height of the latents in pixels + */ + height: number; + }; + /** + * LatentsToImageInvocation + * @description Generates an image from latents. + */ + LatentsToImageInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default l2i + * @enum {string} + */ + type?: "l2i"; + /** + * Latents + * @description The latents to generate an image from + */ + latents?: components["schemas"]["LatentsField"]; + /** + * Vae + * @description Vae submodel + */ + vae?: components["schemas"]["VaeField"]; + /** + * Tiled + * @description Decode latents by overlaping tiles(less memory consumption) + * @default false + */ + tiled?: boolean; + }; + /** + * LatentsToLatentsInvocation + * @description Generates latents using latents as base image. + */ + LatentsToLatentsInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default l2l + * @enum {string} + */ + type?: "l2l"; + /** + * Positive Conditioning + * @description Positive conditioning for generation + */ + positive_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Negative Conditioning + * @description Negative conditioning for generation + */ + negative_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Noise + * @description The noise to use + */ + noise?: components["schemas"]["LatentsField"]; + /** + * Steps + * @description The number of steps to use to generate the image + * @default 10 + */ + steps?: number; + /** + * Cfg Scale + * @description The Classifier-Free Guidance, higher values may result in a result closer to the prompt + * @default 7.5 + */ + cfg_scale?: number | (number)[]; + /** + * Scheduler + * @description The scheduler to use + * @default euler + * @enum {string} + */ + scheduler?: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc"; + /** + * Unet + * @description UNet submodel + */ + unet?: components["schemas"]["UNetField"]; + /** + * Control + * @description The control to use + */ + control?: components["schemas"]["ControlField"] | (components["schemas"]["ControlField"])[]; + /** + * Latents + * @description The latents to use as a base image + */ + latents?: components["schemas"]["LatentsField"]; + /** + * Strength + * @description The strength of the latents to use + * @default 0.7 + */ + strength?: number; + }; + /** + * LineartAnimeImageProcessorInvocation + * @description Applies line art anime processing to image + */ + LineartAnimeImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default lineart_anime_image_processor + * @enum {string} + */ + type?: "lineart_anime_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + }; + /** + * LineartImageProcessorInvocation + * @description Applies line art processing to image + */ + LineartImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default lineart_image_processor + * @enum {string} + */ + type?: "lineart_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + /** + * Coarse + * @description Whether to use coarse mode + * @default false + */ + coarse?: boolean; + }; + /** LoRAModelConfig */ + LoRAModelConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "lora"; + /** Path */ + path: string; + /** Description */ + description?: string; + model_format: components["schemas"]["LoRAModelFormat"]; + error?: components["schemas"]["ModelError"]; + }; + /** + * LoRAModelFormat + * @description An enumeration. + * @enum {string} + */ + LoRAModelFormat: "lycoris" | "diffusers"; + /** + * LoadImageInvocation + * @description Load an image and provide it as output. + */ + LoadImageInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default load_image + * @enum {string} + */ + type?: "load_image"; + /** + * Image + * @description The image to load + */ + image?: components["schemas"]["ImageField"]; + }; + /** LoraInfo */ + LoraInfo: { + /** + * Model Name + * @description Info to load submodel + */ + model_name: string; + /** @description Base model */ + base_model: components["schemas"]["BaseModelType"]; + /** @description Info to load submodel */ + model_type: components["schemas"]["ModelType"]; + /** @description Info to load submodel */ + submodel?: components["schemas"]["SubModelType"]; + /** + * Weight + * @description Lora's weight which to use when apply to model + */ + weight: number; + }; + /** + * LoraLoaderInvocation + * @description Apply selected lora to unet and text_encoder. + */ + LoraLoaderInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default lora_loader + * @enum {string} + */ + type?: "lora_loader"; + /** + * Lora Name + * @description Lora model name + */ + lora_name: string; + /** + * Weight + * @description With what weight to apply lora + * @default 0.75 + */ + weight?: number; + /** + * Unet + * @description UNet model for applying lora + */ + unet?: components["schemas"]["UNetField"]; + /** + * Clip + * @description Clip model for applying lora + */ + clip?: components["schemas"]["ClipField"]; + }; + /** + * LoraLoaderOutput + * @description Model loader output + */ + LoraLoaderOutput: { + /** + * Type + * @default lora_loader_output + * @enum {string} + */ + type?: "lora_loader_output"; + /** + * Unet + * @description UNet submodel + */ + unet?: components["schemas"]["UNetField"]; + /** + * Clip + * @description Tokenizer and text_encoder submodels + */ + clip?: components["schemas"]["ClipField"]; + }; + /** + * MaskFromAlphaInvocation + * @description Extracts the alpha channel of an image as a mask. + */ + MaskFromAlphaInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default tomask + * @enum {string} + */ + type?: "tomask"; + /** + * Image + * @description The image to create the mask from + */ + image?: components["schemas"]["ImageField"]; + /** + * Invert + * @description Whether or not to invert the mask + * @default false + */ + invert?: boolean; + }; + /** + * MaskOutput + * @description Base class for invocations that output a mask + */ + MaskOutput: { + /** + * Type + * @default mask + * @enum {string} + */ + type: "mask"; + /** + * Mask + * @description The output mask + */ + mask: components["schemas"]["ImageField"]; + /** + * Width + * @description The width of the mask in pixels + */ + width?: number; + /** + * Height + * @description The height of the mask in pixels + */ + height?: number; + }; + /** + * MediapipeFaceProcessorInvocation + * @description Applies mediapipe face processing to image + */ + MediapipeFaceProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default mediapipe_face_processor + * @enum {string} + */ + type?: "mediapipe_face_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Max Faces + * @description Maximum number of faces to detect + * @default 1 + */ + max_faces?: number; + /** + * Min Confidence + * @description Minimum confidence for face detection + * @default 0.5 + */ + min_confidence?: number; + }; + /** + * MidasDepthImageProcessorInvocation + * @description Applies Midas depth processing to image + */ + MidasDepthImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default midas_depth_image_processor + * @enum {string} + */ + type?: "midas_depth_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * A Mult + * @description Midas parameter `a_mult` (a = a_mult * PI) + * @default 2 + */ + a_mult?: number; + /** + * Bg Th + * @description Midas parameter `bg_th` + * @default 0.1 + */ + bg_th?: number; + }; + /** + * MlsdImageProcessorInvocation + * @description Applies MLSD processing to image + */ + MlsdImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default mlsd_image_processor + * @enum {string} + */ + type?: "mlsd_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + /** + * Thr V + * @description MLSD parameter `thr_v` + * @default 0.1 + */ + thr_v?: number; + /** + * Thr D + * @description MLSD parameter `thr_d` + * @default 0.1 + */ + thr_d?: number; + }; + /** + * ModelError + * @description An enumeration. + * @enum {string} + */ + ModelError: "not_found"; + /** ModelInfo */ + ModelInfo: { + /** + * Model Name + * @description Info to load submodel + */ + model_name: string; + /** @description Base model */ + base_model: components["schemas"]["BaseModelType"]; + /** @description Info to load submodel */ + model_type: components["schemas"]["ModelType"]; + /** @description Info to load submodel */ + submodel?: components["schemas"]["SubModelType"]; + }; + /** + * ModelLoaderOutput + * @description Model loader output + */ + ModelLoaderOutput: { + /** + * Type + * @default model_loader_output + * @enum {string} + */ + type?: "model_loader_output"; + /** + * Unet + * @description UNet submodel + */ + unet?: components["schemas"]["UNetField"]; + /** + * Clip + * @description Tokenizer and text_encoder submodels + */ + clip?: components["schemas"]["ClipField"]; + /** + * Vae + * @description Vae submodel + */ + vae?: components["schemas"]["VaeField"]; + }; + /** + * ModelType + * @description An enumeration. + * @enum {string} + */ + ModelType: "pipeline" | "vae" | "lora" | "controlnet" | "embedding"; + /** + * ModelVariantType + * @description An enumeration. + * @enum {string} + */ + ModelVariantType: "normal" | "inpaint" | "depth"; + /** ModelsList */ + ModelsList: { + /** Models */ + models: (components["schemas"]["StableDiffusion1ModelCheckpointConfig"] | components["schemas"]["StableDiffusion1ModelDiffusersConfig"] | components["schemas"]["VaeModelConfig"] | components["schemas"]["LoRAModelConfig"] | components["schemas"]["ControlNetModelConfig"] | components["schemas"]["TextualInversionModelConfig"] | components["schemas"]["StableDiffusion2ModelDiffusersConfig"] | components["schemas"]["StableDiffusion2ModelCheckpointConfig"])[]; + }; + /** + * MultiplyInvocation + * @description Multiplies two numbers + */ + MultiplyInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default mul + * @enum {string} + */ + type?: "mul"; + /** + * A + * @description The first number + * @default 0 + */ + a?: number; + /** + * B + * @description The second number + * @default 0 + */ + b?: number; + }; + /** + * NoiseInvocation + * @description Generates latent noise. + */ + NoiseInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default noise + * @enum {string} + */ + type?: "noise"; + /** + * Seed + * @description The seed to use + */ + seed?: number; + /** + * Width + * @description The width of the resulting noise + * @default 512 + */ + width?: number; + /** + * Height + * @description The height of the resulting noise + * @default 512 + */ + height?: number; + }; + /** + * NoiseOutput + * @description Invocation noise output + */ + NoiseOutput: { + /** + * Type + * @default noise_output + * @enum {string} + */ + type?: "noise_output"; + /** + * Noise + * @description The output noise + */ + noise?: components["schemas"]["LatentsField"]; + /** + * Width + * @description The width of the noise in pixels + */ + width: number; + /** + * Height + * @description The height of the noise in pixels + */ + height: number; + }; + /** + * NormalbaeImageProcessorInvocation + * @description Applies NormalBae processing to image + */ + NormalbaeImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default normalbae_image_processor + * @enum {string} + */ + type?: "normalbae_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + }; + /** + * OffsetPaginatedResults[BoardDTO] + * @description Offset-paginated results + */ + OffsetPaginatedResults_BoardDTO_: { + /** + * Items + * @description Items + */ + items: (components["schemas"]["BoardDTO"])[]; + /** + * Offset + * @description Offset from which to retrieve items + */ + offset: number; + /** + * Limit + * @description Limit of items to get + */ + limit: number; + /** + * Total + * @description Total number of items in result + */ + total: number; + }; + /** + * OffsetPaginatedResults[ImageDTO] + * @description Offset-paginated results + */ + OffsetPaginatedResults_ImageDTO_: { + /** + * Items + * @description Items + */ + items: (components["schemas"]["ImageDTO"])[]; + /** + * Offset + * @description Offset from which to retrieve items + */ + offset: number; + /** + * Limit + * @description Limit of items to get + */ + limit: number; + /** + * Total + * @description Total number of items in result + */ + total: number; + }; + /** + * OpenposeImageProcessorInvocation + * @description Applies Openpose processing to image + */ + OpenposeImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default openpose_image_processor + * @enum {string} + */ + type?: "openpose_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Hand And Face + * @description Whether to use hands and face mode + * @default false + */ + hand_and_face?: boolean; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + }; + /** + * PaginatedResults[GraphExecutionState] + * @description Paginated results + */ + PaginatedResults_GraphExecutionState_: { + /** + * Items + * @description Items + */ + items: (components["schemas"]["GraphExecutionState"])[]; + /** + * Page + * @description Current Page + */ + page: number; + /** + * Pages + * @description Total number of pages + */ + pages: number; + /** + * Per Page + * @description Number of items per page + */ + per_page: number; + /** + * Total + * @description Total number of items in result + */ + total: number; + }; + /** + * ParamFloatInvocation + * @description A float parameter + */ + ParamFloatInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default param_float + * @enum {string} + */ + type?: "param_float"; + /** + * Param + * @description The float value + * @default 0 + */ + param?: number; + }; + /** + * ParamIntInvocation + * @description An integer parameter + */ + ParamIntInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default param_int + * @enum {string} + */ + type?: "param_int"; + /** + * A + * @description The integer value + * @default 0 + */ + a?: number; + }; + /** + * PidiImageProcessorInvocation + * @description Applies PIDI processing to image + */ + PidiImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default pidi_image_processor + * @enum {string} + */ + type?: "pidi_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + /** + * Detect Resolution + * @description The pixel resolution for detection + * @default 512 + */ + detect_resolution?: number; + /** + * Image Resolution + * @description The pixel resolution for the output image + * @default 512 + */ + image_resolution?: number; + /** + * Safe + * @description Whether to use safe mode + * @default false + */ + safe?: boolean; + /** + * Scribble + * @description Whether to use scribble mode + * @default false + */ + scribble?: boolean; + }; + /** + * PipelineModelField + * @description Pipeline model field + */ + PipelineModelField: { + /** + * Model Name + * @description Name of the model + */ + model_name: string; + /** @description Base model */ + base_model: components["schemas"]["BaseModelType"]; + }; + /** + * PipelineModelLoaderInvocation + * @description Loads a pipeline model, outputting its submodels. + */ + PipelineModelLoaderInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default pipeline_model_loader + * @enum {string} + */ + type?: "pipeline_model_loader"; + /** + * Model + * @description The model to load + */ + model: components["schemas"]["PipelineModelField"]; + }; + /** + * PromptCollectionOutput + * @description Base class for invocations that output a collection of prompts + */ + PromptCollectionOutput: { + /** + * Type + * @default prompt_collection_output + * @enum {string} + */ + type: "prompt_collection_output"; + /** + * Prompt Collection + * @description The output prompt collection + */ + prompt_collection: (string)[]; + /** + * Count + * @description The size of the prompt collection + */ + count: number; + }; + /** + * PromptOutput + * @description Base class for invocations that output a prompt + */ + PromptOutput: { + /** + * Type + * @default prompt + * @enum {string} + */ + type: "prompt"; + /** + * Prompt + * @description The output prompt + */ + prompt: string; + }; + /** + * RandomIntInvocation + * @description Outputs a single random integer. + */ + RandomIntInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default rand_int + * @enum {string} + */ + type?: "rand_int"; + /** + * Low + * @description The inclusive low value + * @default 0 + */ + low?: number; + /** + * High + * @description The exclusive high value + * @default 2147483647 + */ + high?: number; + }; + /** + * RandomRangeInvocation + * @description Creates a collection of random numbers + */ + RandomRangeInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default random_range + * @enum {string} + */ + type?: "random_range"; + /** + * Low + * @description The inclusive low value + * @default 0 + */ + low?: number; + /** + * High + * @description The exclusive high value + * @default 2147483647 + */ + high?: number; + /** + * Size + * @description The number of values to generate + * @default 1 + */ + size?: number; + /** + * Seed + * @description The seed for the RNG (omit for random) + */ + seed?: number; + }; + /** + * RangeInvocation + * @description Creates a range of numbers from start to stop with step + */ + RangeInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default range + * @enum {string} + */ + type?: "range"; + /** + * Start + * @description The start of the range + * @default 0 + */ + start?: number; + /** + * Stop + * @description The stop of the range + * @default 10 + */ + stop?: number; + /** + * Step + * @description The step of the range + * @default 1 + */ + step?: number; + }; + /** + * RangeOfSizeInvocation + * @description Creates a range from start to start + size with step + */ + RangeOfSizeInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default range_of_size + * @enum {string} + */ + type?: "range_of_size"; + /** + * Start + * @description The start of the range + * @default 0 + */ + start?: number; + /** + * Size + * @description The number of values + * @default 1 + */ + size?: number; + /** + * Step + * @description The step of the range + * @default 1 + */ + step?: number; + }; + /** + * ResizeLatentsInvocation + * @description Resizes latents to explicit width/height (in pixels). Provided dimensions are floor-divided by 8. + */ + ResizeLatentsInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default lresize + * @enum {string} + */ + type?: "lresize"; + /** + * Latents + * @description The latents to resize + */ + latents?: components["schemas"]["LatentsField"]; + /** + * Width + * @description The width to resize to (px) + */ + width: number; + /** + * Height + * @description The height to resize to (px) + */ + height: number; + /** + * Mode + * @description The interpolation mode + * @default bilinear + * @enum {string} + */ + mode?: "nearest" | "linear" | "bilinear" | "bicubic" | "trilinear" | "area" | "nearest-exact"; + /** + * Antialias + * @description Whether or not to antialias (applied in bilinear and bicubic modes only) + * @default false + */ + antialias?: boolean; + }; + /** + * ResourceOrigin + * @description The origin of a resource (eg image). + * + * - INTERNAL: The resource was created by the application. + * - EXTERNAL: The resource was not created by the application. + * This may be a user-initiated upload, or an internal application upload (eg Canvas init image). + * @enum {string} + */ + ResourceOrigin: "internal" | "external"; + /** + * RestoreFaceInvocation + * @description Restores faces in an image. + */ + RestoreFaceInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default restore_face + * @enum {string} + */ + type?: "restore_face"; + /** + * Image + * @description The input image + */ + image?: components["schemas"]["ImageField"]; + /** + * Strength + * @description The strength of the restoration + * @default 0.75 + */ + strength?: number; + }; + /** + * ScaleLatentsInvocation + * @description Scales latents by a given factor. + */ + ScaleLatentsInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default lscale + * @enum {string} + */ + type?: "lscale"; + /** + * Latents + * @description The latents to scale + */ + latents?: components["schemas"]["LatentsField"]; + /** + * Scale Factor + * @description The factor by which to scale the latents + */ + scale_factor: number; + /** + * Mode + * @description The interpolation mode + * @default bilinear + * @enum {string} + */ + mode?: "nearest" | "linear" | "bilinear" | "bicubic" | "trilinear" | "area" | "nearest-exact"; + /** + * Antialias + * @description Whether or not to antialias (applied in bilinear and bicubic modes only) + * @default false + */ + antialias?: boolean; + }; + /** + * SchedulerPredictionType + * @description An enumeration. + * @enum {string} + */ + SchedulerPredictionType: "epsilon" | "v_prediction" | "sample"; + /** + * ShowImageInvocation + * @description Displays a provided image, and passes it forward in the pipeline. + */ + ShowImageInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default show_image + * @enum {string} + */ + type?: "show_image"; + /** + * Image + * @description The image to show + */ + image?: components["schemas"]["ImageField"]; + }; + /** StableDiffusion1ModelCheckpointConfig */ + StableDiffusion1ModelCheckpointConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "pipeline"; + /** Path */ + path: string; + /** Description */ + description?: string; + /** + * Model Format + * @enum {string} + */ + model_format: "checkpoint"; + error?: components["schemas"]["ModelError"]; + /** Vae */ + vae?: string; + /** Config */ + config?: string; + variant: components["schemas"]["ModelVariantType"]; + }; + /** StableDiffusion1ModelDiffusersConfig */ + StableDiffusion1ModelDiffusersConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "pipeline"; + /** Path */ + path: string; + /** Description */ + description?: string; + /** + * Model Format + * @enum {string} + */ + model_format: "diffusers"; + error?: components["schemas"]["ModelError"]; + /** Vae */ + vae?: string; + variant: components["schemas"]["ModelVariantType"]; + }; + /** StableDiffusion2ModelCheckpointConfig */ + StableDiffusion2ModelCheckpointConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "pipeline"; + /** Path */ + path: string; + /** Description */ + description?: string; + /** + * Model Format + * @enum {string} + */ + model_format: "checkpoint"; + error?: components["schemas"]["ModelError"]; + /** Vae */ + vae?: string; + /** Config */ + config?: string; + variant: components["schemas"]["ModelVariantType"]; + prediction_type: components["schemas"]["SchedulerPredictionType"]; + /** Upcast Attention */ + upcast_attention: boolean; + }; + /** StableDiffusion2ModelDiffusersConfig */ + StableDiffusion2ModelDiffusersConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "pipeline"; + /** Path */ + path: string; + /** Description */ + description?: string; + /** + * Model Format + * @enum {string} + */ + model_format: "diffusers"; + error?: components["schemas"]["ModelError"]; + /** Vae */ + vae?: string; + variant: components["schemas"]["ModelVariantType"]; + prediction_type: components["schemas"]["SchedulerPredictionType"]; + /** Upcast Attention */ + upcast_attention: boolean; + }; + /** + * StepParamEasingInvocation + * @description Experimental per-step parameter easing for denoising steps + */ + StepParamEasingInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default step_param_easing + * @enum {string} + */ + type?: "step_param_easing"; + /** + * Easing + * @description The easing function to use + * @default Linear + * @enum {string} + */ + easing?: "Linear" | "QuadIn" | "QuadOut" | "QuadInOut" | "CubicIn" | "CubicOut" | "CubicInOut" | "QuarticIn" | "QuarticOut" | "QuarticInOut" | "QuinticIn" | "QuinticOut" | "QuinticInOut" | "SineIn" | "SineOut" | "SineInOut" | "CircularIn" | "CircularOut" | "CircularInOut" | "ExponentialIn" | "ExponentialOut" | "ExponentialInOut" | "ElasticIn" | "ElasticOut" | "ElasticInOut" | "BackIn" | "BackOut" | "BackInOut" | "BounceIn" | "BounceOut" | "BounceInOut"; + /** + * Num Steps + * @description number of denoising steps + * @default 20 + */ + num_steps?: number; + /** + * Start Value + * @description easing starting value + * @default 0 + */ + start_value?: number; + /** + * End Value + * @description easing ending value + * @default 1 + */ + end_value?: number; + /** + * Start Step Percent + * @description fraction of steps at which to start easing + * @default 0 + */ + start_step_percent?: number; + /** + * End Step Percent + * @description fraction of steps after which to end easing + * @default 1 + */ + end_step_percent?: number; + /** + * Pre Start Value + * @description value before easing start + */ + pre_start_value?: number; + /** + * Post End Value + * @description value after easing end + */ + post_end_value?: number; + /** + * Mirror + * @description include mirror of easing function + * @default false + */ + mirror?: boolean; + /** + * Show Easing Plot + * @description show easing plot + * @default false + */ + show_easing_plot?: boolean; + }; + /** + * SubModelType + * @description An enumeration. + * @enum {string} + */ + SubModelType: "unet" | "text_encoder" | "tokenizer" | "vae" | "scheduler" | "safety_checker"; + /** + * SubtractInvocation + * @description Subtracts two numbers + */ + SubtractInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default sub + * @enum {string} + */ + type?: "sub"; + /** + * A + * @description The first number + * @default 0 + */ + a?: number; + /** + * B + * @description The second number + * @default 0 + */ + b?: number; + }; + /** + * TextToLatentsInvocation + * @description Generates latents from conditionings. + */ + TextToLatentsInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default t2l + * @enum {string} + */ + type?: "t2l"; + /** + * Positive Conditioning + * @description Positive conditioning for generation + */ + positive_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Negative Conditioning + * @description Negative conditioning for generation + */ + negative_conditioning?: components["schemas"]["ConditioningField"]; + /** + * Noise + * @description The noise to use + */ + noise?: components["schemas"]["LatentsField"]; + /** + * Steps + * @description The number of steps to use to generate the image + * @default 10 + */ + steps?: number; + /** + * Cfg Scale + * @description The Classifier-Free Guidance, higher values may result in a result closer to the prompt + * @default 7.5 + */ + cfg_scale?: number | (number)[]; + /** + * Scheduler + * @description The scheduler to use + * @default euler + * @enum {string} + */ + scheduler?: "ddim" | "ddpm" | "deis" | "lms" | "lms_k" | "pndm" | "heun" | "heun_k" | "euler" | "euler_k" | "euler_a" | "kdpm_2" | "kdpm_2_a" | "dpmpp_2s" | "dpmpp_2s_k" | "dpmpp_2m" | "dpmpp_2m_k" | "dpmpp_2m_sde" | "dpmpp_2m_sde_k" | "dpmpp_sde" | "dpmpp_sde_k" | "unipc"; + /** + * Unet + * @description UNet submodel + */ + unet?: components["schemas"]["UNetField"]; + /** + * Control + * @description The control to use + */ + control?: components["schemas"]["ControlField"] | (components["schemas"]["ControlField"])[]; + }; + /** TextualInversionModelConfig */ + TextualInversionModelConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "embedding"; + /** Path */ + path: string; + /** Description */ + description?: string; + /** Model Format */ + model_format: null; + error?: components["schemas"]["ModelError"]; + }; + /** UNetField */ + UNetField: { + /** + * Unet + * @description Info to load unet submodel + */ + unet: components["schemas"]["ModelInfo"]; + /** + * Scheduler + * @description Info to load scheduler submodel + */ + scheduler: components["schemas"]["ModelInfo"]; + /** + * Loras + * @description Loras to apply on model loading + */ + loras: (components["schemas"]["LoraInfo"])[]; + }; + /** + * UpscaleInvocation + * @description Upscales an image. + */ + UpscaleInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default upscale + * @enum {string} + */ + type?: "upscale"; + /** + * Image + * @description The input image + */ + image?: components["schemas"]["ImageField"]; + /** + * Strength + * @description The strength + * @default 0.75 + */ + strength?: number; + /** + * Level + * @description The upscale level + * @default 2 + * @enum {integer} + */ + level?: 2 | 4; + }; + /** VaeField */ + VaeField: { + /** + * Vae + * @description Info to load vae submodel + */ + vae: components["schemas"]["ModelInfo"]; + }; + /** VaeModelConfig */ + VaeModelConfig: { + /** Name */ + name: string; + base_model: components["schemas"]["BaseModelType"]; + /** + * Type + * @enum {string} + */ + type: "vae"; + /** Path */ + path: string; + /** Description */ + description?: string; + model_format: components["schemas"]["VaeModelFormat"]; + error?: components["schemas"]["ModelError"]; + }; + /** + * VaeModelFormat + * @description An enumeration. + * @enum {string} + */ + VaeModelFormat: "checkpoint" | "diffusers"; + /** VaeRepo */ + VaeRepo: { + /** + * Repo Id + * @description The repo ID to use for this VAE + */ + repo_id: string; + /** + * Path + * @description The path to the VAE + */ + path?: string; + /** + * Subfolder + * @description The subfolder to use for this VAE + */ + subfolder?: string; + }; + /** ValidationError */ + ValidationError: { + /** Location */ + loc: (string | number)[]; + /** Message */ + msg: string; + /** Error Type */ + type: string; + }; + /** + * ZoeDepthImageProcessorInvocation + * @description Applies Zoe depth processing to image + */ + ZoeDepthImageProcessorInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default zoe_depth_image_processor + * @enum {string} + */ + type?: "zoe_depth_image_processor"; + /** + * Image + * @description The image to process + */ + image?: components["schemas"]["ImageField"]; + }; + /** + * StableDiffusion1ModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; + /** + * StableDiffusion2ModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusion2ModelFormat: "checkpoint" | "diffusers"; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +}; + +export type external = Record; + +export type operations = { + + /** + * List Sessions + * @description Gets a list of sessions, optionally searching + */ + list_sessions: { + parameters: { + query?: { + /** @description The page of results to get */ + page?: number; + /** @description The number of results per page */ + per_page?: number; + /** @description The query string to search for */ + query?: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["PaginatedResults_GraphExecutionState_"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Create Session + * @description Creates a new session, optionally initializing it with an invocation graph + */ + create_session: { + requestBody?: { + content: { + "application/json": components["schemas"]["Graph"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Invalid json */ + 400: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Session + * @description Gets a session + */ + get_session: { + parameters: { + path: { + /** @description The id of the session to get */ + session_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Add Node + * @description Adds a node to the graph + */ + add_node: { + parameters: { + path: { + /** @description The id of the session */ + session_id: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["PipelineModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["UpscaleInvocation"] | components["schemas"]["RestoreFaceInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": string; + }; + }; + /** @description Invalid node or link */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Update Node + * @description Updates a node in the graph and removes all linked edges + */ + update_node: { + parameters: { + path: { + /** @description The id of the session */ + session_id: string; + /** @description The path to the node in the graph */ + node_path: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["PipelineModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["UpscaleInvocation"] | components["schemas"]["RestoreFaceInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Invalid node or link */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Delete Node + * @description Deletes a node in the graph and removes all linked edges + */ + delete_node: { + parameters: { + path: { + /** @description The id of the session */ + session_id: string; + /** @description The path to the node to delete */ + node_path: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Invalid node or link */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Add Edge + * @description Adds an edge to the graph + */ + add_edge: { + parameters: { + path: { + /** @description The id of the session */ + session_id: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Edge"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Invalid node or link */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Delete Edge + * @description Deletes an edge from the graph + */ + delete_edge: { + parameters: { + path: { + /** @description The id of the session */ + session_id: string; + /** @description The id of the node the edge is coming from */ + from_node_id: string; + /** @description The field of the node the edge is coming from */ + from_field: string; + /** @description The id of the node the edge is going to */ + to_node_id: string; + /** @description The field of the node the edge is going to */ + to_field: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["GraphExecutionState"]; + }; + }; + /** @description Invalid node or link */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Invoke Session + * @description Invokes a session + */ + invoke_session: { + parameters: { + query?: { + /** @description Whether or not to invoke all remaining invocations */ + all?: boolean; + }; + path: { + /** @description The id of the session to invoke */ + session_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description The invocation is queued */ + 202: never; + /** @description The session has no invocations ready to invoke */ + 400: never; + /** @description Session not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Cancel Session Invoke + * @description Invokes a session + */ + cancel_session_invoke: { + parameters: { + path: { + /** @description The id of the session to cancel */ + session_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description The invocation is canceled */ + 202: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * List Models + * @description Gets a list of models + */ + list_models: { + parameters: { + query?: { + /** @description Base model */ + base_model?: components["schemas"]["BaseModelType"]; + /** @description The type of model to get */ + model_type?: components["schemas"]["ModelType"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["ModelsList"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Update Model + * @description Add Model + */ + update_model: { + requestBody: { + content: { + "application/json": components["schemas"]["CreateModelRequest"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Delete Model + * @description Delete Model + */ + del_model: { + parameters: { + path: { + model_name: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Model deleted successfully */ + 204: never; + /** @description Model not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * List Images With Metadata + * @description Gets a list of images + */ + list_images_with_metadata: { + parameters: { + query?: { + /** @description The origin of images to list */ + image_origin?: components["schemas"]["ResourceOrigin"]; + /** @description The categories of image to include */ + categories?: (components["schemas"]["ImageCategory"])[]; + /** @description Whether to list intermediate images */ + is_intermediate?: boolean; + /** @description The board id to filter by */ + board_id?: string; + /** @description The page offset */ + offset?: number; + /** @description The number of images per page */ + limit?: number; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["OffsetPaginatedResults_ImageDTO_"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Upload Image + * @description Uploads an image + */ + upload_image: { + parameters: { + query: { + /** @description The category of the image */ + image_category: components["schemas"]["ImageCategory"]; + /** @description Whether this is an intermediate image */ + is_intermediate: boolean; + /** @description The session ID associated with this upload, if any */ + session_id?: string; + }; + }; + requestBody: { + content: { + "multipart/form-data": components["schemas"]["Body_upload_image"]; + }; + }; + responses: { + /** @description The image was uploaded successfully */ + 201: { + content: { + "application/json": components["schemas"]["ImageDTO"]; + }; + }; + /** @description Image upload failed */ + 415: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Image Full + * @description Gets a full-resolution image file + */ + get_image_full: { + parameters: { + path: { + /** @description The name of full-resolution image file to get */ + image_name: string; + }; + }; + responses: { + /** @description Return the full-resolution image */ + 200: { + content: { + "image/png": unknown; + }; + }; + /** @description Image not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Delete Image + * @description Deletes an image + */ + delete_image: { + parameters: { + path: { + /** @description The name of the image to delete */ + image_name: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Update Image + * @description Updates an image + */ + update_image: { + parameters: { + path: { + /** @description The name of the image to update */ + image_name: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ImageRecordChanges"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["ImageDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Image Metadata + * @description Gets an image's metadata + */ + get_image_metadata: { + parameters: { + path: { + /** @description The name of image to get */ + image_name: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["ImageDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Image Thumbnail + * @description Gets a thumbnail image file + */ + get_image_thumbnail: { + parameters: { + path: { + /** @description The name of thumbnail image file to get */ + image_name: string; + }; + }; + responses: { + /** @description Return the image thumbnail */ + 200: { + content: { + "image/webp": unknown; + }; + }; + /** @description Image not found */ + 404: never; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Image Urls + * @description Gets an image and thumbnail URL + */ + get_image_urls: { + parameters: { + path: { + /** @description The name of the image whose URL to get */ + image_name: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["ImageUrlsDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * List Boards + * @description Gets a list of boards + */ + list_boards: { + parameters: { + query?: { + /** @description Whether to list all boards */ + all?: boolean; + /** @description The page offset */ + offset?: number; + /** @description The number of boards per page */ + limit?: number; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["OffsetPaginatedResults_BoardDTO_"] | (components["schemas"]["BoardDTO"])[]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Create Board + * @description Creates a board + */ + create_board: { + parameters: { + query: { + /** @description The name of the board to create */ + board_name: string; + }; + }; + responses: { + /** @description The board was created successfully */ + 201: { + content: { + "application/json": components["schemas"]["BoardDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Get Board + * @description Gets a board + */ + get_board: { + parameters: { + path: { + /** @description The id of board to get */ + board_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["BoardDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Delete Board + * @description Deletes a board + */ + delete_board: { + parameters: { + path: { + /** @description The id of board to delete */ + board_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Update Board + * @description Updates a board + */ + update_board: { + parameters: { + path: { + /** @description The id of board to update */ + board_id: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["BoardChanges"]; + }; + }; + responses: { + /** @description The board was updated successfully */ + 201: { + content: { + "application/json": components["schemas"]["BoardDTO"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Create Board Image + * @description Creates a board_image + */ + create_board_image: { + requestBody: { + content: { + "application/json": components["schemas"]["Body_create_board_image"]; + }; + }; + responses: { + /** @description The image was added to a board successfully */ + 201: { + content: { + "application/json": unknown; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * Remove Board Image + * @description Deletes a board_image + */ + remove_board_image: { + requestBody: { + content: { + "application/json": components["schemas"]["Body_remove_board_image"]; + }; + }; + responses: { + /** @description The image was removed from the board successfully */ + 201: { + content: { + "application/json": unknown; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + /** + * List Board Images + * @description Gets a list of images for a board + */ + list_board_images: { + parameters: { + query?: { + /** @description The page offset */ + offset?: number; + /** @description The number of boards per page */ + limit?: number; + }; + path: { + /** @description The id of the board */ + board_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["OffsetPaginatedResults_ImageDTO_"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; +}; diff --git a/invokeai/frontend/web/src/services/api/schemas/$CannyImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$CannyImageProcessorInvocation.ts deleted file mode 100644 index e2f1bc2111..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$CannyImageProcessorInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $CannyImageProcessorInvocation = { - description: `Canny edge detection for ControlNet`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - low_threshold: { - type: 'number', - description: `low threshold of Canny pixel gradient`, - }, - high_threshold: { - type: 'number', - description: `high threshold of Canny pixel gradient`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$ContentShuffleImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$ContentShuffleImageProcessorInvocation.ts deleted file mode 100644 index 9c51fdecc0..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$ContentShuffleImageProcessorInvocation.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ContentShuffleImageProcessorInvocation = { - description: `Applies content shuffle processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - 'h': { - type: 'number', - description: `content shuffle h parameter`, - }, - 'w': { - type: 'number', - description: `content shuffle w parameter`, - }, - 'f': { - type: 'number', - description: `cont`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$ControlField.ts b/invokeai/frontend/web/src/services/api/schemas/$ControlField.ts deleted file mode 100644 index 81292b8638..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$ControlField.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ControlField = { - properties: { - image: { - type: 'all-of', - description: `processed image`, - contains: [{ - type: 'ImageField', - }], - isRequired: true, - }, - control_model: { - type: 'string', - description: `control model used`, - isRequired: true, - }, - control_weight: { - type: 'number', - description: `weight given to controlnet`, - isRequired: true, - }, - begin_step_percent: { - type: 'number', - description: `% of total steps at which controlnet is first applied`, - isRequired: true, - maximum: 1, - }, - end_step_percent: { - type: 'number', - description: `% of total steps at which controlnet is last applied`, - isRequired: true, - maximum: 1, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$ControlNetInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$ControlNetInvocation.ts deleted file mode 100644 index 29ff507e66..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$ControlNetInvocation.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ControlNetInvocation = { - description: `Collects ControlNet info to pass to other nodes`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - control_model: { - type: 'Enum', - }, - control_weight: { - type: 'number', - description: `weight given to controlnet`, - maximum: 1, - }, - begin_step_percent: { - type: 'number', - description: `% of total steps at which controlnet is first applied`, - maximum: 1, - }, - end_step_percent: { - type: 'number', - description: `% of total steps at which controlnet is last applied`, - maximum: 1, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$ControlOutput.ts b/invokeai/frontend/web/src/services/api/schemas/$ControlOutput.ts deleted file mode 100644 index d94d633fca..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$ControlOutput.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ControlOutput = { - description: `node output for ControlNet info`, - properties: { - type: { - type: 'Enum', - }, - control: { - type: 'all-of', - description: `The control info dict`, - contains: [{ - type: 'ControlField', - }], - }, - width: { - type: 'number', - description: `The width of the noise in pixels`, - isRequired: true, - }, - height: { - type: 'number', - description: `The height of the noise in pixels`, - isRequired: true, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$HedImageprocessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$HedImageprocessorInvocation.ts deleted file mode 100644 index 3cffa008f5..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$HedImageprocessorInvocation.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $HedImageprocessorInvocation = { - description: `Applies HED edge detection to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - scribble: { - type: 'boolean', - description: `whether to use scribble mode`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$ImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$ImageProcessorInvocation.ts deleted file mode 100644 index 36748982c5..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$ImageProcessorInvocation.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ImageProcessorInvocation = { - description: `Base class for invocations that preprocess images for ControlNet`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$LineartAnimeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$LineartAnimeImageProcessorInvocation.ts deleted file mode 100644 index 63a9c8158c..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$LineartAnimeImageProcessorInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $LineartAnimeImageProcessorInvocation = { - description: `Applies line art anime processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$LineartImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$LineartImageProcessorInvocation.ts deleted file mode 100644 index 6ba4064823..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$LineartImageProcessorInvocation.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $LineartImageProcessorInvocation = { - description: `Applies line art processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - coarse: { - type: 'boolean', - description: `whether to use coarse mode`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$MidasDepthImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$MidasDepthImageProcessorInvocation.ts deleted file mode 100644 index ea0b2b0099..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$MidasDepthImageProcessorInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $MidasDepthImageProcessorInvocation = { - description: `Applies Midas depth processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - a_mult: { - type: 'number', - description: `Midas parameter a = amult * PI`, - }, - bg_th: { - type: 'number', - description: `Midas parameter bg_th`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$MlsdImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$MlsdImageProcessorInvocation.ts deleted file mode 100644 index 1bff7579cc..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$MlsdImageProcessorInvocation.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $MlsdImageProcessorInvocation = { - description: `Applies MLSD processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - thr_v: { - type: 'number', - description: `MLSD parameter thr_v`, - }, - thr_d: { - type: 'number', - description: `MLSD parameter thr_d`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$NormalbaeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$NormalbaeImageProcessorInvocation.ts deleted file mode 100644 index 7cdfe6f3ae..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$NormalbaeImageProcessorInvocation.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $NormalbaeImageProcessorInvocation = { - description: `Applies NormalBae processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$OpenposeImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$OpenposeImageProcessorInvocation.ts deleted file mode 100644 index 2a187e9cf2..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$OpenposeImageProcessorInvocation.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $OpenposeImageProcessorInvocation = { - description: `Applies Openpose processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - hand_and_face: { - type: 'boolean', - description: `whether to use hands and face mode`, - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$PidiImageProcessorInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$PidiImageProcessorInvocation.ts deleted file mode 100644 index 0fd53967c2..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$PidiImageProcessorInvocation.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $PidiImageProcessorInvocation = { - description: `Applies PIDI processing to image`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - image: { - type: 'all-of', - description: `image to process`, - contains: [{ - type: 'ImageField', - }], - }, - detect_resolution: { - type: 'number', - description: `pixel resolution for edge detection`, - }, - image_resolution: { - type: 'number', - description: `pixel resolution for output image`, - }, - safe: { - type: 'boolean', - description: `whether to use safe mode`, - }, - scribble: { - type: 'boolean', - description: `whether to use scribble mode`, - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/schemas/$RandomIntInvocation.ts b/invokeai/frontend/web/src/services/api/schemas/$RandomIntInvocation.ts deleted file mode 100644 index e5b0387d5a..0000000000 --- a/invokeai/frontend/web/src/services/api/schemas/$RandomIntInvocation.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $RandomIntInvocation = { - description: `Outputs a single random integer.`, - properties: { - id: { - type: 'string', - description: `The id of this node. Must be unique among all nodes.`, - isRequired: true, - }, - type: { - type: 'Enum', - }, - }, -} as const; diff --git a/invokeai/frontend/web/src/services/api/services/BoardsService.ts b/invokeai/frontend/web/src/services/api/services/BoardsService.ts deleted file mode 100644 index 236c765cb9..0000000000 --- a/invokeai/frontend/web/src/services/api/services/BoardsService.ts +++ /dev/null @@ -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)> { - 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 { - 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 { - 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 { - 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 { - 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 { - 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 { - 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 { - 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`, - }, - }); - } - -} diff --git a/invokeai/frontend/web/src/services/api/services/ImagesService.ts b/invokeai/frontend/web/src/services/api/services/ImagesService.ts deleted file mode 100644 index bfdef887a0..0000000000 --- a/invokeai/frontend/web/src/services/api/services/ImagesService.ts +++ /dev/null @@ -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, - /** - * 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 { - 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 { - 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 { - 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 { - 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 { - 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 { - 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 { - 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 { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/images/{image_name}/urls', - path: { - 'image_name': imageName, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - -} diff --git a/invokeai/frontend/web/src/services/api/services/ModelsService.ts b/invokeai/frontend/web/src/services/api/services/ModelsService.ts deleted file mode 100644 index 54580ce204..0000000000 --- a/invokeai/frontend/web/src/services/api/services/ModelsService.ts +++ /dev/null @@ -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 { - 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 { - 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 { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/models/{model_name}', - path: { - 'model_name': modelName, - }, - errors: { - 404: `Model not found`, - 422: `Validation Error`, - }, - }); - } - -} diff --git a/invokeai/frontend/web/src/services/api/services/SessionsService.ts b/invokeai/frontend/web/src/services/api/services/SessionsService.ts deleted file mode 100644 index 51a36caad1..0000000000 --- a/invokeai/frontend/web/src/services/api/services/SessionsService.ts +++ /dev/null @@ -1,413 +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 { 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 { - 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 { - 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 { - 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: (LoadImageInvocation | ShowImageInvocation | ImageCropInvocation | ImagePasteInvocation | MaskFromAlphaInvocation | ImageMultiplyInvocation | ImageChannelInvocation | ImageConvertInvocation | ImageBlurInvocation | ImageResizeInvocation | ImageScaleInvocation | ImageLerpInvocation | ImageInverseLerpInvocation | ControlNetInvocation | ImageProcessorInvocation | PipelineModelLoaderInvocation | LoraLoaderInvocation | DynamicPromptInvocation | CompelInvocation | AddInvocation | SubtractInvocation | MultiplyInvocation | DivideInvocation | RandomIntInvocation | ParamIntInvocation | ParamFloatInvocation | NoiseInvocation | TextToLatentsInvocation | LatentsToImageInvocation | ResizeLatentsInvocation | ScaleLatentsInvocation | ImageToLatentsInvocation | CvInpaintInvocation | RangeInvocation | RangeOfSizeInvocation | RandomRangeInvocation | FloatLinearRangeInvocation | StepParamEasingInvocation | UpscaleInvocation | RestoreFaceInvocation | InpaintInvocation | InfillColorInvocation | InfillTileInvocation | InfillPatchMatchInvocation | GraphInvocation | IterateInvocation | CollectInvocation | CannyImageProcessorInvocation | HedImageProcessorInvocation | LineartImageProcessorInvocation | LineartAnimeImageProcessorInvocation | OpenposeImageProcessorInvocation | MidasDepthImageProcessorInvocation | NormalbaeImageProcessorInvocation | MlsdImageProcessorInvocation | PidiImageProcessorInvocation | ContentShuffleImageProcessorInvocation | ZoeDepthImageProcessorInvocation | MediapipeFaceProcessorInvocation | LatentsToLatentsInvocation), - }): CancelablePromise { - 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: (LoadImageInvocation | ShowImageInvocation | ImageCropInvocation | ImagePasteInvocation | MaskFromAlphaInvocation | ImageMultiplyInvocation | ImageChannelInvocation | ImageConvertInvocation | ImageBlurInvocation | ImageResizeInvocation | ImageScaleInvocation | ImageLerpInvocation | ImageInverseLerpInvocation | ControlNetInvocation | ImageProcessorInvocation | PipelineModelLoaderInvocation | LoraLoaderInvocation | DynamicPromptInvocation | CompelInvocation | AddInvocation | SubtractInvocation | MultiplyInvocation | DivideInvocation | RandomIntInvocation | ParamIntInvocation | ParamFloatInvocation | NoiseInvocation | TextToLatentsInvocation | LatentsToImageInvocation | ResizeLatentsInvocation | ScaleLatentsInvocation | ImageToLatentsInvocation | CvInpaintInvocation | RangeInvocation | RangeOfSizeInvocation | RandomRangeInvocation | FloatLinearRangeInvocation | StepParamEasingInvocation | UpscaleInvocation | RestoreFaceInvocation | InpaintInvocation | InfillColorInvocation | InfillTileInvocation | InfillPatchMatchInvocation | GraphInvocation | IterateInvocation | CollectInvocation | CannyImageProcessorInvocation | HedImageProcessorInvocation | LineartImageProcessorInvocation | LineartAnimeImageProcessorInvocation | OpenposeImageProcessorInvocation | MidasDepthImageProcessorInvocation | NormalbaeImageProcessorInvocation | MlsdImageProcessorInvocation | PidiImageProcessorInvocation | ContentShuffleImageProcessorInvocation | ZoeDepthImageProcessorInvocation | MediapipeFaceProcessorInvocation | LatentsToLatentsInvocation), - }): CancelablePromise { - 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 { - 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 { - 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 { - 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 { - 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 { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/sessions/{session_id}/invoke', - path: { - 'session_id': sessionId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - -} diff --git a/invokeai/frontend/web/src/services/api/thunks/image.ts b/invokeai/frontend/web/src/services/api/thunks/image.ts new file mode 100644 index 0000000000..770100fbfe --- /dev/null +++ b/invokeai/frontend/web/src/services/api/thunks/image.ts @@ -0,0 +1,320 @@ +import { createAppAsyncThunk } from 'app/store/storeUtils'; +import { selectImagesAll } from 'features/gallery/store/imagesSlice'; +import { size } from 'lodash-es'; +import { paths } from 'services/api/schema'; +import { $client } from 'services/api/client'; + +const { get, post, patch, del } = $client.get(); + +type GetImageUrlsArg = + paths['/api/v1/images/{image_name}/urls']['get']['parameters']['path']; + +type GetImageUrlsResponse = + paths['/api/v1/images/{image_name}/urls']['get']['responses']['200']['content']['application/json']; + +type GetImageUrlsThunkConfig = { + rejectValue: { + arg: GetImageUrlsArg; + error: unknown; + }; +}; +/** + * Thunk to get image URLs + */ +export const imageUrlsReceived = createAppAsyncThunk< + GetImageUrlsResponse, + GetImageUrlsArg, + GetImageUrlsThunkConfig +>('api/imageUrlsReceived', async (arg, { rejectWithValue }) => { + const { image_name } = arg; + const { data, error, response } = await get( + '/api/v1/images/{image_name}/urls', + { + params: { + path: { + image_name, + }, + }, + } + ); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type GetImageMetadataArg = + paths['/api/v1/images/{image_name}/metadata']['get']['parameters']['path']; + +type GetImageMetadataResponse = + paths['/api/v1/images/{image_name}/metadata']['get']['responses']['200']['content']['application/json']; + +type GetImageMetadataThunkConfig = { + rejectValue: { + arg: GetImageMetadataArg; + error: unknown; + }; +}; + +export const imageMetadataReceived = createAppAsyncThunk< + GetImageMetadataResponse, + GetImageMetadataArg, + GetImageMetadataThunkConfig +>('api/imageMetadataReceived', async (arg, { rejectWithValue }) => { + const { image_name } = arg; + const { data, error, response } = await get( + '/api/v1/images/{image_name}/metadata', + { + params: { + path: { image_name }, + }, + } + ); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type ControlNetAction = { + type: 'SET_CONTROLNET_IMAGE'; + controlNetId: string; +}; + +type InitialImageAction = { + type: 'SET_INITIAL_IMAGE'; +}; + +type NodesAction = { + type: 'SET_NODES_IMAGE'; + nodeId: string; + fieldName: string; +}; + +type CanvasInitialImageAction = { + type: 'SET_CANVAS_INITIAL_IMAGE'; +}; + +type CanvasMergedAction = { + type: 'TOAST_CANVAS_MERGED'; +}; + +type CanvasSavedToGalleryAction = { + type: 'TOAST_CANVAS_SAVED_TO_GALLERY'; +}; + +type UploadedToastAction = { + type: 'TOAST_UPLOADED'; +}; + +export type PostUploadAction = + | ControlNetAction + | InitialImageAction + | NodesAction + | CanvasInitialImageAction + | CanvasMergedAction + | CanvasSavedToGalleryAction + | UploadedToastAction; + +type UploadImageArg = + paths['/api/v1/images/']['post']['parameters']['query'] & { + file: File; + // file: paths['/api/v1/images/']['post']['requestBody']['content']['multipart/form-data']['file']; + postUploadAction?: PostUploadAction; + }; + +type UploadImageResponse = + paths['/api/v1/images/']['post']['responses']['201']['content']['application/json']; + +type UploadImageThunkConfig = { + rejectValue: { + arg: UploadImageArg; + error: unknown; + }; +}; +/** + * `ImagesService.uploadImage()` thunk + */ +export const imageUploaded = createAppAsyncThunk< + UploadImageResponse, + UploadImageArg, + UploadImageThunkConfig +>('api/imageUploaded', async (arg, { rejectWithValue }) => { + const { + postUploadAction, + file, + image_category, + is_intermediate, + session_id, + } = arg; + const { data, error, response } = await post('/api/v1/images/', { + params: { + query: { + image_category, + is_intermediate, + session_id, + }, + }, + // TODO: Proper handling of `multipart/form-data` is coming soon, will fix type issues + // https://github.com/drwpow/openapi-typescript/issues/1123 + // @ts-ignore + body: file, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type DeleteImageArg = + paths['/api/v1/images/{image_name}']['delete']['parameters']['path']; + +type DeleteImageResponse = + paths['/api/v1/images/{image_name}']['delete']['responses']['200']['content']['application/json']; + +type DeleteImageThunkConfig = { + rejectValue: { + arg: DeleteImageArg; + error: unknown; + }; +}; +/** + * `ImagesService.deleteImage()` thunk + */ +export const imageDeleted = createAppAsyncThunk< + DeleteImageResponse, + DeleteImageArg, + DeleteImageThunkConfig +>('api/imageDeleted', async (arg, { rejectWithValue }) => { + const { image_name } = arg; + const { data, error, response } = await del('/api/v1/images/{image_name}', { + params: { + path: { + image_name, + }, + }, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type UpdateImageArg = + paths['/api/v1/images/{image_name}']['patch']['requestBody']['content']['application/json'] & + paths['/api/v1/images/{image_name}']['patch']['parameters']['path']; + +type UpdateImageResponse = + paths['/api/v1/images/{image_name}']['patch']['responses']['200']['content']['application/json']; + +type UpdateImageThunkConfig = { + rejectValue: { + arg: UpdateImageArg; + error: unknown; + }; +}; +/** + * `ImagesService.updateImage()` thunk + */ +export const imageUpdated = createAppAsyncThunk< + UpdateImageResponse, + UpdateImageArg, + UpdateImageThunkConfig +>('api/imageUpdated', async (arg, { rejectWithValue }) => { + const { image_name, image_category, is_intermediate, session_id } = arg; + const { data, error, response } = await patch('/api/v1/images/{image_name}', { + params: { + path: { + image_name, + }, + }, + body: { + image_category, + is_intermediate, + session_id, + }, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +export const IMAGES_PER_PAGE = 20; + +const DEFAULT_IMAGES_LISTED_ARG = { + isIntermediate: false, + limit: IMAGES_PER_PAGE, +}; + +type ListImagesArg = NonNullable< + paths['/api/v1/images/']['get']['parameters']['query'] +>; + +type ListImagesResponse = + paths['/api/v1/images/']['get']['responses']['200']['content']['application/json']; + +type ListImagesThunkConfig = { + rejectValue: { + arg: ListImagesArg; + error: unknown; + }; +}; +/** + * `ImagesService.listImagesWithMetadata()` thunk + */ +export const receivedPageOfImages = createAppAsyncThunk< + ListImagesResponse, + ListImagesArg, + ListImagesThunkConfig +>('api/receivedPageOfImages', async (arg, { getState, rejectWithValue }) => { + const state = getState(); + const { categories } = state.images; + const { selectedBoardId } = state.boards; + + const images = selectImagesAll(state).filter((i) => { + const isInCategory = categories.includes(i.image_category); + const isInSelectedBoard = selectedBoardId + ? i.board_id === selectedBoardId + : true; + return isInCategory && isInSelectedBoard; + }); + + let query: ListImagesArg = {}; + + if (size(arg)) { + query = { + ...DEFAULT_IMAGES_LISTED_ARG, + offset: images.length, + ...arg, + }; + } else { + query = { + ...DEFAULT_IMAGES_LISTED_ARG, + categories, + offset: images.length, + }; + } + + const { data, error, response } = await get('/api/v1/images/', { + params: { + query, + }, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); diff --git a/invokeai/frontend/web/src/services/thunks/schema.ts b/invokeai/frontend/web/src/services/api/thunks/schema.ts similarity index 100% rename from invokeai/frontend/web/src/services/thunks/schema.ts rename to invokeai/frontend/web/src/services/api/thunks/schema.ts diff --git a/invokeai/frontend/web/src/services/api/thunks/session.ts b/invokeai/frontend/web/src/services/api/thunks/session.ts new file mode 100644 index 0000000000..89f008a610 --- /dev/null +++ b/invokeai/frontend/web/src/services/api/thunks/session.ts @@ -0,0 +1,170 @@ +import { createAppAsyncThunk } from 'app/store/storeUtils'; +import { GraphExecutionState } from 'services/api/types'; +import { log } from 'app/logging/useLogger'; +import { isObject } from 'lodash-es'; +import { isAnyOf } from '@reduxjs/toolkit'; +import { paths } from 'services/api/schema'; +import { $client } from 'services/api/client'; +import { O } from 'ts-toolbelt'; + +const { get, post, put, patch, del } = $client.get(); + +const sessionLog = log.child({ namespace: 'session' }); + +type CreateSessionArg = { + graph: NonNullable< + paths['/api/v1/sessions/']['post']['requestBody'] + >['content']['application/json']; +}; + +type CreateSessionResponse = O.Required< + NonNullable< + paths['/api/v1/sessions/']['post']['requestBody'] + >['content']['application/json'], + 'id' +>; + +type CreateSessionThunkConfig = { + rejectValue: { arg: CreateSessionArg; error: unknown }; +}; + +/** + * `SessionsService.createSession()` thunk + */ +export const sessionCreated = createAppAsyncThunk< + CreateSessionResponse, + CreateSessionArg, + CreateSessionThunkConfig +>('api/sessionCreated', async (arg, { rejectWithValue }) => { + const { graph } = arg; + const { data, error, response } = await post('/api/v1/sessions/', { + body: graph, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type InvokedSessionArg = { + session_id: paths['/api/v1/sessions/{session_id}/invoke']['put']['parameters']['path']['session_id']; +}; + +type InvokedSessionResponse = + paths['/api/v1/sessions/{session_id}/invoke']['put']['responses']['200']['content']['application/json']; + +type InvokedSessionThunkConfig = { + rejectValue: { + arg: InvokedSessionArg; + error: unknown; + }; +}; + +const isErrorWithStatus = (error: unknown): error is { status: number } => + isObject(error) && 'status' in error; + +/** + * `SessionsService.invokeSession()` thunk + */ +export const sessionInvoked = createAppAsyncThunk< + InvokedSessionResponse, + InvokedSessionArg, + InvokedSessionThunkConfig +>('api/sessionInvoked', async (arg, { rejectWithValue }) => { + const { session_id } = arg; + const { data, error, response } = await put( + '/api/v1/sessions/{session_id}/invoke', + { + params: { query: { all: true }, path: { session_id } }, + } + ); + + if (error || !data) { + if (isErrorWithStatus(error) && error.status === 403) { + return rejectWithValue({ arg, error: (error as any).body.detail }); + } + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type CancelSessionArg = + paths['/api/v1/sessions/{session_id}/invoke']['delete']['parameters']['path']; + +type CancelSessionResponse = + paths['/api/v1/sessions/{session_id}/invoke']['delete']['responses']['200']['content']['application/json']; + +type CancelSessionThunkConfig = { + rejectValue: { + arg: CancelSessionArg; + error: unknown; + }; +}; + +/** + * `SessionsService.cancelSession()` thunk + */ +export const sessionCanceled = createAppAsyncThunk< + CancelSessionResponse, + CancelSessionArg, + CancelSessionThunkConfig +>('api/sessionCanceled', async (arg, { rejectWithValue }) => { + const { session_id } = arg; + + const { data, error, response } = await del( + '/api/v1/sessions/{session_id}/invoke', + { + params: { + path: { session_id }, + }, + } + ); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +type ListSessionsArg = { + params: paths['/api/v1/sessions/']['get']['parameters']; +}; + +type ListSessionsResponse = + paths['/api/v1/sessions/']['get']['responses']['200']['content']['application/json']; + +type ListSessionsThunkConfig = { + rejectValue: { + arg: ListSessionsArg; + error: unknown; + }; +}; + +/** + * `SessionsService.listSessions()` thunk + */ +export const listedSessions = createAppAsyncThunk< + ListSessionsResponse, + ListSessionsArg, + ListSessionsThunkConfig +>('api/listSessions', async (arg, { rejectWithValue }) => { + const { params } = arg; + const { data, error, response } = await get('/api/v1/sessions/', { + params, + }); + + if (error || !data) { + return rejectWithValue({ arg, error }); + } + + return data; +}); + +export const isAnySessionRejected = isAnyOf( + sessionCreated.rejected, + sessionInvoked.rejected +); diff --git a/invokeai/frontend/web/src/services/api/types.d.ts b/invokeai/frontend/web/src/services/api/types.d.ts new file mode 100644 index 0000000000..a80343ea61 --- /dev/null +++ b/invokeai/frontend/web/src/services/api/types.d.ts @@ -0,0 +1,81 @@ +import { components } from './schema'; + +/** + * Types from the API, re-exported from the types generated by `openapi-typescript`. + */ + +// Images +export type ImageDTO = components['schemas']['ImageDTO']; +export type BoardDTO = components['schemas']['BoardDTO']; +export type BoardChanges = components['schemas']['BoardChanges']; +export type ImageChanges = components['schemas']['ImageRecordChanges']; +export type ImageCategory = components['schemas']['ImageCategory']; +export type ResourceOrigin = components['schemas']['ResourceOrigin']; +export type ImageField = components['schemas']['ImageField']; +export type OffsetPaginatedResults_BoardDTO_ = + components['schemas']['OffsetPaginatedResults_BoardDTO_']; +export type OffsetPaginatedResults_ImageDTO_ = + components['schemas']['OffsetPaginatedResults_ImageDTO_']; + +// Models +export type ModelType = components['schemas']['ModelType']; +export type BaseModelType = components['schemas']['BaseModelType']; +export type PipelineModelField = components['schemas']['PipelineModelField']; +export type ModelsList = components['schemas']['ModelsList']; + +// Graphs +export type Graph = components['schemas']['Graph']; +export type Edge = components['schemas']['Edge']; +export type GraphExecutionState = components['schemas']['GraphExecutionState']; + +// General nodes +export type CollectInvocation = components['schemas']['CollectInvocation']; +export type IterateInvocation = components['schemas']['IterateInvocation']; +export type RangeInvocation = components['schemas']['RangeInvocation']; +export type RandomRangeInvocation = + components['schemas']['RandomRangeInvocation']; +export type RangeOfSizeInvocation = + components['schemas']['RangeOfSizeInvocation']; +export type InpaintInvocation = components['schemas']['InpaintInvocation']; +export type ImageResizeInvocation = + components['schemas']['ImageResizeInvocation']; +export type RandomIntInvocation = components['schemas']['RandomIntInvocation']; +export type CompelInvocation = components['schemas']['CompelInvocation']; + +// ControlNet Nodes +export type CannyImageProcessorInvocation = + components['schemas']['CannyImageProcessorInvocation']; +export type ContentShuffleImageProcessorInvocation = + components['schemas']['ContentShuffleImageProcessorInvocation']; +export type HedImageProcessorInvocation = + components['schemas']['HedImageProcessorInvocation']; +export type LineartAnimeImageProcessorInvocation = + components['schemas']['LineartAnimeImageProcessorInvocation']; +export type LineartImageProcessorInvocation = + components['schemas']['LineartImageProcessorInvocation']; +export type MediapipeFaceProcessorInvocation = + components['schemas']['MediapipeFaceProcessorInvocation']; +export type MidasDepthImageProcessorInvocation = + components['schemas']['MidasDepthImageProcessorInvocation']; +export type MlsdImageProcessorInvocation = + components['schemas']['MlsdImageProcessorInvocation']; +export type NormalbaeImageProcessorInvocation = + components['schemas']['NormalbaeImageProcessorInvocation']; +export type OpenposeImageProcessorInvocation = + components['schemas']['OpenposeImageProcessorInvocation']; +export type PidiImageProcessorInvocation = + components['schemas']['PidiImageProcessorInvocation']; +export type ZoeDepthImageProcessorInvocation = + components['schemas']['ZoeDepthImageProcessorInvocation']; + +// Node Outputs +export type ImageOutput = components['schemas']['ImageOutput']; +export type MaskOutput = components['schemas']['MaskOutput']; +export type PromptOutput = components['schemas']['PromptOutput']; +export type IterateInvocationOutput = + components['schemas']['IterateInvocationOutput']; +export type CollectInvocationOutput = + components['schemas']['CollectInvocationOutput']; +export type LatentsOutput = components['schemas']['LatentsOutput']; +export type GraphInvocationOutput = + components['schemas']['GraphInvocationOutput']; diff --git a/invokeai/frontend/web/src/services/apiSlice.ts b/invokeai/frontend/web/src/services/apiSlice.ts deleted file mode 100644 index 602d433309..0000000000 --- a/invokeai/frontend/web/src/services/apiSlice.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { - BaseQueryFn, - FetchArgs, - FetchBaseQueryError, - TagDescription, - createApi, - fetchBaseQuery, -} from '@reduxjs/toolkit/query/react'; -import { BoardDTO } from './api/models/BoardDTO'; -import { OffsetPaginatedResults_BoardDTO_ } from './api/models/OffsetPaginatedResults_BoardDTO_'; -import { BoardChanges } from './api/models/BoardChanges'; -import { OffsetPaginatedResults_ImageDTO_ } from './api/models/OffsetPaginatedResults_ImageDTO_'; -import { ImageDTO } from './api/models/ImageDTO'; -import { - FullTagDescription, - TagTypesFrom, - TagTypesFromApi, -} from '@reduxjs/toolkit/dist/query/endpointDefinitions'; -import { EntityState, createEntityAdapter } from '@reduxjs/toolkit'; -import { BaseModelType } from './api/models/BaseModelType'; -import { ModelType } from './api/models/ModelType'; -import { ModelsList } from './api/models/ModelsList'; -import { keyBy } from 'lodash-es'; -import { OpenAPI } from './api/core/OpenAPI'; - -type ListBoardsArg = { offset: number; limit: number }; -type UpdateBoardArg = { board_id: string; changes: BoardChanges }; -type AddImageToBoardArg = { board_id: string; image_name: string }; -type RemoveImageFromBoardArg = { board_id: string; image_name: string }; -type ListBoardImagesArg = { board_id: string; offset: number; limit: number }; -type ListModelsArg = { base_model?: BaseModelType; model_type?: ModelType }; - -type ModelConfig = ModelsList['models'][number]; - -const tagTypes = ['Board', 'Image', 'Model']; -type ApiFullTagDescription = FullTagDescription<(typeof tagTypes)[number]>; - -const LIST = 'LIST'; - -const modelsAdapter = createEntityAdapter({ - selectId: (model) => getModelId(model), - sortComparer: (a, b) => a.name.localeCompare(b.name), -}); - -const getModelId = ({ base_model, type, name }: ModelConfig) => - `${base_model}/${type}/${name}`; - -const dynamicBaseQuery: BaseQueryFn< - string | FetchArgs, - unknown, - FetchBaseQueryError -> = async (args, api, extraOptions) => { - const baseUrl = OpenAPI.BASE || ''; - - const rawBaseQuery = fetchBaseQuery({ - baseUrl: `${baseUrl}/api/v1`, - prepareHeaders: (headers, { getState }) => { - if (OpenAPI.TOKEN) - headers.set('Authorization', `Bearer ${OpenAPI.TOKEN}`); - return headers; - }, - }); - - return rawBaseQuery(args, api, extraOptions); -}; - -export const api = createApi({ - baseQuery: dynamicBaseQuery, - reducerPath: 'api', - tagTypes, - endpoints: (build) => ({ - /** - * Models Queries - */ - - listModels: build.query, ListModelsArg>({ - query: (arg) => ({ url: 'models/', params: arg }), - providesTags: (result, error, arg) => { - // any list of boards - const tags: ApiFullTagDescription[] = [{ id: 'Model', type: LIST }]; - - if (result) { - // and individual tags for each board - tags.push( - ...result.ids.map((id) => ({ - type: 'Model' as const, - id, - })) - ); - } - - return tags; - }, - transformResponse: (response: ModelsList, meta, arg) => { - return modelsAdapter.addMany( - modelsAdapter.getInitialState(), - keyBy(response.models, getModelId) - ); - }, - }), - /** - * Boards Queries - */ - listBoards: build.query({ - query: (arg) => ({ url: 'boards/', params: arg }), - providesTags: (result, error, arg) => { - // any list of boards - const tags: ApiFullTagDescription[] = [{ id: 'Board', type: LIST }]; - - if (result) { - // and individual tags for each board - tags.push( - ...result.items.map(({ board_id }) => ({ - type: 'Board' as const, - id: board_id, - })) - ); - } - - return tags; - }, - }), - - listAllBoards: build.query, void>({ - query: () => ({ - url: 'boards/', - params: { all: true }, - }), - providesTags: (result, error, arg) => { - // any list of boards - const tags: ApiFullTagDescription[] = [{ id: 'Board', type: LIST }]; - - if (result) { - // and individual tags for each board - tags.push( - ...result.map(({ board_id }) => ({ - type: 'Board' as const, - id: board_id, - })) - ); - } - - return tags; - }, - }), - - /** - * Boards Mutations - */ - - createBoard: build.mutation({ - query: (board_name) => ({ - url: `boards/`, - method: 'POST', - params: { board_name }, - }), - invalidatesTags: [{ id: 'Board', type: LIST }], - }), - - updateBoard: build.mutation({ - query: ({ board_id, changes }) => ({ - url: `boards/${board_id}`, - method: 'PATCH', - body: changes, - }), - invalidatesTags: (result, error, arg) => [ - { type: 'Board', id: arg.board_id }, - ], - }), - - deleteBoard: build.mutation({ - query: (board_id) => ({ url: `boards/${board_id}`, method: 'DELETE' }), - invalidatesTags: (result, error, arg) => [{ type: 'Board', id: arg }], - }), - - /** - * Board Images Queries - */ - - listBoardImages: build.query< - OffsetPaginatedResults_ImageDTO_, - ListBoardImagesArg - >({ - query: ({ board_id, offset, limit }) => ({ - url: `board_images/${board_id}`, - method: 'DELETE', - body: { offset, limit }, - }), - }), - - /** - * Board Images Mutations - */ - - addImageToBoard: build.mutation({ - query: ({ board_id, image_name }) => ({ - url: `board_images/`, - method: 'POST', - body: { board_id, image_name }, - }), - invalidatesTags: (result, error, arg) => [ - { type: 'Board', id: arg.board_id }, - { type: 'Image', id: arg.image_name }, - ], - }), - - removeImageFromBoard: build.mutation({ - query: ({ board_id, image_name }) => ({ - url: `board_images/`, - method: 'DELETE', - body: { board_id, image_name }, - }), - invalidatesTags: (result, error, arg) => [ - { type: 'Board', id: arg.board_id }, - { type: 'Image', id: arg.image_name }, - ], - }), - - /** - * Image Queries - */ - getImageDTO: build.query({ - query: (image_name) => ({ url: `images/${image_name}/metadata` }), - providesTags: (result, error, arg) => { - const tags: ApiFullTagDescription[] = [{ type: 'Image', id: arg }]; - if (result?.board_id) { - tags.push({ type: 'Board', id: result.board_id }); - } - return tags; - }, - }), - }), -}); - -export const { - useListBoardsQuery, - useListAllBoardsQuery, - useCreateBoardMutation, - useUpdateBoardMutation, - useDeleteBoardMutation, - useAddImageToBoardMutation, - useRemoveImageFromBoardMutation, - useListBoardImagesQuery, - useGetImageDTOQuery, - useListModelsQuery, -} = api; diff --git a/invokeai/frontend/web/src/services/events/middleware.ts b/invokeai/frontend/web/src/services/events/middleware.ts index 5b427b1690..85641b88a0 100644 --- a/invokeai/frontend/web/src/services/events/middleware.ts +++ b/invokeai/frontend/web/src/services/events/middleware.ts @@ -8,10 +8,11 @@ import { import { socketSubscribed, socketUnsubscribed } from './actions'; import { AppThunkDispatch, RootState } from 'app/store/store'; import { getTimestamp } from 'common/util/getTimestamp'; -import { sessionCreated } from 'services/thunks/session'; -import { OpenAPI } from 'services/api'; +import { sessionCreated } from 'services/api/thunks/session'; +// import { OpenAPI } from 'services/api/types'; import { setEventListeners } from 'services/events/util/setEventListeners'; import { log } from 'app/logging/useLogger'; +import { $authToken, $baseUrl } from 'services/api/client'; const socketioLog = log.child({ namespace: 'socketio' }); @@ -28,14 +29,16 @@ export const socketMiddleware = () => { // if building in package mode, replace socket url with open api base url minus the http protocol if (['nodes', 'package'].includes(import.meta.env.MODE)) { - if (OpenAPI.BASE) { + const baseUrl = $baseUrl.get(); + if (baseUrl) { //eslint-disable-next-line - socketUrl = OpenAPI.BASE.replace(/^https?\:\/\//i, ''); + socketUrl = baseUrl.replace(/^https?\:\/\//i, ''); } - if (OpenAPI.TOKEN) { + const authToken = $authToken.get(); + if (authToken) { // TODO: handle providing jwt to socket.io - socketOptions.auth = { token: OpenAPI.TOKEN }; + socketOptions.auth = { token: authToken }; } socketOptions.transports = ['websocket', 'polling']; diff --git a/invokeai/frontend/web/src/services/events/types.ts b/invokeai/frontend/web/src/services/events/types.ts index 2577b7fe92..f589fdd6cc 100644 --- a/invokeai/frontend/web/src/services/events/types.ts +++ b/invokeai/frontend/web/src/services/events/types.ts @@ -1,4 +1,5 @@ -import { Graph, GraphExecutionState, InvokeAIMetadata } from '../api'; +import { O } from 'ts-toolbelt'; +import { Graph, GraphExecutionState } from '../api/types'; /** * A progress image, we get one for each step in the generation @@ -9,18 +10,19 @@ export type ProgressImage = { height: number; }; -export type AnyInvocationType = NonNullable< - NonNullable[string]['type'] ->; +export type AnyInvocationType = O.Required< + NonNullable[string]>, + 'type' +>['type']; -export type AnyInvocation = NonNullable[string]; +export type AnyInvocation = NonNullable[string]>; -export type AnyResult = GraphExecutionState['results'][string]; +export type AnyResult = NonNullable; export type BaseNode = { id: string; type: string; - [key: string]: NonNullable[string]; + [key: string]: AnyInvocation[keyof AnyInvocation]; }; /** diff --git a/invokeai/frontend/web/src/services/fixtures/openapi.json b/invokeai/frontend/web/src/services/fixtures/openapi.json deleted file mode 100644 index fb2cddf3e7..0000000000 --- a/invokeai/frontend/web/src/services/fixtures/openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"openapi":"3.0.2","info":{"title":"Invoke AI","description":"An API for invoking AI image operations","version":"1.0.0"},"paths":{"/api/v1/sessions/":{"get":{"tags":["sessions"],"summary":"List Sessions","description":"Gets a list of sessions, optionally searching","operationId":"list_sessions","parameters":[{"description":"The page of results to get","required":false,"schema":{"title":"Page","type":"integer","description":"The page of results to get","default":0},"name":"page","in":"query"},{"description":"The number of results per page","required":false,"schema":{"title":"Per Page","type":"integer","description":"The number of results per page","default":10},"name":"per_page","in":"query"},{"description":"The query string to search for","required":false,"schema":{"title":"Query","type":"string","description":"The query string to search for","default":""},"name":"query","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResults_GraphExecutionState_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sessions"],"summary":"Create Session","description":"Creates a new session, optionally initializing it with an invocation graph","operationId":"create_session","requestBody":{"content":{"application/json":{"schema":{"title":"Graph","allOf":[{"$ref":"#/components/schemas/Graph"}],"description":"The graph to initialize the session with"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"400":{"description":"Invalid json"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}":{"get":{"tags":["sessions"],"summary":"Get Session","description":"Gets a session","operationId":"get_session","parameters":[{"description":"The id of the session to get","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session to get"},"name":"session_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}/nodes":{"post":{"tags":["sessions"],"summary":"Add Node","description":"Adds a node to the graph","operationId":"add_node","parameters":[{"description":"The id of the session","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session"},"name":"session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Node","anyOf":[{"$ref":"#/components/schemas/LoadImageInvocation"},{"$ref":"#/components/schemas/ShowImageInvocation"},{"$ref":"#/components/schemas/CropImageInvocation"},{"$ref":"#/components/schemas/PasteImageInvocation"},{"$ref":"#/components/schemas/MaskFromAlphaInvocation"},{"$ref":"#/components/schemas/BlurInvocation"},{"$ref":"#/components/schemas/LerpInvocation"},{"$ref":"#/components/schemas/InverseLerpInvocation"},{"$ref":"#/components/schemas/CvInpaintInvocation"},{"$ref":"#/components/schemas/UpscaleInvocation"},{"$ref":"#/components/schemas/RestoreFaceInvocation"},{"$ref":"#/components/schemas/TextToImageInvocation"},{"$ref":"#/components/schemas/GraphInvocation"},{"$ref":"#/components/schemas/IterateInvocation"},{"$ref":"#/components/schemas/CollectInvocation"},{"$ref":"#/components/schemas/ImageToImageInvocation"},{"$ref":"#/components/schemas/InpaintInvocation"}],"description":"The node to add"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response 200 Add Node","type":"string"}}}},"400":{"description":"Invalid node or link"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}/nodes/{node_path}":{"put":{"tags":["sessions"],"summary":"Update Node","description":"Updates a node in the graph and removes all linked edges","operationId":"update_node","parameters":[{"description":"The id of the session","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session"},"name":"session_id","in":"path"},{"description":"The path to the node in the graph","required":true,"schema":{"title":"Node Path","type":"string","description":"The path to the node in the graph"},"name":"node_path","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Node","anyOf":[{"$ref":"#/components/schemas/LoadImageInvocation"},{"$ref":"#/components/schemas/ShowImageInvocation"},{"$ref":"#/components/schemas/CropImageInvocation"},{"$ref":"#/components/schemas/PasteImageInvocation"},{"$ref":"#/components/schemas/MaskFromAlphaInvocation"},{"$ref":"#/components/schemas/BlurInvocation"},{"$ref":"#/components/schemas/LerpInvocation"},{"$ref":"#/components/schemas/InverseLerpInvocation"},{"$ref":"#/components/schemas/CvInpaintInvocation"},{"$ref":"#/components/schemas/UpscaleInvocation"},{"$ref":"#/components/schemas/RestoreFaceInvocation"},{"$ref":"#/components/schemas/TextToImageInvocation"},{"$ref":"#/components/schemas/GraphInvocation"},{"$ref":"#/components/schemas/IterateInvocation"},{"$ref":"#/components/schemas/CollectInvocation"},{"$ref":"#/components/schemas/ImageToImageInvocation"},{"$ref":"#/components/schemas/InpaintInvocation"}],"description":"The new node"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"400":{"description":"Invalid node or link"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["sessions"],"summary":"Delete Node","description":"Deletes a node in the graph and removes all linked edges","operationId":"delete_node","parameters":[{"description":"The id of the session","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session"},"name":"session_id","in":"path"},{"description":"The path to the node to delete","required":true,"schema":{"title":"Node Path","type":"string","description":"The path to the node to delete"},"name":"node_path","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"400":{"description":"Invalid node or link"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}/edges":{"post":{"tags":["sessions"],"summary":"Add Edge","description":"Adds an edge to the graph","operationId":"add_edge","parameters":[{"description":"The id of the session","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session"},"name":"session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Edge","allOf":[{"$ref":"#/components/schemas/Edge"}],"description":"The edge to add"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"400":{"description":"Invalid node or link"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}/edges/{from_node_id}/{from_field}/{to_node_id}/{to_field}":{"delete":{"tags":["sessions"],"summary":"Delete Edge","description":"Deletes an edge from the graph","operationId":"delete_edge","parameters":[{"description":"The id of the session","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session"},"name":"session_id","in":"path"},{"description":"The id of the node the edge is coming from","required":true,"schema":{"title":"From Node Id","type":"string","description":"The id of the node the edge is coming from"},"name":"from_node_id","in":"path"},{"description":"The field of the node the edge is coming from","required":true,"schema":{"title":"From Field","type":"string","description":"The field of the node the edge is coming from"},"name":"from_field","in":"path"},{"description":"The id of the node the edge is going to","required":true,"schema":{"title":"To Node Id","type":"string","description":"The id of the node the edge is going to"},"name":"to_node_id","in":"path"},{"description":"The field of the node the edge is going to","required":true,"schema":{"title":"To Field","type":"string","description":"The field of the node the edge is going to"},"name":"to_field","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphExecutionState"}}}},"400":{"description":"Invalid node or link"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sessions/{session_id}/invoke":{"put":{"tags":["sessions"],"summary":"Invoke Session","description":"Invokes a session","operationId":"invoke_session","parameters":[{"description":"The id of the session to invoke","required":true,"schema":{"title":"Session Id","type":"string","description":"The id of the session to invoke"},"name":"session_id","in":"path"},{"description":"Whether or not to invoke all remaining invocations","required":false,"schema":{"title":"All","type":"boolean","description":"Whether or not to invoke all remaining invocations","default":false},"name":"all","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"202":{"description":"The invocation is queued"},"400":{"description":"The session has no invocations ready to invoke"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/images/{image_type}/{image_name}":{"get":{"tags":["images"],"summary":"Get Image","description":"Gets a result","operationId":"get_image","parameters":[{"description":"The type of image to get","required":true,"schema":{"allOf":[{"$ref":"#/components/schemas/ImageType"}],"description":"The type of image to get"},"name":"image_type","in":"path"},{"description":"The name of the image to get","required":true,"schema":{"title":"Image Name","type":"string","description":"The name of the image to get"},"name":"image_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/images/uploads/":{"post":{"tags":["images"],"summary":"Upload Image","operationId":"upload_image","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_image"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"201":{"description":"The image was uploaded successfully"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BlurInvocation":{"title":"BlurInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["blur"],"type":"string","default":"blur"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to blur"},"radius":{"title":"Radius","minimum":0.0,"type":"number","description":"The blur radius","default":8.0},"blur_type":{"title":"Blur Type","enum":["gaussian","box"],"type":"string","description":"The type of blur","default":"gaussian"}},"description":"Blurs an image","output":{"$ref":"#/components/schemas/ImageOutput"}},"Body_upload_image":{"title":"Body_upload_image","required":["file"],"type":"object","properties":{"file":{"title":"File","type":"string","format":"binary"}}},"CollectInvocation":{"title":"CollectInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["collect"],"type":"string","default":"collect"},"item":{"title":"Item","description":"The item to collect (all inputs must be of the same type)"},"collection":{"title":"Collection","type":"array","items":{},"description":"The collection, will be provided on execution"}},"description":"Collects values into a collection","output":{"$ref":"#/components/schemas/CollectInvocationOutput"}},"CollectInvocationOutput":{"title":"CollectInvocationOutput","description":"Base class for all invocation outputs","type":"object","properties":{"type":{"title":"Type","default":"collect_output","enum":["collect_output"],"type":"string"},"collection":{"title":"Collection","description":"The collection of input items","type":"array","items":{}}},"required":["collection"]},"CropImageInvocation":{"title":"CropImageInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["crop"],"type":"string","default":"crop"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to crop"},"x":{"title":"X","type":"integer","description":"The left x coordinate of the crop rectangle","default":0},"y":{"title":"Y","type":"integer","description":"The top y coordinate of the crop rectangle","default":0},"width":{"title":"Width","exclusiveMinimum":0.0,"type":"integer","description":"The width of the crop rectangle","default":512},"height":{"title":"Height","exclusiveMinimum":0.0,"type":"integer","description":"The height of the crop rectangle","default":512}},"description":"Crops an image to a specified box. The box can be outside of the image.","output":{"$ref":"#/components/schemas/ImageOutput"}},"CvInpaintInvocation":{"title":"CvInpaintInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["cv_inpaint"],"type":"string","default":"cv_inpaint"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to inpaint"},"mask":{"title":"Mask","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The mask to use when inpainting"}},"description":"Simple inpaint using opencv.","output":{"$ref":"#/components/schemas/ImageOutput"}},"Edge":{"title":"Edge","required":["source","destination"],"type":"object","properties":{"source":{"title":"Source","allOf":[{"$ref":"#/components/schemas/EdgeConnection"}],"description":"The connection for the edge's from node and field"},"destination":{"title":"Destination","allOf":[{"$ref":"#/components/schemas/EdgeConnection"}],"description":"The connection for the edge's to node and field"}}},"EdgeConnection":{"title":"EdgeConnection","required":["node_id","field"],"type":"object","properties":{"node_id":{"title":"Node Id","type":"string","description":"The id of the node for this edge connection"},"field":{"title":"Field","type":"string","description":"The field for this connection"}}},"Graph":{"title":"Graph","type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this graph"},"nodes":{"title":"Nodes","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/LoadImageInvocation"},{"$ref":"#/components/schemas/ShowImageInvocation"},{"$ref":"#/components/schemas/CropImageInvocation"},{"$ref":"#/components/schemas/PasteImageInvocation"},{"$ref":"#/components/schemas/MaskFromAlphaInvocation"},{"$ref":"#/components/schemas/BlurInvocation"},{"$ref":"#/components/schemas/LerpInvocation"},{"$ref":"#/components/schemas/InverseLerpInvocation"},{"$ref":"#/components/schemas/CvInpaintInvocation"},{"$ref":"#/components/schemas/UpscaleInvocation"},{"$ref":"#/components/schemas/RestoreFaceInvocation"},{"$ref":"#/components/schemas/TextToImageInvocation"},{"$ref":"#/components/schemas/GraphInvocation"},{"$ref":"#/components/schemas/IterateInvocation"},{"$ref":"#/components/schemas/CollectInvocation"},{"$ref":"#/components/schemas/ImageToImageInvocation"},{"$ref":"#/components/schemas/InpaintInvocation"}],"discriminator":{"propertyName":"type","mapping":{"load_image":"#/components/schemas/LoadImageInvocation","show_image":"#/components/schemas/ShowImageInvocation","crop":"#/components/schemas/CropImageInvocation","paste":"#/components/schemas/PasteImageInvocation","tomask":"#/components/schemas/MaskFromAlphaInvocation","blur":"#/components/schemas/BlurInvocation","lerp":"#/components/schemas/LerpInvocation","ilerp":"#/components/schemas/InverseLerpInvocation","cv_inpaint":"#/components/schemas/CvInpaintInvocation","upscale":"#/components/schemas/UpscaleInvocation","restore_face":"#/components/schemas/RestoreFaceInvocation","txt2img":"#/components/schemas/TextToImageInvocation","graph":"#/components/schemas/GraphInvocation","iterate":"#/components/schemas/IterateInvocation","collect":"#/components/schemas/CollectInvocation","img2img":"#/components/schemas/ImageToImageInvocation","inpaint":"#/components/schemas/InpaintInvocation"}}},"description":"The nodes in this graph"},"edges":{"title":"Edges","type":"array","items":{"$ref":"#/components/schemas/Edge"},"description":"The connections between nodes and their fields in this graph"}}},"GraphExecutionState":{"title":"GraphExecutionState","required":["graph"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of the execution state"},"graph":{"title":"Graph","allOf":[{"$ref":"#/components/schemas/Graph"}],"description":"The graph being executed"},"execution_graph":{"title":"Execution Graph","allOf":[{"$ref":"#/components/schemas/Graph"}],"description":"The expanded graph of activated and executed nodes"},"executed":{"title":"Executed","uniqueItems":true,"type":"array","items":{"type":"string"},"description":"The set of node ids that have been executed"},"executed_history":{"title":"Executed History","type":"array","items":{"type":"string"},"description":"The list of node ids that have been executed, in order of execution"},"results":{"title":"Results","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ImageOutput"},{"$ref":"#/components/schemas/MaskOutput"},{"$ref":"#/components/schemas/PromptOutput"},{"$ref":"#/components/schemas/GraphInvocationOutput"},{"$ref":"#/components/schemas/IterateInvocationOutput"},{"$ref":"#/components/schemas/CollectInvocationOutput"}],"discriminator":{"propertyName":"type","mapping":{"image":"#/components/schemas/ImageOutput","mask":"#/components/schemas/MaskOutput","prompt":"#/components/schemas/PromptOutput","graph_output":"#/components/schemas/GraphInvocationOutput","iterate_output":"#/components/schemas/IterateInvocationOutput","collect_output":"#/components/schemas/CollectInvocationOutput"}}},"description":"The results of node executions"},"errors":{"title":"Errors","type":"object","additionalProperties":{"type":"string"},"description":"Errors raised when executing nodes"},"prepared_source_mapping":{"title":"Prepared Source Mapping","type":"object","additionalProperties":{"type":"string"},"description":"The map of prepared nodes to original graph nodes"},"source_prepared_mapping":{"title":"Source Prepared Mapping","type":"object","additionalProperties":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"description":"The map of original graph nodes to prepared nodes"}},"description":"Tracks the state of a graph execution"},"GraphInvocation":{"title":"GraphInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["graph"],"type":"string","default":"graph"},"graph":{"title":"Graph","allOf":[{"$ref":"#/components/schemas/Graph"}],"description":"The graph to run"}},"description":"A node to process inputs and produce outputs.\nMay use dependency injection in __init__ to receive providers.","output":{"$ref":"#/components/schemas/GraphInvocationOutput"}},"GraphInvocationOutput":{"title":"GraphInvocationOutput","description":"Base class for all invocation outputs","type":"object","properties":{"type":{"title":"Type","default":"graph_output","enum":["graph_output"],"type":"string"}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ImageField":{"title":"ImageField","description":"An image field used for passing image objects between invocations","type":"object","properties":{"image_type":{"title":"Image Type","description":"The type of the image","default":"results","type":"string"},"image_name":{"title":"Image Name","description":"The name of the image","type":"string"}}},"ImageOutput":{"title":"ImageOutput","description":"Base class for invocations that output an image","type":"object","properties":{"type":{"title":"Type","default":"image","enum":["image"],"type":"string"},"image":{"title":"Image","description":"The output image","allOf":[{"$ref":"#/components/schemas/ImageField"}]}}},"ImageToImageInvocation":{"title":"ImageToImageInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["img2img"],"type":"string","default":"img2img"},"prompt":{"title":"Prompt","type":"string","description":"The prompt to generate an image from"},"seed":{"title":"Seed","maximum":4294967295.0,"minimum":-1.0,"type":"integer","description":"The seed to use (-1 for a random seed)","default":-1},"steps":{"title":"Steps","exclusiveMinimum":0.0,"type":"integer","description":"The number of steps to use to generate the image","default":10},"width":{"title":"Width","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The width of the resulting image","default":512},"height":{"title":"Height","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The height of the resulting image","default":512},"cfg_scale":{"title":"Cfg Scale","exclusiveMinimum":0.0,"type":"number","description":"The Classifier-Free Guidance, higher values may result in a result closer to the prompt","default":7.5},"sampler_name":{"title":"Sampler Name","enum":["ddim","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun","k_lms","plms"],"type":"string","description":"The sampler to use","default":"k_lms"},"seamless":{"title":"Seamless","type":"boolean","description":"Whether or not to generate an image that can tile without seams","default":false},"model":{"title":"Model","type":"string","description":"The model to use (currently ignored)","default":""},"progress_images":{"title":"Progress Images","type":"boolean","description":"Whether or not to produce progress images during generation","default":false},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The input image"},"strength":{"title":"Strength","maximum":1.0,"exclusiveMinimum":0.0,"type":"number","description":"The strength of the original image","default":0.75},"fit":{"title":"Fit","type":"boolean","description":"Whether or not the result should be fit to the aspect ratio of the input image","default":true}},"description":"Generates an image using img2img.","output":{"$ref":"#/components/schemas/ImageOutput"}},"ImageType":{"title":"ImageType","enum":["results","intermediates","uploads"],"type":"string","description":"An enumeration."},"InpaintInvocation":{"title":"InpaintInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["inpaint"],"type":"string","default":"inpaint"},"prompt":{"title":"Prompt","type":"string","description":"The prompt to generate an image from"},"seed":{"title":"Seed","maximum":4294967295.0,"minimum":-1.0,"type":"integer","description":"The seed to use (-1 for a random seed)","default":-1},"steps":{"title":"Steps","exclusiveMinimum":0.0,"type":"integer","description":"The number of steps to use to generate the image","default":10},"width":{"title":"Width","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The width of the resulting image","default":512},"height":{"title":"Height","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The height of the resulting image","default":512},"cfg_scale":{"title":"Cfg Scale","exclusiveMinimum":0.0,"type":"number","description":"The Classifier-Free Guidance, higher values may result in a result closer to the prompt","default":7.5},"sampler_name":{"title":"Sampler Name","enum":["ddim","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun","k_lms","plms"],"type":"string","description":"The sampler to use","default":"k_lms"},"seamless":{"title":"Seamless","type":"boolean","description":"Whether or not to generate an image that can tile without seams","default":false},"model":{"title":"Model","type":"string","description":"The model to use (currently ignored)","default":""},"progress_images":{"title":"Progress Images","type":"boolean","description":"Whether or not to produce progress images during generation","default":false},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The input image"},"strength":{"title":"Strength","maximum":1.0,"exclusiveMinimum":0.0,"type":"number","description":"The strength of the original image","default":0.75},"fit":{"title":"Fit","type":"boolean","description":"Whether or not the result should be fit to the aspect ratio of the input image","default":true},"mask":{"title":"Mask","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The mask"},"inpaint_replace":{"title":"Inpaint Replace","maximum":1.0,"minimum":0.0,"type":"number","description":"The amount by which to replace masked areas with latent noise","default":0.0}},"description":"Generates an image using inpaint.","output":{"$ref":"#/components/schemas/ImageOutput"}},"InverseLerpInvocation":{"title":"InverseLerpInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["ilerp"],"type":"string","default":"ilerp"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to lerp"},"min":{"title":"Min","maximum":255.0,"minimum":0.0,"type":"integer","description":"The minimum input value","default":0},"max":{"title":"Max","maximum":255.0,"minimum":0.0,"type":"integer","description":"The maximum input value","default":255}},"description":"Inverse linear interpolation of all pixels of an image","output":{"$ref":"#/components/schemas/ImageOutput"}},"IterateInvocation":{"title":"IterateInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["iterate"],"type":"string","default":"iterate"},"collection":{"title":"Collection","type":"array","items":{},"description":"The list of items to iterate over"},"index":{"title":"Index","type":"integer","description":"The index, will be provided on executed iterators","default":0}},"description":"A node to process inputs and produce outputs.\nMay use dependency injection in __init__ to receive providers.","output":{"$ref":"#/components/schemas/IterateInvocationOutput"}},"IterateInvocationOutput":{"title":"IterateInvocationOutput","description":"Used to connect iteration outputs. Will be expanded to a specific output.","type":"object","properties":{"type":{"title":"Type","default":"iterate_output","enum":["iterate_output"],"type":"string"},"item":{"title":"Item","description":"The item being iterated over"}}},"LerpInvocation":{"title":"LerpInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["lerp"],"type":"string","default":"lerp"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to lerp"},"min":{"title":"Min","maximum":255.0,"minimum":0.0,"type":"integer","description":"The minimum output value","default":0},"max":{"title":"Max","maximum":255.0,"minimum":0.0,"type":"integer","description":"The maximum output value","default":255}},"description":"Linear interpolation of all pixels of an image","output":{"$ref":"#/components/schemas/ImageOutput"}},"LoadImageInvocation":{"title":"LoadImageInvocation","required":["id","image_type","image_name"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["load_image"],"type":"string","default":"load_image"},"image_type":{"allOf":[{"$ref":"#/components/schemas/ImageType"}],"description":"The type of the image"},"image_name":{"title":"Image Name","type":"string","description":"The name of the image"}},"description":"Load an image from a filename and provide it as output.","output":{"$ref":"#/components/schemas/ImageOutput"}},"MaskFromAlphaInvocation":{"title":"MaskFromAlphaInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["tomask"],"type":"string","default":"tomask"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to create the mask from"},"invert":{"title":"Invert","type":"boolean","description":"Whether or not to invert the mask","default":false}},"description":"Extracts the alpha channel of an image as a mask.","output":{"$ref":"#/components/schemas/MaskOutput"}},"MaskOutput":{"title":"MaskOutput","description":"Base class for invocations that output a mask","type":"object","properties":{"type":{"title":"Type","default":"mask","enum":["mask"],"type":"string"},"mask":{"title":"Mask","description":"The output mask","allOf":[{"$ref":"#/components/schemas/ImageField"}]}}},"PaginatedResults_GraphExecutionState_":{"title":"PaginatedResults[GraphExecutionState]","required":["items","page","pages","per_page","total"],"type":"object","properties":{"items":{"title":"Items","type":"array","items":{"$ref":"#/components/schemas/GraphExecutionState"},"description":"Items"},"page":{"title":"Page","type":"integer","description":"Current Page"},"pages":{"title":"Pages","type":"integer","description":"Total number of pages"},"per_page":{"title":"Per Page","type":"integer","description":"Number of items per page"},"total":{"title":"Total","type":"integer","description":"Total number of items in result"}},"description":"Paginated results"},"PasteImageInvocation":{"title":"PasteImageInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["paste"],"type":"string","default":"paste"},"base_image":{"title":"Base Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The base image"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to paste"},"mask":{"title":"Mask","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The mask to use when pasting"},"x":{"title":"X","type":"integer","description":"The left x coordinate at which to paste the image","default":0},"y":{"title":"Y","type":"integer","description":"The top y coordinate at which to paste the image","default":0}},"description":"Pastes an image into another image.","output":{"$ref":"#/components/schemas/ImageOutput"}},"PromptOutput":{"title":"PromptOutput","type":"object","properties":{"type":{"title":"Type","enum":["prompt"],"type":"string","default":"prompt"},"prompt":{"title":"Prompt","type":"string","description":"The output prompt"}},"description":"Base class for invocations that output a prompt"},"RestoreFaceInvocation":{"title":"RestoreFaceInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["restore_face"],"type":"string","default":"restore_face"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The input image"},"strength":{"title":"Strength","maximum":1.0,"exclusiveMinimum":0.0,"type":"number","description":"The strength of the restoration","default":0.75}},"description":"Restores faces in an image.","output":{"$ref":"#/components/schemas/ImageOutput"}},"ShowImageInvocation":{"title":"ShowImageInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["show_image"],"type":"string","default":"show_image"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The image to show"}},"description":"Displays a provided image, and passes it forward in the pipeline.","output":{"$ref":"#/components/schemas/ImageOutput"}},"TextToImageInvocation":{"title":"TextToImageInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["txt2img"],"type":"string","default":"txt2img"},"prompt":{"title":"Prompt","type":"string","description":"The prompt to generate an image from"},"seed":{"title":"Seed","maximum":4294967295.0,"minimum":-1.0,"type":"integer","description":"The seed to use (-1 for a random seed)","default":-1},"steps":{"title":"Steps","exclusiveMinimum":0.0,"type":"integer","description":"The number of steps to use to generate the image","default":10},"width":{"title":"Width","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The width of the resulting image","default":512},"height":{"title":"Height","multipleOf":64.0,"exclusiveMinimum":0.0,"type":"integer","description":"The height of the resulting image","default":512},"cfg_scale":{"title":"Cfg Scale","exclusiveMinimum":0.0,"type":"number","description":"The Classifier-Free Guidance, higher values may result in a result closer to the prompt","default":7.5},"sampler_name":{"title":"Sampler Name","enum":["ddim","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun","k_lms","plms"],"type":"string","description":"The sampler to use","default":"k_lms"},"seamless":{"title":"Seamless","type":"boolean","description":"Whether or not to generate an image that can tile without seams","default":false},"model":{"title":"Model","type":"string","description":"The model to use (currently ignored)","default":""},"progress_images":{"title":"Progress Images","type":"boolean","description":"Whether or not to produce progress images during generation","default":false}},"description":"Generates an image using text2img.","output":{"$ref":"#/components/schemas/ImageOutput"}},"UpscaleInvocation":{"title":"UpscaleInvocation","required":["id"],"type":"object","properties":{"id":{"title":"Id","type":"string","description":"The id of this node. Must be unique among all nodes."},"type":{"title":"Type","enum":["upscale"],"type":"string","default":"upscale"},"image":{"title":"Image","allOf":[{"$ref":"#/components/schemas/ImageField"}],"description":"The input image"},"strength":{"title":"Strength","maximum":1.0,"exclusiveMinimum":0.0,"type":"number","description":"The strength","default":0.75},"level":{"title":"Level","enum":[2,4],"type":"integer","description":"The upscale level","default":2}},"description":"Upscales an image.","output":{"$ref":"#/components/schemas/ImageOutput"}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}} \ No newline at end of file diff --git a/invokeai/frontend/web/src/services/fixtures/request.ts b/invokeai/frontend/web/src/services/fixtures/request.ts deleted file mode 100644 index 51c5f0f708..0000000000 --- a/invokeai/frontend/web/src/services/fixtures/request.ts +++ /dev/null @@ -1,353 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * DO NOT DELETE EVEN THOUGH IT IS NOT USED! - * - * Custom `request.ts` file for OpenAPI code generator. - * - * Patches the request logic in such a way that we can extract headers from requests. - * - * Copied from https://github.com/ferdikoomen/openapi-typescript-codegen/issues/829#issuecomment-1228224477 - * - * This file should be excluded in `tsconfig.json` and ignored by prettier/eslint! - */ - -import axios from 'axios'; -import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; -import FormData from 'form-data'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const HEADERS = Symbol('HEADERS'); - -const isDefined = ( - value: T | null | undefined -): value is Exclude => { - return value !== undefined && value !== null; -}; - -const isString = (value: any): value is string => { - return typeof value === 'string'; -}; - -const isStringWithValue = (value: any): value is string => { - return isString(value) && value !== ''; -}; - -const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); -}; - -const isFormData = (value: any): value is FormData => { - return value instanceof FormData; -}; - -const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: any) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach((v) => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: any) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver -): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - formData?: FormData -): Promise> => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); - const formHeaders = - (typeof formData?.getHeaders === 'function' && formData?.getHeaders()) || - {}; - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - ...formHeaders, - }) - .filter(([_, value]) => isDefined(value)) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), - {} as Record - ); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return headers; -}; - -const getRequestBody = (options: ApiRequestOptions): any => { - if (options.body) { - return options.body; - } - return undefined; -}; - -const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Record, - onCancel: OnCancel -): Promise> => { - const source = axios.CancelToken.source(); - - const requestConfig: AxiosRequestConfig = { - url, - headers, - data: body ?? formData, - method: options.method, - withCredentials: config.WITH_CREDENTIALS, - cancelToken: source.token, - }; - - onCancel(() => source.cancel('The user aborted a request.')); - - try { - return await axios.request(requestConfig); - } catch (error) { - const axiosError = error as AxiosError; - if (axiosError.response) { - return axiosError.response; - } - throw error; - } -}; - -const getResponseHeader = ( - response: AxiosResponse, - responseHeader?: string -): string | undefined => { - if (responseHeader) { - const content = response.headers[responseHeader]; - if (isString(content)) { - return content; - } - } - return undefined; -}; - -const getResponseBody = (response: AxiosResponse): any => { - if (response.status !== 204) { - return response.data; - } - return undefined; -}; - -const catchErrorCodes = ( - options: ApiRequestOptions, - result: ApiResult -): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors, - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - throw new ApiError(options, result, 'Generic Error'); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options, formData); - - if (!onCancel.isCancelled) { - const response = await sendRequest( - config, - options, - url, - body, - formData, - headers, - onCancel - ); - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader( - response, - options.responseHeader - ); - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - }; - - catchErrorCodes(options, result); - - resolve({ ...result.body, [HEADERS]: response.headers }); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/invokeai/frontend/web/src/services/thunks/image.ts b/invokeai/frontend/web/src/services/thunks/image.ts deleted file mode 100644 index fe198cf6f9..0000000000 --- a/invokeai/frontend/web/src/services/thunks/image.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { createAppAsyncThunk } from 'app/store/storeUtils'; -import { selectImagesAll } from 'features/gallery/store/imagesSlice'; -import { size } from 'lodash-es'; -import { ImagesService } from 'services/api'; - -type imageUrlsReceivedArg = Parameters< - (typeof ImagesService)['getImageUrls'] ->[0]; - -/** - * `ImagesService.getImageUrls()` thunk - */ -export const imageUrlsReceived = createAppAsyncThunk( - 'api/imageUrlsReceived', - async (arg: imageUrlsReceivedArg) => { - const response = await ImagesService.getImageUrls(arg); - return response; - } -); - -type imageMetadataReceivedArg = Parameters< - (typeof ImagesService)['getImageMetadata'] ->[0]; - -/** - * `ImagesService.getImageUrls()` thunk - */ -export const imageMetadataReceived = createAppAsyncThunk( - 'api/imageMetadataReceived', - async (arg: imageMetadataReceivedArg) => { - const response = await ImagesService.getImageMetadata(arg); - return response; - } -); - -type ControlNetAction = { - type: 'SET_CONTROLNET_IMAGE'; - controlNetId: string; -}; - -type InitialImageAction = { - type: 'SET_INITIAL_IMAGE'; -}; - -type NodesAction = { - type: 'SET_NODES_IMAGE'; - nodeId: string; - fieldName: string; -}; - -type CanvasInitialImageAction = { - type: 'SET_CANVAS_INITIAL_IMAGE'; -}; - -type CanvasMergedAction = { - type: 'TOAST_CANVAS_MERGED'; -}; - -type CanvasSavedToGalleryAction = { - type: 'TOAST_CANVAS_SAVED_TO_GALLERY'; -}; - -type UploadedToastAction = { - type: 'TOAST_UPLOADED'; -}; - -export type PostUploadAction = - | ControlNetAction - | InitialImageAction - | NodesAction - | CanvasInitialImageAction - | CanvasMergedAction - | CanvasSavedToGalleryAction - | UploadedToastAction; - -type ImageUploadedArg = Parameters<(typeof ImagesService)['uploadImage']>[0] & { - postUploadAction?: PostUploadAction; -}; - -/** - * `ImagesService.uploadImage()` thunk - */ -export const imageUploaded = createAppAsyncThunk( - 'api/imageUploaded', - async (arg: ImageUploadedArg) => { - // `postUploadAction` is only used by the listener middleware - destructure it out - const { postUploadAction, ...rest } = arg; - const response = await ImagesService.uploadImage(rest); - return response; - } -); - -type ImageDeletedArg = Parameters<(typeof ImagesService)['deleteImage']>[0]; - -/** - * `ImagesService.deleteImage()` thunk - */ -export const imageDeleted = createAppAsyncThunk( - 'api/imageDeleted', - async (arg: ImageDeletedArg) => { - const response = await ImagesService.deleteImage(arg); - return response; - } -); - -type ImageUpdatedArg = Parameters<(typeof ImagesService)['updateImage']>[0]; - -/** - * `ImagesService.updateImage()` thunk - */ -export const imageUpdated = createAppAsyncThunk( - 'api/imageUpdated', - async (arg: ImageUpdatedArg) => { - const response = await ImagesService.updateImage(arg); - return response; - } -); - -type ImagesListedArg = Parameters< - (typeof ImagesService)['listImagesWithMetadata'] ->[0]; - -export const IMAGES_PER_PAGE = 20; - -const DEFAULT_IMAGES_LISTED_ARG = { - isIntermediate: false, - limit: IMAGES_PER_PAGE, -}; - -/** - * `ImagesService.listImagesWithMetadata()` thunk - */ -export const receivedPageOfImages = createAppAsyncThunk( - 'api/receivedPageOfImages', - async (arg: ImagesListedArg, { getState }) => { - const state = getState(); - const { categories } = state.images; - const { selectedBoardId } = state.boards; - - const images = selectImagesAll(state).filter((i) => { - const isInCategory = categories.includes(i.image_category); - const isInSelectedBoard = selectedBoardId - ? i.board_id === selectedBoardId - : true; - return isInCategory && isInSelectedBoard; - }); - - let queryArg: ReceivedImagesArg = {}; - - if (size(arg)) { - queryArg = { - ...DEFAULT_IMAGES_LISTED_ARG, - offset: images.length, - ...arg, - }; - } else { - queryArg = { - ...DEFAULT_IMAGES_LISTED_ARG, - categories, - offset: images.length, - }; - } - - const response = await ImagesService.listImagesWithMetadata(queryArg); - return response; - } -); - -type ReceivedImagesArg = Parameters< - (typeof ImagesService)['listImagesWithMetadata'] ->[0]; - -/** - * `ImagesService.listImagesWithMetadata()` thunk - */ -export const receivedImages = createAppAsyncThunk( - 'api/receivedImages', - async (arg: ReceivedImagesArg, { getState }) => { - const response = await ImagesService.listImagesWithMetadata(arg); - return response; - } -); diff --git a/invokeai/frontend/web/src/services/thunks/session.ts b/invokeai/frontend/web/src/services/thunks/session.ts deleted file mode 100644 index 3c081f052f..0000000000 --- a/invokeai/frontend/web/src/services/thunks/session.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { createAppAsyncThunk } from 'app/store/storeUtils'; -import { GraphExecutionState, SessionsService } from 'services/api'; -import { log } from 'app/logging/useLogger'; -import { isObject } from 'lodash-es'; -import { isAnyOf } from '@reduxjs/toolkit'; - -const sessionLog = log.child({ namespace: 'session' }); - -type SessionCreatedArg = { - graph: Parameters< - (typeof SessionsService)['createSession'] - >[0]['requestBody']; -}; - -type SessionCreatedThunkConfig = { - rejectValue: { arg: SessionCreatedArg; error: unknown }; -}; - -/** - * `SessionsService.createSession()` thunk - */ -export const sessionCreated = createAppAsyncThunk< - GraphExecutionState, - SessionCreatedArg, - SessionCreatedThunkConfig ->('api/sessionCreated', async (arg, { rejectWithValue }) => { - try { - const response = await SessionsService.createSession({ - requestBody: arg.graph, - }); - return response; - } catch (error) { - return rejectWithValue({ arg, error }); - } -}); - -type SessionInvokedArg = { sessionId: string }; - -type SessionInvokedThunkConfig = { - rejectValue: { - arg: SessionInvokedArg; - error: unknown; - }; -}; - -const isErrorWithStatus = (error: unknown): error is { status: number } => - isObject(error) && 'status' in error; - -/** - * `SessionsService.invokeSession()` thunk - */ -export const sessionInvoked = createAppAsyncThunk< - void, - SessionInvokedArg, - SessionInvokedThunkConfig ->('api/sessionInvoked', async (arg, { rejectWithValue }) => { - const { sessionId } = arg; - - try { - const response = await SessionsService.invokeSession({ - sessionId, - all: true, - }); - return response; - } catch (error) { - if (isErrorWithStatus(error) && error.status === 403) { - return rejectWithValue({ arg, error: (error as any).body.detail }); - } - return rejectWithValue({ arg, error }); - } -}); - -type SessionCanceledArg = Parameters< - (typeof SessionsService)['cancelSessionInvoke'] ->[0]; -type SessionCanceledThunkConfig = { - rejectValue: { - arg: SessionCanceledArg; - error: unknown; - }; -}; -/** - * `SessionsService.cancelSession()` thunk - */ -export const sessionCanceled = createAppAsyncThunk< - void, - SessionCanceledArg, - SessionCanceledThunkConfig ->('api/sessionCanceled', async (arg: SessionCanceledArg, _thunkApi) => { - const { sessionId } = arg; - - const response = await SessionsService.cancelSessionInvoke({ - sessionId, - }); - - return response; -}); - -type SessionsListedArg = Parameters< - (typeof SessionsService)['listSessions'] ->[0]; - -/** - * `SessionsService.listSessions()` thunk - */ -export const listedSessions = createAppAsyncThunk( - 'api/listSessions', - async (arg: SessionsListedArg, _thunkApi) => { - const response = await SessionsService.listSessions(arg); - - sessionLog.info( - { arg, response }, - `Sessions listed (${response.items.length})` - ); - - return response; - } -); - -export const isAnySessionRejected = isAnyOf( - sessionCreated.rejected, - sessionInvoked.rejected -); diff --git a/invokeai/frontend/web/src/services/util/getHeaders.ts b/invokeai/frontend/web/src/services/util/getHeaders.ts deleted file mode 100644 index 510ba35770..0000000000 --- a/invokeai/frontend/web/src/services/util/getHeaders.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { HEADERS } from '../api/core/request'; - -/** - * Returns the response headers of the response received by the generated API client. - */ -export const getHeaders = (response: any): Record => { - if (!(HEADERS in response)) { - throw new Error('Response does not have headers'); - } - - return response[HEADERS]; -}; diff --git a/invokeai/frontend/web/yarn.lock b/invokeai/frontend/web/yarn.lock index e1ee68e95c..8cb6caea4b 100644 --- a/invokeai/frontend/web/yarn.lock +++ b/invokeai/frontend/web/yarn.lock @@ -2388,6 +2388,11 @@ ansi-align@^3.0.0: dependencies: string-width "^4.1.0" +ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + ansi-escapes@^4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -2655,6 +2660,13 @@ buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -5155,6 +5167,11 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanostores@^0.9.2: + version "0.9.2" + resolved "https://registry.yarnpkg.com/nanostores/-/nanostores-0.9.2.tgz#bd1d1792bc79168f6b331e3e61cfbf05e451e010" + integrity sha512-wfKlqLGtOYV9+qzGveqDOSWZUBgTeMr/g+JzfV/GofXQ//0wp0cgHF+QBVlmNH/JW9YA9QN+vR6N0vpniPpARA== + natural-compare-lite@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" @@ -5316,6 +5333,11 @@ open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" +openapi-fetch@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/openapi-fetch/-/openapi-fetch-0.4.0.tgz#45c368321ba6c15bc2e168e7dc3fbf322e9cca6d" + integrity sha512-4lzZtH5J1ZH9EXfmpcmKi0gOgjy0hc6BAcucAdCmLHY6jZopMeGP51vD3Cd4rE1nTFMfJzmYDc8ar0+364gBVw== + openapi-types@^12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.0.tgz#bd01acc937b73c9f6db2ac2031bf0231e21ebff0" @@ -5332,6 +5354,18 @@ openapi-typescript-codegen@^0.24.0: handlebars "^4.7.7" json-schema-ref-parser "^9.0.9" +openapi-typescript@^6.2.8: + version "6.2.8" + resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-6.2.8.tgz#71f43e932b1405a22a6fd5b94bcb37a90698a834" + integrity sha512-yA+y5MHiu6cjmtsGfNLavzVuvGCKzjL3H+exgHDPK6bnp6ZVFibtAiafenNSRDWL0x+7Sw/VPv5SbaqiPLW46w== + dependencies: + ansi-colors "^4.1.3" + fast-glob "^3.2.12" + js-yaml "^4.1.0" + supports-color "^9.3.1" + undici "^5.22.1" + yargs-parser "^21.1.1" + optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -6390,6 +6424,11 @@ stream-to-array@^2.3.0: dependencies: any-promise "^1.1.0" +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + string-argv@^0.3.1, string-argv@~0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -6548,6 +6587,11 @@ supports-color@^8.1.1: dependencies: has-flag "^4.0.0" +supports-color@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.3.1.tgz#34e4ad3c71c9a39dae3254ecc46c9b74e89e15a6" + integrity sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q== + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -6805,6 +6849,13 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici@^5.22.1: + version "5.22.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" + integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== + dependencies: + busboy "^1.6.0" + uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"