diff --git a/invokeai/frontend/web/src/app/invokeai.d.ts b/invokeai/frontend/web/src/app/invokeai.d.ts index e01e414d03..a8d0315ad7 100644 --- a/invokeai/frontend/web/src/app/invokeai.d.ts +++ b/invokeai/frontend/web/src/app/invokeai.d.ts @@ -124,6 +124,20 @@ export declare type Image = { category: GalleryCategory; isBase64?: boolean; dreamPrompt?: 'string'; + name?: string; +}; + +/** + * ResultImage + */ +export declare type ResultImage = { + name: string; + url: string; + thumbnail: string; + width: number; + height: number; + timestamp: number; + metadata?: Metadata; }; // GalleryImages is an array of Image. diff --git a/invokeai/frontend/web/src/services/apiSlice.ts b/invokeai/frontend/web/src/services/apiSlice.ts index 8798a2eb1f..9da408ef01 100644 --- a/invokeai/frontend/web/src/services/apiSlice.ts +++ b/invokeai/frontend/web/src/services/apiSlice.ts @@ -1,11 +1,8 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import { v4 as uuidv4 } from 'uuid'; import { ProgressImage } from './events/types'; import { createSession, invokeSession } from 'services/thunks/session'; import { getImage, uploadImage } from './thunks/image'; -import * as InvokeAI from 'app/invokeai'; -import { addImage } from 'features/gallery/store/gallerySlice'; /** * Just temp until we work out better statuses diff --git a/invokeai/frontend/web/src/services/invokeMiddleware.ts b/invokeai/frontend/web/src/services/invokeMiddleware.ts index bdb6006f68..5689786d7f 100644 --- a/invokeai/frontend/web/src/services/invokeMiddleware.ts +++ b/invokeai/frontend/web/src/services/invokeMiddleware.ts @@ -35,6 +35,7 @@ export const invokeMiddleware: Middleware = const uploadLocation = action.payload; console.log('uploadImage.fulfilled'); + // TODO: actually get correct attributes here const newImage: InvokeAI.Image = { uuid: uuidv4(), category: 'user', @@ -49,6 +50,7 @@ export const invokeMiddleware: Middleware = const { activeTab } = getState().ui; const activeTabName = tabMap[activeTab]; + if (activeTabName === 'unifiedCanvas') { dispatch(setInitialCanvasImage(newImage)); } else if (activeTabName === 'img2img') {