diff --git a/invokeai/app/api/routers/session_queue.py b/invokeai/app/api/routers/session_queue.py index 7ecb0504a3..40f1f2213b 100644 --- a/invokeai/app/api/routers/session_queue.py +++ b/invokeai/app/api/routers/session_queue.py @@ -12,13 +12,11 @@ from invokeai.app.services.session_queue.session_queue_common import ( CancelByBatchIDsResult, ClearResult, EnqueueBatchResult, - EnqueueGraphResult, PruneResult, SessionQueueItem, SessionQueueItemDTO, SessionQueueStatus, ) -from invokeai.app.services.shared.graph import Graph from invokeai.app.services.shared.pagination import CursorPaginatedResults from ..dependencies import ApiDependencies @@ -33,23 +31,6 @@ class SessionQueueAndProcessorStatus(BaseModel): processor: SessionProcessorStatus -@session_queue_router.post( - "/{queue_id}/enqueue_graph", - operation_id="enqueue_graph", - responses={ - 201: {"model": EnqueueGraphResult}, - }, -) -async def enqueue_graph( - queue_id: str = Path(description="The queue id to perform this operation on"), - graph: Graph = Body(description="The graph to enqueue"), - prepend: bool = Body(default=False, description="Whether or not to prepend this batch in the queue"), -) -> EnqueueGraphResult: - """Enqueues a graph for single execution.""" - - return ApiDependencies.invoker.services.session_queue.enqueue_graph(queue_id=queue_id, graph=graph, prepend=prepend) - - @session_queue_router.post( "/{queue_id}/enqueue_batch", operation_id="enqueue_batch", diff --git a/invokeai/app/services/session_queue/session_queue_base.py b/invokeai/app/services/session_queue/session_queue_base.py index b5272f1868..e0b6e4f528 100644 --- a/invokeai/app/services/session_queue/session_queue_base.py +++ b/invokeai/app/services/session_queue/session_queue_base.py @@ -9,7 +9,6 @@ from invokeai.app.services.session_queue.session_queue_common import ( CancelByQueueIDResult, ClearResult, EnqueueBatchResult, - EnqueueGraphResult, IsEmptyResult, IsFullResult, PruneResult, @@ -17,7 +16,6 @@ from invokeai.app.services.session_queue.session_queue_common import ( SessionQueueItemDTO, SessionQueueStatus, ) -from invokeai.app.services.shared.graph import Graph from invokeai.app.services.shared.pagination import CursorPaginatedResults @@ -29,11 +27,6 @@ class SessionQueueBase(ABC): """Dequeues the next session queue item.""" pass - @abstractmethod - def enqueue_graph(self, queue_id: str, graph: Graph, prepend: bool) -> EnqueueGraphResult: - """Enqueues a single graph for execution.""" - pass - @abstractmethod def enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult: """Enqueues all permutations of a batch for execution.""" diff --git a/invokeai/app/services/session_queue/session_queue_common.py b/invokeai/app/services/session_queue/session_queue_common.py index 48e1da83b5..cbf2154b66 100644 --- a/invokeai/app/services/session_queue/session_queue_common.py +++ b/invokeai/app/services/session_queue/session_queue_common.py @@ -276,14 +276,6 @@ class EnqueueBatchResult(BaseModel): priority: int = Field(description="The priority of the enqueued batch") -class EnqueueGraphResult(BaseModel): - enqueued: int = Field(description="The total number of queue items enqueued") - requested: int = Field(description="The total number of queue items requested to be enqueued") - batch: Batch = Field(description="The batch that was enqueued") - priority: int = Field(description="The priority of the enqueued batch") - queue_item: SessionQueueItemDTO = Field(description="The queue item that was enqueued") - - class ClearResult(BaseModel): """Result of clearing the session queue""" diff --git a/invokeai/app/services/session_queue/session_queue_sqlite.py b/invokeai/app/services/session_queue/session_queue_sqlite.py index 4daab9cdbc..7259a7bd0c 100644 --- a/invokeai/app/services/session_queue/session_queue_sqlite.py +++ b/invokeai/app/services/session_queue/session_queue_sqlite.py @@ -17,7 +17,6 @@ from invokeai.app.services.session_queue.session_queue_common import ( CancelByQueueIDResult, ClearResult, EnqueueBatchResult, - EnqueueGraphResult, IsEmptyResult, IsFullResult, PruneResult, @@ -28,7 +27,6 @@ from invokeai.app.services.session_queue.session_queue_common import ( calc_session_count, prepare_values_to_insert, ) -from invokeai.app.services.shared.graph import Graph from invokeai.app.services.shared.pagination import CursorPaginatedResults from invokeai.app.services.shared.sqlite import SqliteDatabase @@ -255,32 +253,6 @@ class SqliteSessionQueue(SessionQueueBase): ) return cast(Union[int, None], self.__cursor.fetchone()[0]) or 0 - def enqueue_graph(self, queue_id: str, graph: Graph, prepend: bool) -> EnqueueGraphResult: - enqueue_result = self.enqueue_batch(queue_id=queue_id, batch=Batch(graph=graph), prepend=prepend) - try: - self.__lock.acquire() - self.__cursor.execute( - """--sql - SELECT * - FROM session_queue - WHERE queue_id = ? - AND batch_id = ? - """, - (queue_id, enqueue_result.batch.batch_id), - ) - result = cast(Union[sqlite3.Row, None], self.__cursor.fetchone()) - except Exception: - self.__conn.rollback() - raise - finally: - self.__lock.release() - if result is None: - raise SessionQueueItemNotFoundError(f"No queue item with batch id {enqueue_result.batch.batch_id}") - return EnqueueGraphResult( - **enqueue_result.model_dump(), - queue_item=SessionQueueItemDTO.queue_item_dto_from_dict(dict(result)), - ) - def enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult: try: self.__lock.acquire() diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/anyEnqueued.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/anyEnqueued.ts index ff11491b53..3f0e3342f9 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/anyEnqueued.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/anyEnqueued.ts @@ -1,15 +1,9 @@ -import { isAnyOf } from '@reduxjs/toolkit'; import { queueApi } from 'services/api/endpoints/queue'; import { startAppListening } from '..'; -const matcher = isAnyOf( - queueApi.endpoints.enqueueBatch.matchFulfilled, - queueApi.endpoints.enqueueGraph.matchFulfilled -); - export const addAnyEnqueuedListener = () => { startAppListening({ - matcher, + matcher: queueApi.endpoints.enqueueBatch.matchFulfilled, effect: async (_, { dispatch, getState }) => { const { data } = queueApi.endpoints.getQueueStatus.select()(getState()); 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 f3db0ea65f..a454e5ca48 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,22 +1,22 @@ import { logger } from 'app/logging/logger'; import { parseify } from 'common/util/serialize'; +import { controlAdapterImageProcessed } from 'features/controlAdapters/store/actions'; import { - pendingControlImagesCleared, controlAdapterImageChanged, - selectControlAdapterById, controlAdapterProcessedImageChanged, + pendingControlImagesCleared, + selectControlAdapterById, } from 'features/controlAdapters/store/controlAdaptersSlice'; +import { isControlNetOrT2IAdapter } from 'features/controlAdapters/store/types'; import { SAVE_IMAGE } from 'features/nodes/util/graphBuilders/constants'; import { addToast } from 'features/system/store/systemSlice'; import { t } from 'i18next'; import { imagesApi } from 'services/api/endpoints/images'; import { queueApi } from 'services/api/endpoints/queue'; import { isImageOutput } from 'services/api/guards'; -import { Graph, ImageDTO } from 'services/api/types'; +import { BatchConfig, ImageDTO } from 'services/api/types'; import { socketInvocationComplete } from 'services/events/actions'; import { startAppListening } from '..'; -import { controlAdapterImageProcessed } from 'features/controlAdapters/store/actions'; -import { isControlNetOrT2IAdapter } from 'features/controlAdapters/store/types'; export const addControlNetImageProcessedListener = () => { startAppListening({ @@ -37,41 +37,46 @@ export const addControlNetImageProcessedListener = () => { // ControlNet one-off procressing graph is just the processor node, no edges. // Also we need to grab the image. - const graph: Graph = { - nodes: { - [ca.processorNode.id]: { - ...ca.processorNode, - is_intermediate: true, - image: { image_name: ca.controlImage }, - }, - [SAVE_IMAGE]: { - id: SAVE_IMAGE, - type: 'save_image', - is_intermediate: true, - use_cache: false, + + const enqueueBatchArg: BatchConfig = { + prepend: true, + batch: { + graph: { + nodes: { + [ca.processorNode.id]: { + ...ca.processorNode, + is_intermediate: true, + image: { image_name: ca.controlImage }, + }, + [SAVE_IMAGE]: { + id: SAVE_IMAGE, + type: 'save_image', + is_intermediate: true, + use_cache: false, + }, + }, + edges: [ + { + source: { + node_id: ca.processorNode.id, + field: 'image', + }, + destination: { + node_id: SAVE_IMAGE, + field: 'image', + }, + }, + ], }, + runs: 1, }, - edges: [ - { - source: { - node_id: ca.processorNode.id, - field: 'image', - }, - destination: { - node_id: SAVE_IMAGE, - field: 'image', - }, - }, - ], }; + try { const req = dispatch( - queueApi.endpoints.enqueueGraph.initiate( - { graph, prepend: true }, - { - fixedCacheKey: 'enqueueGraph', - } - ) + queueApi.endpoints.enqueueBatch.initiate(enqueueBatchArg, { + fixedCacheKey: 'enqueueBatch', + }) ); const enqueueResult = await req.unwrap(); req.reset(); @@ -83,8 +88,8 @@ export const addControlNetImageProcessedListener = () => { const [invocationCompleteAction] = await take( (action): action is ReturnType => socketInvocationComplete.match(action) && - action.payload.data.graph_execution_state_id === - enqueueResult.queue_item.session_id && + action.payload.data.queue_batch_id === + enqueueResult.batch.batch_id && action.payload.data.source_node_id === SAVE_IMAGE ); @@ -116,7 +121,10 @@ export const addControlNetImageProcessedListener = () => { ); } } catch (error) { - log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue')); + log.error( + { enqueueBatchArg: parseify(enqueueBatchArg) }, + t('queue.graphFailedToQueue') + ); // handle usage-related errors if (error instanceof Object) { diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/upscaleRequested.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/upscaleRequested.ts index c252f412a6..9ddcdc9701 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/upscaleRequested.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/upscaleRequested.ts @@ -6,7 +6,7 @@ import { addToast } from 'features/system/store/systemSlice'; import { t } from 'i18next'; import { queueApi } from 'services/api/endpoints/queue'; import { startAppListening } from '..'; -import { ImageDTO } from 'services/api/types'; +import { BatchConfig, ImageDTO } from 'services/api/types'; import { createIsAllowedToUpscaleSelector } from 'features/parameters/hooks/useIsAllowedToUpscale'; export const upscaleRequested = createAction<{ imageDTO: ImageDTO }>( @@ -44,20 +44,23 @@ export const addUpscaleRequestedListener = () => { const { esrganModelName } = state.postprocessing; const { autoAddBoardId } = state.gallery; - const graph = buildAdHocUpscaleGraph({ - image_name, - esrganModelName, - autoAddBoardId, - }); + const enqueueBatchArg: BatchConfig = { + prepend: true, + batch: { + graph: buildAdHocUpscaleGraph({ + image_name, + esrganModelName, + autoAddBoardId, + }), + runs: 1, + }, + }; try { const req = dispatch( - queueApi.endpoints.enqueueGraph.initiate( - { graph, prepend: true }, - { - fixedCacheKey: 'enqueueGraph', - } - ) + queueApi.endpoints.enqueueBatch.initiate(enqueueBatchArg, { + fixedCacheKey: 'enqueueBatch', + }) ); const enqueueResult = await req.unwrap(); @@ -67,7 +70,10 @@ export const addUpscaleRequestedListener = () => { t('queue.graphQueued') ); } catch (error) { - log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue')); + log.error( + { enqueueBatchArg: parseify(enqueueBatchArg) }, + t('queue.graphFailedToQueue') + ); // handle usage-related errors if (error instanceof Object) { diff --git a/invokeai/frontend/web/src/features/queue/hooks/useIsQueueMutationInProgress.ts b/invokeai/frontend/web/src/features/queue/hooks/useIsQueueMutationInProgress.ts index abb3967b92..9947c17086 100644 --- a/invokeai/frontend/web/src/features/queue/hooks/useIsQueueMutationInProgress.ts +++ b/invokeai/frontend/web/src/features/queue/hooks/useIsQueueMutationInProgress.ts @@ -3,7 +3,6 @@ import { // useCancelByBatchIdsMutation, useClearQueueMutation, useEnqueueBatchMutation, - useEnqueueGraphMutation, usePruneQueueMutation, useResumeProcessorMutation, usePauseProcessorMutation, @@ -14,10 +13,6 @@ export const useIsQueueMutationInProgress = () => { useEnqueueBatchMutation({ fixedCacheKey: 'enqueueBatch', }); - const [_triggerEnqueueGraph, { isLoading: isLoadingEnqueueGraph }] = - useEnqueueGraphMutation({ - fixedCacheKey: 'enqueueGraph', - }); const [_triggerResumeProcessor, { isLoading: isLoadingResumeProcessor }] = useResumeProcessorMutation({ fixedCacheKey: 'resumeProcessor', @@ -44,7 +39,6 @@ export const useIsQueueMutationInProgress = () => { // }); return ( isLoadingEnqueueBatch || - isLoadingEnqueueGraph || isLoadingResumeProcessor || isLoadingPauseProcessor || isLoadingCancelQueue || diff --git a/invokeai/frontend/web/src/services/api/endpoints/queue.ts b/invokeai/frontend/web/src/services/api/endpoints/queue.ts index ab75964e89..d44e333850 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/queue.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/queue.ts @@ -83,30 +83,6 @@ export const queueApi = api.injectEndpoints({ } }, }), - enqueueGraph: build.mutation< - paths['/api/v1/queue/{queue_id}/enqueue_graph']['post']['responses']['201']['content']['application/json'], - paths['/api/v1/queue/{queue_id}/enqueue_graph']['post']['requestBody']['content']['application/json'] - >({ - query: (arg) => ({ - url: `queue/${$queueId.get()}/enqueue_graph`, - body: arg, - method: 'POST', - }), - invalidatesTags: [ - 'SessionQueueStatus', - 'CurrentSessionQueueItem', - 'NextSessionQueueItem', - ], - onQueryStarted: async (arg, api) => { - const { dispatch, queryFulfilled } = api; - try { - await queryFulfilled; - resetListQueryData(dispatch); - } catch { - // no-op - } - }, - }), resumeProcessor: build.mutation< paths['/api/v1/queue/{queue_id}/processor/resume']['put']['responses']['200']['content']['application/json'], void @@ -341,7 +317,6 @@ export const queueApi = api.injectEndpoints({ export const { useCancelByBatchIdsMutation, - useEnqueueGraphMutation, useEnqueueBatchMutation, usePauseProcessorMutation, useResumeProcessorMutation, diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts index d4678dc03b..6bc54f0e35 100644 --- a/invokeai/frontend/web/src/services/api/schema.d.ts +++ b/invokeai/frontend/web/src/services/api/schema.d.ts @@ -5,6 +5,13 @@ export type paths = { + "/api/v1/sessions/{session_id}": { + /** + * Get Session + * @description Gets a session + */ + get: operations["get_session"]; + }; "/api/v1/utilities/dynamicprompts": { /** * Parse Dynamicprompts @@ -275,13 +282,6 @@ export type paths = { */ get: operations["get_invocation_cache_status"]; }; - "/api/v1/queue/{queue_id}/enqueue_graph": { - /** - * Enqueue Graph - * @description Enqueues a graph for single execution. - */ - post: operations["enqueue_graph"]; - }; "/api/v1/queue/{queue_id}/enqueue_batch": { /** * Enqueue Batch @@ -800,17 +800,6 @@ export type components = { */ prepend?: boolean; }; - /** Body_enqueue_graph */ - Body_enqueue_graph: { - /** @description The graph to enqueue */ - graph: components["schemas"]["Graph"]; - /** - * Prepend - * @description Whether or not to prepend this batch in the queue - * @default false - */ - prepend?: boolean; - }; /** Body_import_model */ Body_import_model: { /** @@ -1897,7 +1886,7 @@ export type components = { * Created By * @description The name of the creator of the image */ - created_by: string | null; + created_by?: string | null; /** * Positive Prompt * @description The positive prompt parameter @@ -2476,28 +2465,6 @@ export type components = { */ priority: number; }; - /** EnqueueGraphResult */ - EnqueueGraphResult: { - /** - * Enqueued - * @description The total number of queue items enqueued - */ - enqueued: number; - /** - * Requested - * @description The total number of queue items requested to be enqueued - */ - requested: number; - /** @description The batch that was enqueued */ - batch: components["schemas"]["Batch"]; - /** - * Priority - * @description The priority of the enqueued batch - */ - priority: number; - /** @description The queue item that was enqueued */ - queue_item: components["schemas"]["SessionQueueItemDTO"]; - }; /** * FaceIdentifier * @description Outputs an image with detected face IDs printed on each face. For use with other FaceTools. @@ -3035,7 +3002,7 @@ export type components = { * @description The nodes in this graph */ nodes?: { - [key: string]: components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["MainModelLoaderInvocation"]; + [key: string]: components["schemas"]["IntegerInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["ColorMapImageProcessorInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["StringInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["FloatInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["InfillColorInvocation"]; }; /** * Edges @@ -3072,7 +3039,7 @@ export type components = { * @description The results of node executions */ results: { - [key: string]: components["schemas"]["SDXLLoraLoaderOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["String2Output"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SchedulerOutput"]; + [key: string]: components["schemas"]["String2Output"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["SDXLLoraLoaderOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["StringPosNegOutput"]; }; /** * Errors @@ -9138,6 +9105,18 @@ export type components = { /** Ui Order */ ui_order: number | null; }; + /** + * ControlNetModelFormat + * @description An enumeration. + * @enum {string} + */ + ControlNetModelFormat: "checkpoint" | "diffusers"; + /** + * StableDiffusion1ModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; /** * StableDiffusionOnnxModelFormat * @description An enumeration. @@ -9151,41 +9130,29 @@ export type components = { */ StableDiffusion2ModelFormat: "checkpoint" | "diffusers"; /** - * StableDiffusion1ModelFormat + * IPAdapterModelFormat * @description An enumeration. * @enum {string} */ - StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; - /** - * ControlNetModelFormat - * @description An enumeration. - * @enum {string} - */ - ControlNetModelFormat: "checkpoint" | "diffusers"; + IPAdapterModelFormat: "invokeai"; /** * CLIPVisionModelFormat * @description An enumeration. * @enum {string} */ CLIPVisionModelFormat: "diffusers"; - /** - * StableDiffusionXLModelFormat - * @description An enumeration. - * @enum {string} - */ - StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; - /** - * IPAdapterModelFormat - * @description An enumeration. - * @enum {string} - */ - IPAdapterModelFormat: "invokeai"; /** * T2IAdapterModelFormat * @description An enumeration. * @enum {string} */ T2IAdapterModelFormat: "diffusers"; + /** + * StableDiffusionXLModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; }; responses: never; parameters: never; @@ -9200,6 +9167,36 @@ export type external = Record; export type operations = { + /** + * 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: { + content: never; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; /** * Parse Dynamicprompts * @description Creates a batch process @@ -10309,43 +10306,6 @@ export type operations = { }; }; }; - /** - * Enqueue Graph - * @description Enqueues a graph for single execution. - */ - enqueue_graph: { - parameters: { - path: { - /** @description The queue id to perform this operation on */ - queue_id: string; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["Body_enqueue_graph"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - content: { - "application/json": components["schemas"]["EnqueueGraphResult"]; - }; - }; - /** @description Created */ - 201: { - content: { - "application/json": components["schemas"]["EnqueueGraphResult"]; - }; - }; - /** @description Validation Error */ - 422: { - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - }; - }; /** * Enqueue Batch * @description Processes a batch and enqueues the output graphs for execution. diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts index 6fda849b89..63617a4eb5 100644 --- a/invokeai/frontend/web/src/services/api/types.ts +++ b/invokeai/frontend/web/src/services/api/types.ts @@ -26,7 +26,6 @@ export type BatchConfig = paths['/api/v1/queue/{queue_id}/enqueue_batch']['post']['requestBody']['content']['application/json']; export type EnqueueBatchResult = components['schemas']['EnqueueBatchResult']; -export type EnqueueGraphResult = components['schemas']['EnqueueGraphResult']; /** * This is an unsafe type; the object inside is not guaranteed to be valid.