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 717417792c..ce1b515b84 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 @@ -34,10 +34,7 @@ export const addControlNetImageProcessedListener = () => { [controlNet.processorNode.id]: { ...controlNet.processorNode, is_intermediate: true, - image: pick(controlNet.controlImage, [ - 'image_name', - 'image_origin', - ]), + image: pick(controlNet.controlImage, ['image_name']), }, }, }; 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 f4376a4959..4c0c057242 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 @@ -25,7 +25,7 @@ export const addRequestedImageDeletionListener = () => { effect: (action, { dispatch, getState }) => { const { image, imageUsage } = action.payload; - const { image_name, image_origin } = image; + const { image_name } = image; const state = getState(); const selectedImage = state.gallery.selectedImage; @@ -79,9 +79,7 @@ export const addRequestedImageDeletionListener = () => { dispatch(imageRemoved(image_name)); // Delete from server - dispatch( - imageDeleted({ imageName: image_name, imageOrigin: image_origin }) - ); + dispatch(imageDeleted({ imageName: image_name })); }, }); }; 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 016e3ec8a8..ed308f08a8 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 @@ -20,7 +20,6 @@ export const addImageMetadataReceivedFulfilledListener = () => { dispatch( imageUpdated({ imageName: image.image_name, - imageOrigin: image.image_origin, requestBody: { 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 0b47f7a1be..c9ab894ddb 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 @@ -36,13 +36,12 @@ export const addInvocationCompleteEventListener = () => { // This complete event has an associated image output if (isImageOutput(result) && !nodeDenylist.includes(node.type)) { - const { image_name, image_origin } = result.image; + const { image_name } = result.image; // Get its metadata dispatch( imageMetadataReceived({ imageName: image_name, - imageOrigin: image_origin, }) ); 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 9bd3cd6dd2..3e211f73bb 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 @@ -11,12 +11,11 @@ export const addStagingAreaImageSavedListener = () => { startAppListening({ actionCreator: stagingAreaImageSaved, effect: async (action, { dispatch, getState, take }) => { - const { image_name, image_origin } = action.payload; + const { image_name } = action.payload; dispatch( imageUpdated({ imageName: image_name, - imageOrigin: image_origin, requestBody: { is_intermediate: false, }, 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 d02ffbe931..7cb8012848 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 @@ -80,11 +80,10 @@ export const addUpdateImageUrlsOnConnectListener = () => { `Fetching new image URLs for ${allUsedImages.length} images` ); - allUsedImages.forEach(({ image_name, image_origin }) => { + allUsedImages.forEach(({ image_name }) => { dispatch( imageUrlsReceived({ imageName: image_name, - imageOrigin: image_origin, }) ); }); 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 0ee3016bdb..4d8177d7f3 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 @@ -116,7 +116,6 @@ export const addUserInvokedCanvasListener = () => { // Update the base node with the image name and type baseNode.image = { image_name: baseImageDTO.image_name, - image_origin: baseImageDTO.image_origin, }; } @@ -143,7 +142,6 @@ export const addUserInvokedCanvasListener = () => { // Update the base node with the image name and type baseNode.mask = { image_name: maskImageDTO.image_name, - image_origin: maskImageDTO.image_origin, }; } @@ -160,7 +158,6 @@ export const addUserInvokedCanvasListener = () => { dispatch( imageUpdated({ imageName: baseNode.image.image_name, - imageOrigin: baseNode.image.image_origin, requestBody: { session_id: sessionId }, }) ); @@ -171,7 +168,6 @@ export const addUserInvokedCanvasListener = () => { dispatch( imageUpdated({ imageName: baseNode.mask.image_name, - imageOrigin: baseNode.mask.image_origin, requestBody: { session_id: sessionId }, }) ); diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts index dc86783642..b7092bf7e0 100644 --- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts @@ -866,8 +866,7 @@ export const canvasSlice = createSlice({ }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; state.layerState.objects.forEach((object) => { if (object.kind === 'image') { diff --git a/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts b/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts index d71ff4da68..f1b62cd997 100644 --- a/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts +++ b/invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts @@ -271,8 +271,7 @@ export const controlNetSlice = createSlice({ }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; forEach(state.controlNets, (c) => { if (c.controlImage?.image_name === image_name) { diff --git a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts index b9d091305a..4f250a7c3a 100644 --- a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts @@ -59,8 +59,7 @@ export const gallerySlice = createSlice({ } }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; if (state.selectedImage?.image_name === image_name) { state.selectedImage.image_url = image_url; diff --git a/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts b/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts index c9fc61d10d..9c18380c54 100644 --- a/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/imagesSlice.ts @@ -86,8 +86,7 @@ const imagesSlice = createSlice({ imagesAdapter.removeOne(state, imageName); }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; imagesAdapter.updateOne(state, { id: image_name, diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index 403a9292e1..5425d1cfd5 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -103,8 +103,7 @@ const nodesSlice = createSlice({ }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; state.nodes.forEach((node) => { forEach(node.data.inputs, (input) => { diff --git a/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts b/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts index 9aab13784f..1fd7eb2dba 100644 --- a/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/addControlNetToLinearGraph.ts @@ -66,17 +66,15 @@ export const addControlNetToLinearGraph = ( if (processedControlImage && processorType !== 'none') { // We've already processed the image in the app, so we can just use the processed image - const { image_name, image_origin } = processedControlImage; + const { image_name } = processedControlImage; controlNetNode.image = { image_name, - image_origin, }; } else if (controlImage) { // The control image is preprocessed - const { image_name, image_origin } = controlImage; + const { image_name } = controlImage; controlNetNode.image = { image_name, - image_origin, }; } else { // Skip ControlNets without an unprocessed image - should never happen if everything is working correctly diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts index f8fea7e4d7..4986d86713 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts @@ -354,7 +354,6 @@ export const buildImageToImageGraph = (state: RootState): Graph => { type: 'img_resize', image: { image_name: initialImage.image_name, - image_origin: initialImage.image_origin, }, is_intermediate: true, height, @@ -392,7 +391,6 @@ export const buildImageToImageGraph = (state: RootState): Graph => { // We are not resizing, so we need to set the image on the `IMAGE_TO_LATENTS` node explicitly set(graph.nodes[IMAGE_TO_LATENTS], 'image', { image_name: initialImage.image_name, - image_origin: initialImage.image_origin, }); // Pass the image's dimensions to the `NOISE` node 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 558f937837..e29b46af70 100644 --- a/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts +++ b/invokeai/frontend/web/src/features/nodes/util/nodeBuilders/buildImageToImageNode.ts @@ -57,8 +57,7 @@ export const buildImg2ImgNode = ( } imageToImageNode.image = { - image_name: initialImage.name, - image_origin: initialImage.type, + image_name: initialImage.image_name, }; } diff --git a/invokeai/frontend/web/src/features/parameters/store/actions.ts b/invokeai/frontend/web/src/features/parameters/store/actions.ts index eba01248d1..e9f708fc03 100644 --- a/invokeai/frontend/web/src/features/parameters/store/actions.ts +++ b/invokeai/frontend/web/src/features/parameters/store/actions.ts @@ -1,11 +1,5 @@ import { createAction } from '@reduxjs/toolkit'; -import { isObject } from 'lodash-es'; -import { ImageDTO, ResourceOrigin } from 'services/api'; - -export type ImageNameAndOrigin = { - image_name: string; - image_origin: ResourceOrigin; -}; +import { ImageDTO } from 'services/api'; 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 3512ded3ab..f516229efe 100644 --- a/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/web/src/features/parameters/store/generationSlice.ts @@ -234,8 +234,7 @@ export const generationSlice = createSlice({ }); builder.addCase(imageUrlsReceived.fulfilled, (state, action) => { - const { image_name, image_origin, image_url, thumbnail_url } = - action.payload; + const { image_name, image_url, thumbnail_url } = action.payload; if (state.initialImage?.image_name === image_name) { state.initialImage.image_url = image_url;